Questions tagged [locust]

Locust is a Python based load testing framework (http://locust.io/)

Locust is an open source load testing tool, where user behaviour is defined in pure Python code

862 questions
34
votes
4 answers

Way to use locust.io by supplying user list

I need to stress-test a system and http://locust.io seems like the best way to go about this. However, it looks like it is set up to use the same user every time. I need each spawn to log in as a different user. How do I go about setting that up?…
jloosli
  • 2,461
  • 2
  • 22
  • 34
30
votes
3 answers

how to pass custom parameters to a locust test class?

I'm currently passing custom parameters to my load test using environment variables. For example, my test class looks like this: from locust import HttpLocust, TaskSet, task import os class UserBehavior(TaskSet): @task(1) def…
Chris Snow
  • 23,813
  • 35
  • 144
  • 309
28
votes
3 answers

Locust passing headers

Is it possible to have Locust pass a header command with a secure token to load test an API? I am trying to test our api for an encoder with a header flag for a token as the server being tested has to receive a token with the request, ie. curl -H…
Liam Douglas
  • 389
  • 1
  • 3
  • 3
26
votes
1 answer

Locust.io Load Testing getting "Connection aborted BadStatusLine" Errors

I'm using Locust.io to load test an application. I will get a random error that I am unable to pinpoint the problem: 1) ConnectionError(ProtocolError(\'Connection aborted.\', BadStatusLine("\'\'",)),) 2) ConnectionError(ProtocolError('Connection…
arcane
  • 457
  • 6
  • 10
23
votes
6 answers

Locust : How to make locust run for a specific amount of time

official locustio documentation tells about how to write simple locust tasks which run indefinitely. Couldn't find out how to run load which lasts for a specific amount of time, so that the test will automatically stop after the specified…
binithb
  • 1,910
  • 4
  • 23
  • 44
18
votes
1 answer

In locust How to get a response from one task and pass it to other task

I have started using Locust to do performance test. I want to fire two post request to two different end points. But the second post request needs response of the first request. How to do this in convenient way. I have tried like below but not…
Bidyut
  • 233
  • 2
  • 4
  • 7
16
votes
2 answers

What is the purpose of response time distribution in locust.io?

Would like to ask the experts here what is the purpose of response time distribution in locust.io? I could not figure out what does 50%, 60% means in the downloaded CSV.
Moses Liao GZ
  • 1,556
  • 5
  • 20
  • 45
15
votes
1 answer

How to interpret the metrics of Locust?

I found no detail about the Number of users to simulate and Hatch rate in the locust documentation. What is the relation between the two parameters? If I have 20 clients, of each will post 1000 requests/second to the server, how should I set the two…
Zelong
  • 2,476
  • 7
  • 31
  • 51
14
votes
2 answers

Why would I get a Forbidden message from AWS API Gateway, even though things are working internally?

I have AWS API gateway setup for a public endpoint with no auth. It connects to a websocket that triggers a Lambda. I was creating connections with Python's websocket-client lib at https://pypi.org/project/websocket_client/. I noticed that…
Dave Stein
  • 8,653
  • 13
  • 56
  • 104
13
votes
3 answers

Proper POST file upload (load testing with Locust)

I'm trying to make a load test for Django-based website. I use Locust 0.7.3 and python 2.7.10 Here I make POST - filling the form and attaching some file: class WebsiteTasks(TaskSet): def on_start(self): self.client.get("/") @task …
Nikolay Matkheev
  • 375
  • 1
  • 2
  • 10
12
votes
1 answer

locust load testing appropiate Number of users to simulate and hatch rate

I am doing load testing using locust. I write a script and set up everything for load testing. Only two points I do not understand actually, What is the meaning of the below numbers? e.g Number of total users to simulate Hatch rate (users…
Zakaria Shahed
  • 2,589
  • 6
  • 23
  • 52
12
votes
3 answers

How often does python-requests perform dns queries

We are using Locust to for load testing rest api services behind elastic load balancing. I came across this article regarding load balancing and auto scaling, which is something we are testing. Locust is using python-requests which is using…
djonsson
  • 603
  • 5
  • 14
12
votes
2 answers

how to keep session and CSRF token in locust test

I wan't to test my django web app with locust.io. In a form I have a problem with CSRF token. I do the following: class WebsiteTasks(TaskSet): def on_start(self): print("On start") @task def post_answer(self): …
renzop
  • 1,194
  • 2
  • 12
  • 26
11
votes
2 answers

Why am I getting a 403 error when running Locust?

I am using Locust (python) to load test on a Django web app. I keep getting a 403 error when I run my script. Here is the code: from locust import HttpLocust, TaskSet def index(l): l.client.get("/") def login(l): …
atkawa7
  • 461
  • 1
  • 6
  • 13
11
votes
1 answer

Locust.io Heavy Load Testing

Are there limits to the number of users locust.io can support in a "swarm"? Where is the documentation on distributed load testing for locust.io? We would like to load test our site with 50-100k concurrent users, and I see locust can support…
Jonathan Reyes
  • 1,387
  • 1
  • 10
  • 23
1
2 3
57 58