Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/j-sephb-lt-n/api-load-testing
Illustrates how to use locust for load-testing, using some toy Flask endpoints
https://github.com/j-sephb-lt-n/api-load-testing
api backend flask gunicorn load-testing locust
Last synced: about 22 hours ago
JSON representation
Illustrates how to use locust for load-testing, using some toy Flask endpoints
- Host: GitHub
- URL: https://github.com/j-sephb-lt-n/api-load-testing
- Owner: J-sephB-lt-n
- License: gpl-3.0
- Created: 2023-11-07T14:01:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-09T20:11:12.000Z (12 months ago)
- Last Synced: 2024-04-17T22:57:31.069Z (7 months ago)
- Topics: api, backend, flask, gunicorn, load-testing, locust
- Language: Python
- Homepage:
- Size: 859 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# API Loading-Testing (Python+Locust+Gunicorn+Flask)
This repo illustrates how to use [locust](https://github.com/locustio/locust) for load-testing, using some toy Flask endpoints.
![](./media/locust_screenshot.png)
```bash
# start local gunicorn server in background
gunicorn \
--bind :5000 \
--workers 1 \
--threads 8 \
--timeout 10 \
--access-logfile "-" \
--log-level info \
flask_app:app &# run load-test in locust #
locust --host http://localhost:5000
# (then navigate to specified url in your browser)# stop gunicorn server #
GUNICORN_PID=$(pgrep -f "gunicorn .* flask_app:app")
kill -SIGTERM $GUNICORN_PID
```