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
0
votes
1 answer

Locust/pyCharm: Each end point with N users to achieve X RPS

I am working on Locust/pyCharm project to have separate file for each end point with different no of users to achieve different RPS for each endpoint. In code snippet below if I remove if __name__ == '__main__': ApiUser().run() and run .py file…
BeHappy
  • 138
  • 2
  • 17
0
votes
0 answers

locust io http POST missing headers on every other request

I have a locustfile.py that repeatedly makes the same http post request. The first post contains all of the request headers that I'm expecting and the post returns with http 200. The next post is missing all headers with the exception of…
Barry
  • 417
  • 6
  • 18
0
votes
1 answer

Load generated by distributed worker processes is not equivalent generated by single process

I start another test trying to figure how users are allocated to worker node. Here is my locust file. @task def mytask(self): self.client.get("/") class QuickstartUser(HttpUser): wait_time = between(1, 2) tasks = [mytask] It is…
Alan Hoo
  • 445
  • 3
  • 12
0
votes
2 answers

How to create more than 20 virtual environments and run load test in each of them?

I want a load test to run from 20 clients but I have only single machine for this. Is it possible to do this in JMeter or locust?
nikhil bisht
  • 21
  • 1
  • 3
0
votes
1 answer

Locust method for some setup before each task

Is there some method (ideally for a User class) or event or other way in Locust to execute some setup code before each task? What I have looked into: there are some useful events, unfortunately none like on_task_start there are some useful methods…
DaveFar
  • 7,078
  • 4
  • 50
  • 90
0
votes
1 answer

Locust : HTTPConnectionClosed

I am using locust for load testing, I have deployed locust in kubernetes with master and workers. I am testing with 100 users and Hatch rate 20 users. After certain requests, I am continuously facing the issue with 'HttpConnectionClosed'. I have…
Sanjay Chintha
  • 326
  • 1
  • 4
  • 21
0
votes
1 answer

How to use Locust to send bytes of a socket

I need to use Locust to send custom bytes on a socket to load test my apps. I don't quite see how do that. I can only see it being used as a HTTP traffic injector which is not suitable for my purposes. I need something more along the lines of this…
Jenia Ivanov
  • 2,485
  • 3
  • 41
  • 69
0
votes
1 answer

Locust IO failures 'BadStatusCode' meaning

I'm using locust to load test APIs, but every time I'm testing API which need parameter other than authorization to be inputted like this: It always fail at 100% which says 'BadStatusCode('endpoint',)', already google what does it mean and search…
0
votes
4 answers

events.request_success += test_success_handle TypeError: unsupported operand type(s) for +=: 'EventHook' and 'function'

I am new to locust tool and trying to write the individual success and failure to console. Here is the error received during execution. Error: events.request_success += test_success_handle TypeError: unsupported operand type(s) for +=: 'EventHook'…
Hanu
  • 1
0
votes
2 answers

How would I pass variables to a `@events.test_start.add_listener` function

I'm trying to run load tests with locust but I need to run some API calls before I start spawning workers. I already pass my user credentials as environment variables but I don't want to have to hard-code the host within the locustfile. I'm ideally…
ahoyt41
  • 17
  • 1
  • 7
0
votes
2 answers

Kubernetes : An existing connection was forcibly closed by the remote host

My Website is developed using Python Flask and deployed to Kubernetes and it is running with gunicorn -k gevent --workers=8 --threads=5 apps.webapp:app I am doing load test my project app with 100 users and Hatching rate 10 on locust, but everytime…
Sanjay Chintha
  • 326
  • 1
  • 4
  • 21
0
votes
2 answers

Locust RPS value not coming correct #LOCUST # rpsissue

we are getting very low Rps value according to the excepted result. Is there any way to control RPS value using python??
0
votes
1 answer

Locust post request error when request input is a list of elements

I am trying to send a post request of the list of elements and I am getting too many values to unpack exception. Code: @task def success_predict(self): success_payload = [ {"REQUEST_ID": "123456", "ATT1": "A", "ATT2":…
Bikash Shaw
  • 49
  • 3
  • 9
0
votes
1 answer

Is there a way to find the number of task instance in Locust?

I want my locust program to run a set of tasks every 10th time. I.e in the below code, out of 10 task instances I want task1 to run in all and task2, task3 to run only once. How to do that? class WebsiteUser(HttpUser): host =…
0
votes
2 answers

How to use css selector and xpath extractor in locust?

I have earlier used jmeter css selector and XPath extractor post processor to retrieve Csrf token. Is there anyway to use these in locust as well I want to fetch from value attribute
nikhil bisht
  • 21
  • 1
  • 3