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
6
votes
0 answers

Locust : ConnectionError(ProtocolError('Connection aborted.', BadStatusLine("''",)),)

I am performing Load-tests for some Rest APIs using Locust. Everything is working fine except for the error which has confused me: ConnectionError(ProtocolError('Connection aborted.', BadStatusLine("''",)),) I have read other questions regarding…
Haris
  • 764
  • 4
  • 9
  • 27
6
votes
1 answer

Elastic Beanstalk reports 5xx errors even though instances are in perfect health

I need to set up an api application for gathering event data to be used in a recommendation engine. This is my setup: Elastic Beanstalk env with a load balancer and autoscaling group. I have 2x t2.medium instances running behind a load…
Martin Klosi
  • 3,098
  • 4
  • 32
  • 39
6
votes
0 answers

aiohttp websocket performance testing with locust

I wrote websocket server using aiohttp python library. Now I'm trying to test performance using locust and this snippet, but locust can't open more than 2000 connections (websocket.create_connection() raises error: [Errno 104] Connection reset by…
6
votes
0 answers

How do I add a file to a POST request made in Locust.io?

I'm using Locust.io to load test a python/django website that accepts image upload:: headers = {'content-type': 'multipart/form-data'} image = open('img.jpg', 'rb') payload = {'id': self.id} files = {'photo': image} upload_result =…
Anuj Acharya
  • 546
  • 2
  • 9
  • 18
5
votes
0 answers

django.db.utils.OperationalError: FATAL: sorry, too many clients already

I am running a Django app on Django's development server with PostgreSQL as the backend database. I got this error: django.db.utils.OperationalError: FATAL: sorry, too many clients already when I was doing a load testing using Locust. My Locust…
vanbastelaer
  • 368
  • 2
  • 15
5
votes
1 answer

ImportError: cannot import name 'HttpUser' from 'locust'

I am trying the locust quick start in my mac and I am getting this error for any import I try. I have python 2.7 and python 3.7 installed in my machine but i use only python 3.7 ➜ ~ python -V Python 2.7.16 ➜ ~ python3 -V Python 3.7.5 my locust…
Eli m
  • 83
  • 1
  • 7
5
votes
3 answers

How to run Locust with multiprocessing on a single machine

I want Locust to use all cores on my PC. I have many Locust classes and I want to use Locust as a library. Example of my code: import gevent from locust.env import Environment from locust.stats import stats_printer from locust.log import…
5
votes
3 answers

How to close TCP connection in python locust (requests.session)

I'm doing a load test with python Locust package on an service API that's running on Kubernetes. I saw in the source code that the HttpUser uses requests.session.request() to send the requests. By default requests.session keeps the connection alive…
Xuekai Du
  • 617
  • 1
  • 6
  • 27
5
votes
2 answers

Task weight and sequence in python locust

I need to implement the next logic: 1) Execute on_start method (eg login) 2) Execute the next task (task_2) 5 times 3) After that execute the next task (task_3) 10 times Return to on_start etc... So finally I need login:1, task_2: 5, task_3:…
SergeyMoroz
  • 117
  • 3
  • 11
5
votes
1 answer

How do I fix an SSLCertVerificationError while running a test with locust

I'm testing an internal website and on playback I'm seeing this error: POST /Ex_ACO_EI/Details/2433: 'SSLError(MaxRetryError("HTTPSConnectionPool(host=\'examiner-stage.site.com\', port=443): Max retries exceeded with url: /Ex_ACO_EI/Details/24…
5
votes
0 answers

Constant number of parallel requests with Locust

I wanted to make some load testing with Locust, in order to know how my system respond to parallel requests. Let's say my system get 10 requests at the same time. My first reflex was to measure the reponse time for each of those 10 requests. I made…
Eldy
  • 1,027
  • 1
  • 13
  • 31
5
votes
1 answer

Meaning of terms after analysis in Locust Load Testing

I am using Locust (Modern Open Source Load Testing Tool) for Load testing of APIs. As it is simulation + analysis tool, I am not able to understand some of the terms. Below is the screen-shot of the test which I have done on the API. Terms I want…
user4722851
5
votes
1 answer

Locustio (Python) login

I want to make some load tests on the website. First of all, that's my code: from locust import HttpLocust, TaskSet, task class UserBehavior(TaskSet): def on_start(self): """ on_start is called when a Locust start before any task is scheduled…
user6133328
5
votes
1 answer

Getting statistics on an individual task from Locust

I have a Locust task that requires many HTTP requests. At the end of the task, I have conditions to check for success or failure. The statistics gathered are very informative in regards to the individual HTTP requests, but I would like to know more…
Sam Bobel
  • 1,784
  • 1
  • 15
  • 26
5
votes
5 answers

Locust. Read --host value from python code

locust --no-web --client=1 --hatch-rate=1 --num-request=2 --host= http://localhost I want to read --host value provided in cmd line in my HTTPLocust class. I am aware I can use host attribute for direct assignment but I do not want it. I want to…
PKS
  • 63
  • 1
  • 6
1 2
3
57 58