immich
immich copied to clipboard
chore(ml): added locustfile
Description
This PR adds support for Locust, a performance measurement tool. The benefit of this is being able to easily quantify and visualize ML performance. In turn, this makes it easier to understand the performance implications of a change, identify bottlenecks, and find the most appropriate defaults. Besides locustfile.py itself, it also adds a small Bash script to deploy the app locally, start Locust, and terminate the app once done.
Testing
This PR has been tested to work with the provided poetry.lock dependencies
cd machine_learning- poetry install (install poetry first if not already installed)
- chmod +x load_test.sh
- ./load_test.sh
- Open
localhost:8089to see the web UI - Click
Start swarming
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| immich | ⬜️ Ignored (Inspect) | Jun 23, 2023 9:40pm |
If you are running the development stack in Docker, can we still use the method in the description?
~~For the dev docker compose, there are a few tweaks needed:~~
~~1. locustfile.py is outside the app folder, so testing inside the container would require the mapping to be changed from ../machine-learning/app:/usr/src/app to ../machine-learning:/usr/src.~~
~~2. load_test.sh assumes there's no running deployment, but since there is you can just call locust directly.~~
~~3. To display the web UI, you'll need to expose port 8089 unless --headless is passed (in which case it just does terminal output).~~
~~I'll update it with those changes.~~
Scratch that, there's no need. If you run the dev stack then you can just run locust locally in the machine_learning folder without any args. You'd just need to do pip install locust first.