Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to schedule a call #197

Closed
TachyonFlare opened this issue Sep 16, 2014 · 6 comments
Closed

Ability to schedule a call #197

TachyonFlare opened this issue Sep 16, 2014 · 6 comments

Comments

@TachyonFlare
Copy link

i want to schedule a call in advance , say 5 seconds in advance. How to schedule millions of calls in the most efficient way ?

@heyman
Copy link
Member

heyman commented Sep 16, 2014

Though possible, I'm not sure it really fits into Locust's model.

Each Locust instance is supposed to represent a user, and one is supposed to write TaskSets that mimics user behaviour in a realistic way. Then when you spawn millions of users (locust instances) simultaneously, they will generate millions of requests to your system, and these requests will follow a realistic real world pattern.

Could you elaborate more on what you're trying to achieve?

@TachyonFlare
Copy link
Author

We are performing a load testing for a website , we have an expected number of users. and we also have the session length and the intervals in which an api is going to get called. so we need the ability to say call an api for thousands of users per interval basis and this is just one of the api. there are tens of such apis. so we need a mechanism to schedule the calls

@heyman
Copy link
Member

heyman commented Sep 17, 2014

I see. In that case couldn't you have a TaskSet where each task makes one or more API-call(s), and give the tasks a weight that represents the expected distribution of the API calls. Then set min_wait and max_wait of the TaskSet to have an average wait time that represents the interval that you knew the API was going to get called?

That would fit more into the "Locust way" of simulating user behaviour.

@TachyonFlare
Copy link
Author

okay , i guess it will workout in an use case where each the think time b/w each of the task is nearly equal vs in my case there is a difference in think time ranging from 40sec to 30min[for example a user is likely to click a button every 40 sec vs he will delete an item most probably for every 30 min]. Is there any way to handle the variance in think times ?

@heyman
Copy link
Member

heyman commented Sep 18, 2014

One way to handle it could be to make the wait time average 40 seconds, for example by setting min_wait to 20 and max_wait to 60. Then set the delete task's weight to have a 2.2% probability to be chosen, e.g. you could give the delete task a weight of 22 and the other tasks a total weight of 1000.

That would result in the delete task being called, on average, once every 30 minutes, so at least if you're simulating a large number of users, that could work.

@TachyonFlare
Copy link
Author

yes most probably , but that is on average. i am looking to introduce gevent.sleep to make it more accurate. anyway our requirement has changed now.It looks like we might not need the schedule feature as of now, but in my opinion the ability to schedule a call is a nice to have feature.

@heyman heyman closed this as completed Sep 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants