Multithreading¶
By default, previous versions of DeepStack ran each endpoint on a single thread, this was changed to 5 threads in version 2022.01.1. To take full advantage of multiple cpu cores and threads, DeepStack allows you to specify the number of threads each endpoint will run with. This provides singificant performance boost, especially when running multiple requests often.
Run DeepStack on Multiple Threads¶
Run the command below as it applies to the version you have installed
sudo docker run -e THREADCOUNT=10 -e VISION-SCENE=True -v localstorage:/datastore -p 80:5000 deepquestai/deepstack
sudo docker run --gpus all run -e THREADCOUNT=10 -e VISION-SCENE=True -v localstorage:/datastore -p 80:5000 deepquestai/deepstack:gpu
deepstack --VISION-SCENE True --PORT 80 --THREADCOUNT 10
sudo docker run -e THREADCOUNT=10 --runtime nvidia -e VISION-SCENE=True -p 80:5000 deepquestai/deepstack:jetpack
sudo docker run -e THREADCOUNT=10 -e VISION-SCENE=True -p 80:5000 deepquestai/deepstack:arm64
sudo docker run -e THREADCOUNT=10 -e VISION-SCENE=True -p 80:5000 deepquestai/deepstack:arm64-server
The command -e THREADCOUNT=10 sets the number of threads used by each endpoint to 10