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
10
votes
4 answers

Load testing on an API using python

I am currently writing python script for load testing an API.I want to check how many requests can an API take at a time.The API is for registration so I have to send unique parameters everytime. Is there anyway I could achieve it through locust or…
dave Miller
  • 304
  • 1
  • 6
  • 16
10
votes
3 answers

Locust: how I share auth cookie with the rest of tasks only for current locust user?

I am looking into to moving my multi-threaded python script to locust. A simple explanation of what my script does is: Create a thread per user In each thread authenticates user and get auth cookie With that auth cookie perform various api calls at…
Alex D
  • 703
  • 2
  • 7
  • 23
10
votes
2 answers

Locust.io: Controlling the request per second parameter

I have been trying to load test my API server using Locust.io on EC2 compute optimized instances. It provides an easy-to-configure option for setting the consecutive request wait time and number of concurrent users. In theory, rps = wait time X…
siddharthlatest
  • 2,237
  • 1
  • 20
  • 24
10
votes
4 answers

Locust : How to invoke the test through an API

I would like to invoke Locust load tests through an API to be able to start tests from a CI tool. I dont see much documentation about such a scenario, there is no "Runner" or a similar class in the locust API documentation. I checked the "locust"…
binithb
  • 1,910
  • 4
  • 23
  • 44
9
votes
3 answers

How to run locust with multiple test files

How to run locust tests with multiple locustfiles. The locust documentation is not very clear on how to do this.
Michael George
  • 647
  • 9
  • 15
9
votes
2 answers

How can I perform Load testing with Locust using PyTest?

What do you think is it possible to perform Load testing using PyTest? For example: import locust class UsersTest(locust.TaskSet): @locust.seq_task(1) def api_get_task(self): self.client.get("/api", name="GET /api") # Самое…
8
votes
3 answers

using multi-CPU platforms with locust

I am running htop on the same machine where locust is running. during the tests I have been running this morning, I see one CPU (of 4) hit 100% while the other CPUs are largely idle. I have also observed up to 8 locust tasks running. This is not…
Chris Hare
  • 161
  • 2
  • 12
8
votes
5 answers

Stop Locust When Specified Number Of User Tasks Complete

In my scenario, I'm running Locust without the web UI. The command I'm using is locust -f my_locust_file --no_web -c 20 -r 4 # as a hack I add -t 10s This corresponds to a 4 users being hatched every second up to a total of 20 users. My…
CK215
  • 175
  • 1
  • 2
  • 7
8
votes
3 answers

How to fail setup in Locust?

I'm doing a verification in my Locust setup and if that fails, I would like locust to exit immediately. To do that, I'm raising an exception, but locust continues with the tests until time limit is reached. I'd like for it to not even start the…
Joao Coelho
  • 2,838
  • 4
  • 30
  • 36
8
votes
2 answers

Can't reach Locust WebInterface "ERR_CONNECTION_REFUSED"

I wanted to test my project with Locust on Windows 10. The script seems to run properly (no errors in CMD), but i can't connect to the web interface http://127.0.0.1:8089 (ERR_CONNECTION_REFUSED). I am guessing, that this has to do with…
Bladerxdxi
  • 111
  • 1
  • 8
8
votes
5 answers

How to write Locust result of test api to file

I invoke the test through API, locust -f locustfile.py --host=http://localhost --no-web --hatch-rate=20 --clients=10000 and got a result Name # reqs # fails Avg Min Max | …
Le Kim Trang
  • 369
  • 2
  • 5
  • 17
8
votes
3 answers

Locust: got 0 response status_code and None content

I have written a simple load test using Locust (http://locust.io). Now I noticed that sometimes (using a higher load) the response I get from a post call has a status_code of 0 and a None content. The 0 status code is not automatically recognized as…
obecker
  • 2,132
  • 1
  • 19
  • 23
7
votes
2 answers

Locust.io setup, teardown not executed

I'm trying to understand the flow within a locust test. I've set up this very simple task set and user: from locust import TaskSet, HttpLocust, task class BlazeDemoTaskSet(TaskSet): def setup(self): print("hello from taskset…
user1641178
  • 71
  • 1
  • 4
7
votes
5 answers

Where can I find locust logs?

I'm using locust to stress test our app. I'm getting errors because the POST call seems incorrect. Where can I see the logs for locust? I'd like to see what the post call looks like to see what's wrong. Here's my code in case someone can tell me…
Beenz
  • 153
  • 1
  • 2
  • 7
6
votes
2 answers

SSL error CERTIFICATE_VERIFY_FAILED with Locust when using Docker

It's my first try at Locus, and unfortunately I don't know Python. I'm trying a simple request to a valid https server, and I see this error: SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate After…
greg
  • 696
  • 1
  • 9
  • 16
1
2
3
57 58