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

Create locust tasks dynamically?

Basically I need to spawn 30 users and have 50 different tasks for them I need them to run in parallel. So I am trying to generate 50 tasks like following: class UserSimulation(HttpUser): host = os.environ['BASE_URL'] # time in seconds the…
D_Asti
  • 59
  • 7
0
votes
1 answer

Locust Load Testing running into infinite loop

i am really new to Python with Locust load testing. I Created the below Python script but its running into infinite loop. I have used Number of total users to simulate = 1 Spawn rate = 1 Please let me know where i am going wrong. from locust import…
Topgun
  • 1
  • 2
0
votes
1 answer

when run locust --master and client locust --master-host,locust can not run api stress,why?

qs when run locust --master and client locust --master-host, locust can not run api stress,why? env server: locust -f locustfile.py --master (centos) client: locust -f locustfile.py --worker --master-host 10.200.6.1 (mac) status visit webUI,worker…
Lewis
  • 1
  • 2
0
votes
2 answers

How to pass some input to my Flask AI API in my locustfile.py

I'd like to do a load test over my NLP web app using Locust. The website is simple where users only need to pass in their text and its language type, and then the results will show on the next page. Therefore, I want to make my "locusts" to first…
0
votes
1 answer

Cannot set content of locust.stats_logger into log file

In locust Docs, https://docs.locust.io/en/stable/logging.html. locust.stats_logger is used to periodically print the current stats to the console. The stats does not go into the log file when --logfile is used by default.So I set --logfile args in…
xjlin
  • 21
  • 6
0
votes
1 answer

Locust- how to pass different host address

We have two tasks under the same class, both are pointing to different hosts. Example: First task (Create a new token) pointing to host - HTTP://xyz.abc.new Second task (Create a new token-old) pointing to host- HTTP://xyz.abc.old import…
Saagar
  • 794
  • 3
  • 20
  • 41
0
votes
1 answer

Load Test Video Streaming with Locust

I am doing research on how to load test a video streaming player using Locust, but haven't been able to make it work. Basically, I have a playback URL that loads a player and I can pass parameters to the player, including autoPlay=true. So, I tried…
thenewjames
  • 966
  • 2
  • 14
  • 25
0
votes
1 answer

Can Master Ec2 machine also act as worker machine?

I have a scenario where I have spinned up 2 ec2 instances. One acts as a master and the other as the worker. I am running the test in step load mode. I wanted to check if I can use the master to act as a worker (while running in step load- since I…
Contraboy
  • 99
  • 1
  • 1
  • 10
0
votes
1 answer

How to create a custom socket client in locust

I want to custom a tcp socket client in locust.And before add event ,my code was worked. locustTcp.py import time import random import socket from locust import User, TaskSet, events, task, event, HttpUser class TcpSocketClient(socket.socket): …
xjlin
  • 21
  • 6
0
votes
1 answer

Dynamically generating directories for logs and results

I'm trying to configure locust to store my log files into a a logs/ directory. For example: # example.conf locustfile = example/locust.py host = http://www.example.com users = 10 spawn-rate = 10 logfile = logs/example.log However, locust will fail…
ahoyt41
  • 17
  • 1
  • 7
0
votes
1 answer

Unable to improve RPS for my locust tests

I am trying to load-test a server call, whose response time is around 3 seconds. I am trying to increase load to this server but the maximum rps I get is 0.3-0.4. I have 100 users and I have kept the hatch rate 100/s. Also, the wait_time is…
Krash
  • 2,085
  • 3
  • 13
  • 36
0
votes
1 answer

Locust, on_start method doesn't work with tasks

I am trying to add some variables (e.g. self.boolean_flag) to HttpUser. Which represents the user state. This variable is used in scenario load testing. According to the documentation, I should use on_start to initialise variables. However, when I…
zcahfg2
  • 861
  • 1
  • 12
  • 27
0
votes
1 answer

How to send a new random number with every request in locust?

I have a simple use case which i am trying to achieve. I basically want to pass a new random number in my URL with every request. It seems like its passing the same random number every time though. class UserBehavior(SequentialTaskSet): @task …
Contraboy
  • 99
  • 1
  • 1
  • 10
0
votes
1 answer

Multiple tasks and reading user and hatch rate from Locust config file

How to call separate end points with separate no of users and hatch rate, as specified in config file. Following is basic code. Please suggest. from locust import HttpUser, task, between, TaskSet, User from locust.env import Environment class…
BeHappy
  • 138
  • 2
  • 17
0
votes
1 answer

In distributed mode can locust know if other worker already run task for a particular user

community. I need users created by different workers not to be duplicated. I.e. if worker_1 create user fake1 and run task for this user, worker_2 must not to be able create user fake1. Currently it works only in standalone mode. credentials = […
Vitali
  • 1
  • 1