Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Is locust threadsafe?
@shaileshpadave49 You'll need to expand upon that

Hey friends! I'm currently writing a traffic replay framework, using locust as the base.

My current issue is this:

I want to be able to spawn locust workers and have them make requests asynchronously, and then report back to master, right? But! I need them to NOT play the same traffic. Essentially, I need a centralized entity to pub/sub events to tell my workers to make the requests.

I thought the obvious choice there was to have the locust master manage the messaging for sending the requests.

So I have two questions:

  1. How do I get the master to begin sending these requests? Is there a callback I can pass in to get the master running to do additional behavior?
  2. How do I get the master to send these events? I realize you're using zerorpc, but I've not found a way to tap into zerorpc while within a TaskSet or Behavior.
  3. For the workers, I figured I can add an additional callback to slave_report.
  4. Any additional wisdom you can provide for me? Should I set up a REAL task queue, or do you fell that pyzmq will meet my needs? I'm a devops guy, and I use a lot of kubernetes so calling helm install stable/redis isn't a huge deal.
Hi all, iam exploring Locust and trying to understand concepts, iam getting confused how request per second is calculated in Locust?, it shows total number of users spawned, any good docs for explaining it, or some would help me to understand better
Mukut Bhattacharjee
Hello all, I have been trying to swarm AWS IoT broker with Locust (mqtt) but not able to connect more than 334 clients per VM in any way. Any one faced this issue? I have also raised an issue in Github concurrencylabs/mqtt-locust#3
Renato Marinho
This message was deleted
Brent Hoover
Just getting started and I am wondering if it’s possible to run a test that does both HTTP requests and web socket. Currently it looks like you could do one or the other but is it possible to mix them?
Renato Marinho
This message was deleted
Andreas Nanko
Hi, is it possible to display requests with different url as groups ? I've created some lists for random requests like articles, categories, but I would like to see the average for the groups and not for every URL, because if you do random requests over 9k different article URL's everything gets a bit messy
Andreas Nanko
    self.client.get(url, name='Articles')
found it ^
Samkit Shah
Hi, I was wonderig if there’s any specific reason that we can’t get response status in the event-hooks https://docs.locust.io/en/stable/api.html#available-hooks
also, as I understand, we can either use the name or the uri but not both
Hi, I am trying to perform a load test for HTTPS endpoint and passing host in command line. But I am getting error like "File "/usr/local/lib/python3.7/site-packages/locust/core.py", line 96, in getattr
raise LocustError("No client instantiated. Did you intend to inherit from HttpLocust?")
locust.exception.LocustError: No client instantiated. Did you intend to inherit from HttpLocust?"
Can you help me with this.
maulana jayadi
hI guys
I want to ask with All of you,, how do you stop when the first task is running and stop automatically without clicking the stop button in the locust?
and how do you provide random values such as store_nama, email, phone and store_code in Body (Payload)? how do you add the parameters? what needs to be defined?
Reid Lai
Hi there, i have already used IoT simulation tool to generate huge set of payloads storing in PyTables inside HDF5 file. Each payload has a relative timestamp since simulation start time. I am now thinking to use Locust to load this table and run locust as scheduler based on the payload timestamp...is it possible? coz I am stucking at how to make user sessions to send out IoT MQTT payloads as job scheduler
Hi How to add ramp up time using locust ?
hi,guys. When I running locust distributed,the rps is lower than running one,Is there sometiong wrong?
hi, is there any way to integrate locust with pytest? we use pytest as functional testing, if it could be used as load testing suite will be best
Rishi Sharma
I am getting bad request while running POST Request in Locust
Rishi Sharma
Does anyone reply on this group
Andreas Nanko
@rishisharma108 dont think so. and additionally your question is not well described.
so whats the matter with your post request. i did a lot in the past without problems :-)
Rishi Sharma
Hi Andreas I am new to locust and I wasn't able to learn locust properly as the documentation is very less , so my request was failing. Now somehow I managed to pass the request successfully. If you can share a link or blog which can be used for learning it would be a great help.
Second thing there is no such recording feature available in Locust which is available in JMeter nad Gatlingio which makes difficult to create scripts in Locust.
Andreas Nanko
What kind of recording ? You can intercept every result and put it in whatever you like
def kpi_zabbix_handler(request_type, name, response_time, response_length, **kw):
    print("Successfully fetched: %s in %s" % (name, response_time))
    payload = []
    payload.append("- kpiMeasurement.discovery { \"data\": [{ \"{#KPINAME}\": \"%s\" }] }" % (name.replace(" ", "_")))
    payload.append("- kpiMeasurement[%s] %s" % (name.replace(" ", "_"), int(response_time)))

    with subprocess.Popen(["/usr/bin/zabbix_sender", "-c", "/etc/zabbix/zabbix_agentd.conf", "-i", "-"], stdin=subprocess.PIPE) as proc:
      proc.stdin.write(bytes("\n".join(payload), encoding='utf-8'))

events.request_success += kpi_zabbix_handler
thats one example i am using to send some locust data to a special zabbix backend
you could also write it into a database, or whatever you like.
or do you mean recording by using a browser to learn which requests to make ?
Andreas Nanko
never seen that. locust is testing as code.
I've only seen your messages because I was checking another gitter channel i am on
Did you see that locust is on slack. Probably they moved there.
Andreas Nanko
There are 1229 members ;-)
Anant Kakrania
@heyman Hi!
I have recently started working on Locust and have a use case where I want to test the performance of a simple function. Example:
def get_sqr(n):
return n*n
There is no client requirement or any server. A simple function or set of functions to be tested. Is this possible and if yes, can you please let me know how?
@aidylewis @andreasnanko
hey, does anyone happen to have an example code for TCP connection load testing? I want to send some json-rpc to specific tpc server
Alexandre Verri
Hi guys, I think Locust is great for finding the maximum number of users supported by the system under test. It's very easy to look at the charts and see the deterioration of RPS or response time caused by the increase in the number of users. I have a doubt: How does Locust generate the load per user? Does it send a specific amount of requests per second, or what?
Alexander Zhovnuvaty
i'm beginner in locust, prepared a test script have few questions. please reply. thanks in advance: 1) sometimes statistics in web UI is not updated - it is most of all something with my script or this feature is unstable?; 2) is it possible to extend web UI and add extra input parameter (like number of iterations?); 3) what is the best way to initialize a single array with predefined data and share it between all Users so each user retrieves unique item from the array?
Alex Heal
Hi all, plz help, how i can get current session or user index in task()?
Paul Dragoonis
Hello lovely locust'ers - how are you all publishing the locust results from the CI run. I noticed locust has a CSV export feature, but I'm looking for a HTML based report, so I can see the graphs/data. What is everyone doing?? :)
Anahi Costa
Good afternoon, I am fairly new to locust.
I removed these files -under the assumption they would regenerate :( - success_req_stats.csv+ failure_req_stats.csv
Trying to run a distributed test and I am encountering this message on my --master instance:
/INFO/locust.runners: Discarded report from unrecognized worker [server]
has anyone seen this before?
how could I fix it?