immich icon indicating copy to clipboard operation
immich copied to clipboard

chore(ml): added locustfile

Open mertalev opened this issue 2 years ago • 4 comments

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

  1. cd machine_learning
  2. poetry install (install poetry first if not already installed)
  3. chmod +x load_test.sh
  4. ./load_test.sh
  5. Open localhost:8089 to see the web UI
  6. Click Start swarming

mertalev avatar Jun 23 '23 21:06 mertalev

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

vercel[bot] avatar Jun 23 '23 21:06 vercel[bot]

If you are running the development stack in Docker, can we still use the method in the description?

alextran1502 avatar Jun 25 '23 03:06 alextran1502

~~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.~~

mertalev avatar Jun 25 '23 04:06 mertalev

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.

mertalev avatar Jun 25 '23 04:06 mertalev