-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Comments
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? |
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 |
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. |
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 ? |
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. |
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. |
i want to schedule a call in advance , say 5 seconds in advance. How to schedule millions of calls in the most efficient way ?
The text was updated successfully, but these errors were encountered: