909 questions
6
votes
1
answer
9k
views
Websocket load test with locust
This is my first time writing a locustfile, and I am trying to implement websocket load testing with locust.
I have basically copied and pasted this example code from the locust plugin,
https://github....
1
vote
0
answers
55
views
Locust do not log success in case of GRPC endpoint returning a stream
Locust does not log success in case of GRPC endpoint returning a stream
Below is my setup:
locust==2.33
python
grpcio==1.70.0
grpcio-tools==1.62.1
protobuf==4.25.3
I am unable to see success on ...
2
votes
2
answers
575
views
Call API with given rate and constant throughput using locust load testing
Using locust load testing framework I need to call a single HTTP GET API with given pre defined rate and the through put should be always given requests per second rate. But according to the below ...
1
vote
0
answers
39
views
Locust POST Request with .xlsx File to Flask Endpoint Returns a 503 Error
I am testing my Python Flask app using Locust to load-test a POST request with an .xlsx file attachment. However, I consistently encounter a 503 Service Unavailable error.
This issue ONLY occurs when ...
1
vote
0
answers
38
views
Showing actual percentiles in locust reports
Is there a way to compute proper percentiles in Locust? The values are always rounded off to a multiple of 10.
I have read about Locust only estimating percentiles to save resources. But is there a ...
3
votes
1
answer
416
views
Can't debug locust script with python 3.12
I'm using locust 2.29.1 for my performance tests.
It works fine on Python 3.11.8 but now I'm trying to move to Python 3.12.4 and can't debug because it's freezing on the line with import locust. ...
1
vote
0
answers
46
views
WebSocket transcripts not received until connection is closed during Locust load test
I’m performing a WebSocket load test using Locust with websocket-client and a Flask webhook that receives transcripts.
The WebSocket connection works, audio chunks are sent correctly, and my backend ...
12
votes
3
answers
10k
views
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....
4
votes
3
answers
2k
views
Using locust with pytest
I am trying to run locust using pytest. I have created this python file but it is not showing any output. pytest doesnot collect the test. How can I use locust with pytest
from locust import HttpUser, ...
6
votes
2
answers
484
views
Getting request_before_redirect.url is None for POSTS requests in Locust Python
Trying to use locust following the documentation,
https://docs.locust.io/en/stable/quickstart.html
from locust import HttpUser, task
class TestUser(HttpUser):
# @task(1)
# def health(self):
...
4
votes
1
answer
286
views
Correct way to perform expensive per-worker setup
What's the correct / best way to perform costly per-process initialisation when using multiple workers, ensuring the workers can correctly communicate with the master?
As part of a custom locustfile....
0
votes
0
answers
21
views
My locust is sending less req data but its creating more orders, [closed]
i am using locust for load testing of one of the API of create order, but I am facing the issue on the terminal its showing that particular API reqs this number of time but when I am checking on ...
1
vote
1
answer
61
views
How to use Locust with multiple base URLs
I want to compare API response for two base URLs, comparing the monolithic vs micro architecture performance, but my code keeps picking up only the 1 url and doesn't create any hits for other URL as ...
0
votes
0
answers
34
views
python locust - tasks per user
I have the following tasks in locustfile
tasks ={task1:1, task2:1,task3:1, task4:1,task5:1, task6:1}
And trying to run each one in parallel by running locust with 6 users (so there is one task run by ...
0
votes
0
answers
38
views
Locust is installed via pip but not able to check version of locust in windows system
enter image description hereI followed steps mentioned in https://docs.locust.io/en/stable/installation.html for installing locust. But I am getting the error
('locust' is not recognised as an ...
0
votes
3
answers
2k
views
How to have Locust Master dynamically allocate users to slaves
I am trying to load test a HTTP URL(Dynamic) using Locust.io. I already have the python scripts that will make a GET call to the URL. The challenge i am facing is, the urls and the number of users are ...
1
vote
1
answer
649
views
Locust not supporting `--exit-code-on-error` argument?
Can someone help determining what I am doing wrong with having --exit-code-on-error?
python -m locust.main -f tt/tt_test.py -H http://thuis:8088/public --no-web --clients=3 --hatch-rate=1 --run-time=...
2
votes
0
answers
1k
views
Connection error while running locust load testing using Gunicorn for FastAPI
I am trying to do load testing using locust for FastAPI application using gunicorn
below is my load testing code
from locust import HttpUser, task, between
file_path = "file_path"
class ...
1
vote
1
answer
152
views
How to deal with JSON response which is in the form of list of JSON's in Locust (Python)
I get a response (using postman) in the following format when I make a POST request (and I am passing the payload when i make this POST request).
[{"id":22,"name":tom,"age&...
0
votes
1
answer
69
views
Locust distributed mode: "Unknown message type '_distributor_request' from worker.." warning halts users
I am using Locus in distributed mode with 1 master and n workers to run a load test.
I am also using the locust-plugins library to utilize its Distributor utility. My goal is to preallocate one unique ...
3
votes
3
answers
2k
views
Parallel robot framework tests via locust
We are trying to run the automation tests written in robot framework in parallel using locust.
As of now, we have been able to run the robot-framework test file through locust by using the robot-...
0
votes
0
answers
45
views
Locust: Official way to pause all users, run a global task on master, and then resume all users
I'm using Locust (version 2.32.3) to simulate multiple users performing work. I have a specific scenario I'd like to achieve clearly and efficiently:
All users perform their workload repeatedly.
At a ...
-3
votes
1
answer
102
views
Write CSV file with data in new row in python
I using python locust to do load test and my questions is i try to write csv file with email address as new row but it is separated the email charaters with ',' with each chracter like below:
z,b,r,X,...
1
vote
1
answer
2k
views
GRPC with locust tutorials/guide [closed]
Is there a working example where we have bidirectional communication of grpc with locust performance testing tool.
I don't see much working examples online where we have grpc with locust especially ...
0
votes
0
answers
25
views
Is there a way to simulate environments for testing in Locust?
Right now I'm trying to test out a new deep learning model on my local server using Locust. My local server uses a A6000 NVIDIA GPU which has around 46GB of VRAM. The problem is our production model ...
1
vote
0
answers
52
views
Locust: Jump to next user only when previous user is done with all tasks mentioned in load sequence
I am looking for a way, where for the below code next user comes in action only if current user is done with all of the tasks mentioned in a sequence. That is user should not be switched unless all ...
1
vote
2
answers
215
views
Locust - Authentication with GCP Metadata Server
Trying to write a simple load test with locust.
I just a have a single api which calls an endpoint get some data. The endpoint requires some credentials, lets say Http Basic auth.
I'm running this ...
5
votes
2
answers
15k
views
Using Locust with pre-defined requests per second
Looking at load testing tools, I found Locust and immediately found it appealing as a Python guy, but I'm not entirely sure if I can achieve the following scenario with it...
I'm tasked with load ...
-2
votes
1
answer
158
views
Locust Not Running
I had coded some simple locust load testing code in python. Previously, it running without any errors but after some time i run the code, the http request is not get executed.
class WebsiteUser(...
0
votes
0
answers
46
views
I am using load test shape in locust and unable to switch to subsequent user classes in the stages, using tick method
stages = [
{
"name": "BigOrderUser Test",
"duration": 400, # 10 minutes
"users": 1,
"spawn_rate&...
0
votes
1
answer
51
views
How to fix error "'WorkerNodes' object has no attribute 'encode'" while running code from Locust docs example of custom messages?
I am trying to do a distributed load generation and coordinate data between workers. There is an example of communicating across nodes from official Locust docs:
https://github.com/locustio/locust/...
0
votes
0
answers
37
views
How to divide request data in a non-overlapping manner per worker in Locust
I am trying to setup Locust for generating load (in a distributed manner) for my service. I am using a custom shape to ramp up the traffic, sustain it for a time period and then ramp down.
Now my use ...
1
vote
1
answer
291
views
Assign globally-unique user_id to each created User in multi-process setup
I'm attempting to distribute a list of pre-defined request payloads across all the Users which are spawned in my run. Conceptually I want to split my list of N requests across U Users, such that each ...
0
votes
1
answer
115
views
Setting "self.client.headers" in a locust test by reading values from a config.txt file
I'm using configparser to read below values in a sample text file named config.txt:
cookie='StaticWebAppsAuthCookie=GKeVpelA4wK+udvu7de737v7v8cv8v'
Accept='*/*'
Accept-Encoding=' gzip, deflate, br'
...
6
votes
2
answers
9k
views
Locust: how to specify a get request who takes query parameter
I want to load test my get request which is
http://localhost:8080/v1/synonyms/project/?keyword=dealer
and test method is
@task(2)
def get_synonym(self):
response = self.client.get("/v1/synonyms/...
0
votes
1
answer
133
views
How to get URL of a popup login window?
I want to write a locustfile for load testing. There is a local host on my system which I want to test (A social network called Oxwall). I need the user to login to Oxwall and then do some tasks, but ...
1
vote
0
answers
115
views
Locust on_start() method not executing requests
I am using Locust for performance testing, and I have a task that performs an API call in the on_start method. The on_start method prints the "started" message, but the request inside the ...
0
votes
1
answer
237
views
Most simple config not working for locust
This command works fine
locust --headless --users 10 --spawn-rate 1 -H http://localhost:3000
locustfile.py looks like that
from locust import HttpUser, task
class HelloWorldUser(HttpUser):
@task
...
1
vote
0
answers
250
views
Worker logs are trimmed in locustUI
I'm running locust in distributed node with logs.
The worker attempted to send more than 10 log lines in one interval. Further log sending was disabled for this worker.
The worker logs do not land ...
1
vote
2
answers
477
views
Customize percentages displayed in report.html by locust
I'm trying to add 98% in the locust report. The percentage is calculated by the application, in appears in the terminal. I just want it to appear in the html report next to the others. Any ideas on ...
0
votes
0
answers
87
views
Requests per second(RPS) not going above certain number with Hana database and Locust
I wanted to perform some load testing on Hana database. For this I decided to use Locust and I referenced the implementation given in this link for another database:
https://community.cratedb.com/t/...
2
votes
4
answers
9k
views
Python Locust 'locust' is not recognized as an internal or external command, operable program or batch file
I am using locust package which uses python. I am following this tutorial:
https://docs.locust.io/en/latest/quickstart.html#example-locustfile-py
But when i get to executing this code in command ...
1
vote
0
answers
30
views
Locust POST request does not return expected validation message from form submission
I am trying to simulate a form submission using Locust in Python. When manually submitting the form in a browser with incomplete data, I see the expected validation message: "Please make sure all ...
0
votes
1
answer
93
views
How to Fail a Polling Step in Locust on Timeout and Measure Total Time
I have a Locust test that executes a flow of steps:
@task
def execute_tasks():
test = TestFlow(self.client)
test.step1()
test.step2()
...
One of the steps involves polling for a status:
...
0
votes
0
answers
38
views
Locust 2.x is hatching rate is slowing down as the the of users increases
We run a loadtest with 119 tasks and weights ranging from 600000 to 2000. Average response time for the requests ranges from 500ms up to 3s.
Our test infrastructure has 100VMs with 32 cores. We run ...
0
votes
1
answer
133
views
How to retrieve statistics from master node as tests are running
I am running Locust tests using distributed load generation with the flag:
--processes -1
I used to get the stats while the tests were running from
from locust.stats import ...
-1
votes
1
answer
60
views
Strange locust behavior in extreme cases
I am working on a Ubuntu desktop and try to run load testing to check our server sites capacity. Usually my load testing is of 500 to 2000 users with the time range of 4 to 12 hours. And ...
0
votes
2
answers
81
views
How to pass argument into schedule_task for Locust?
Let's say that my test case is to get list of articles at news site and make a comment for the articles.
Here is how my code may look:
class MyTasks(TaskSet):
def post_comment(self. article_id: int):...
0
votes
0
answers
135
views
Locust: control the user creation sequence of multiple user classes
I have two user classes:
SyncUser
NormalUser
with the following code:
class syncUser(HttpUser):
host = '<hostname>'
def on_start(self):
self.userId = getsyncPullUser()
...
1
vote
1
answer
414
views
Collect (and chart/analyze) additional metrics with Locust
I'm trying to load test an API whose response exposes some additional custom metrics and attributes which aren't fully controllable from the request side but are known to correlate with performance: ...