locust does not respond when the time to complete a single request is (very) long
See original GitHub issueDescribe the bug
When running locust against a database with queries that needs long processing time (above 3 seconds) locust does not respond anymore:
Expected behavior
Locust should work as usual
Actual behavior
- run as local: stopping the test from the UI does not work. The runner keeps sending request to the database
- run as master/worker the master loose the worker, printing heartbeat not arrived.
Steps to reproduce
I have created a repository. It need docker and Unix tools, python packages: locust
and pyscopg2
.
git clone https://github.com/belloni-SAP/locust_sql
cd locust_sql
- run
./prepare_test.sh
- Al local:
locust -f postgres_test.py
start test from UI and try to stop. In the terminal locust keeps sending request to the database.- distributed
* master:
locust -f postgres_test.py --master
* worker:locust -f postgres_test.py --worker
After few seconds in the master terminal an heartbeat problem will try to stop the test. Increasing the value of theheartbeat
-related variables inlocust.runner
have no effect.
Environment
- OS: Linux - x86_64 GNU/Linux
- Python version: Python 3.7.1
- Locust version: locust 1.2.3
- Locust command line that you ran: see above
- Locust file contents (anonymized if necessary): see above
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Locust : How to make locust run for a specific amount of time
This answer is out of date. Locust now has a -t / --run-time parameter for specifying run time.
Read more >Increase performance with a faster HTTP client
As long as your load generator CPU is not overloaded, FastHttpUser's response times should be almost identical to those of HttpUser. It is...
Read more >Quick Tutorial on Locust
The UI will show real-time statistics on how the server responds to the requests ... Now that you are familiar with what Locust...
Read more >Locust - Read the Docs
Note: Running Locust on Windows should work fine for developing and testing your load testing scripts. However, when running large scale ...
Read more >Performance and Load Testing using Locust - PFLB
There is no better place for a QA solution than PFLB. Drop us a line to find out what our team can do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Many thanks. After using the correct driver, everything works fine. We are, however, using also another driver which is not gevent-friendly.
I was thinking if it could be useful for others to insert in https://docs.locust.io/en/stable/testing-other-systems.html a hint to this possible problematic.
Cool!
For postgres, there are standard environment variables that are automatically used (PGHOST, PGPORT, etc https://www.postgresql.org/docs/current/libpq-envars.html), which is neat (and I use that approach for TimescaleListener in locust-plugins).
As long as you provide the ability to override them in code (using class-level variables on the User maybe?), especially if you want to use TimescaleListener AND your User 😃