Skip to content

Commit

Permalink
Reduce num REST API workers to accommodate smaller machines (#2400)
Browse files Browse the repository at this point in the history
* Reduce num REST API workers from 8 to 2

* Incorporate reviewer feedback
  • Loading branch information
brandenchan authored Apr 11, 2022
1 parent b94d9ef commit 4ef099d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ services:
- CONCURRENT_REQUEST_PER_WORKER
depends_on:
- elasticsearch
command: "/bin/bash -c 'sleep 10 && gunicorn rest_api.application:app -b 0.0.0.0 -k uvicorn.workers.UvicornWorker --workers 8 --timeout 180'"
# Starts REST API with only 2 workers so that it can be run on systems with just 4GB of memory
# If you need to handle large loads of incoming requests and have memory to spare, consider increasing the number of workers
command: "/bin/bash -c 'sleep 10 && gunicorn rest_api.application:app -b 0.0.0.0 -k uvicorn.workers.UvicornWorker --workers 2 --timeout 180'"
elasticsearch:
# This will start an empty elasticsearch instance (so you have to add your documents yourself)
#image: "elasticsearch:7.9.2"
Expand Down

0 comments on commit 4ef099d

Please sign in to comment.