909 questions
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 ...
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 ...
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
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 ...
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,...
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
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 ...
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 ...
-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 ...
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'
...
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 ...
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/...
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 ...
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):
...
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: ...
0
votes
0
answers
45
views
Measure Botpress message response time using Locust.io and Python
We integrate Botpress into our website and want to use Locust.io to perform performance test. But I see that the response time of Create Message API is not enough. I want to measure the time: from ...
0
votes
1
answer
175
views
Locust Worker Setup Failing
locust -f locust_test.py --master-host=10.5.0.3 --master --master-port=8089 > master.log 2>&1 & for x in {1..7}; do locust -f locust_test.py --master-host=10.5.0.3 --master-port=8089 --...
0
votes
0
answers
154
views
Why is the RPS Fluctuating Dramatically During Locust Stress Testing and Not Reaching the Server as Specified?
I’m using Locust for stress testing my application API, but I’m experiencing dramatic fluctuations in the Requests Per Second (RPS). For example, the RPS goes up to 2000 and then drops to 2 RPS in 2 ...
0
votes
1
answer
277
views
How to Generate Detailed Logs for All Requests in Locust Stress Testing?
I'm using Locust for stress testing my application API, and I need to generate detailed logs for all HTTPS requests sent during the test. Specifically, I want to capture the following details for each ...
1
vote
1
answer
98
views
Locust Gevent friendly socket
I have the following client listed below to send request to my server using a custom protobuf message. How do I make this gevent friendly so I can make connection in parallel. Right now it seems the ...
1
vote
1
answer
90
views
Python Locust using raw socket requests
I am using the Locust library to load test a server that listens to TCP/IP socket requests and expecting custom protobuf messages. I have a similator sending message to the server and with locust I am ...
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. ...
0
votes
0
answers
237
views
Sudden RPS Spike When a Locust Worker Fails to Send Heartbeat
Description:
We are experiencing a critical issue with Locust during our performance tests. Our setup includes 170 Locust worker agents and a Locust master. The tests aim to simulate up to 250,000 ...
1
vote
1
answer
122
views
Not able to use Locust as Library
Reading the locust manuals, there is an example on how to use locust as library here https://docs.locust.io/en/2.0.0/use-as-lib.html , I'm rewriting the code here for conveninece:
import gevent
from ...
0
votes
0
answers
80
views
how to share headers among SequentialTaskSet tasks called by HttpUser class?
I need to pass headers to a sequence of API calls (all of which extend both SequentialTaskSet and ApiUser; ApiUser being an extension of HttpUser(, the Locust documentation for TaskSet told me that ...
1
vote
0
answers
257
views
Unable to stop Locust as Greenlet/Gevent error found causing state to stuck at CleanUp
We are using Locust to run performance tests on our FastAPI endpoints on Google Cloud Platform. Intermittently, we encounter an issue that would not allow us to stop the test due to an error related ...
0
votes
1
answer
95
views
Locust polymorphism with class as argument
I'm writing Locust scripts and want to extend a base class. There are two values (dto_class and api_suffix) that are different from one sub-class to another. Everything else is shared
locust_base.py (...
0
votes
0
answers
90
views
How do I make 404s show up as errors or even warnings in locust log output?
I'm trying to understand locust log levels. Why am I only seeing this in DEBUG output?
[2024-05-06 15:25:54,465] e9d5c4e3e3eb/DEBUG/selenium.webdriver.remote.remote_connection: Remote response: status=...
0
votes
1
answer
261
views
Terminate cleanly after an exact number of Task executions have occurred across multiple processes
Following on from a previous question1, I want locust to terminate a run once I've performed an exact number of requests across multiple Users and processes. I can track the progress on a per-User ...
0
votes
0
answers
106
views
Locust Load Test - Fixed RPS
I'm testing API endpoints in which the test case is that in total 10 minutes I have to ramp up users linearly until the rps is >= 70 if rps greater than 70 and the current time is < 60 minutes ...
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 ...
1
vote
1
answer
58
views
Python and parameter in Locust request
Given a SequantialTask in a locust script I want to replace 73808 with the list all_pp_ids.
How can I construct the data= parameter of my post request to instead take in the list as parameter? Now it ...
0
votes
0
answers
103
views
How do I make google pubsub work with Locust?
I'm trying to implement a GCloudSubUser for the Python library Locust. I'm implementing this custom User because I need the user to:
send a message to a topic of Google Pub/sub
The issues seems to be ...
-1
votes
1
answer
169
views
GitLab CI/CD Tests Fail (Connection Errors) for Flask App Despite Success Locally
Body:
I am experiencing consistent issues with my GitLab CI/CD pipeline, where all types of tests (stress, functional, and e2e) consistently fail when executed in the pipeline but pass without any ...