2 ms·
We use the ncpu * 2 + 1 formula for the number of workers that serve API requests. I don't think in 'handling x concurrent requests' terms because I don't even
by pdhborges 4y ago
We use the ncpu * 2 + 1 formula for the number of workers that serve API requests.
I don't think in 'handling x concurrent requests' terms because I don't even know what that means. Usually I think around thoughout, latency distributions and number of connections that can be kept open (for servers that deal with web sockets).
For example if you have the 4 core computer and you have 4 workers and your requests take around 50ms each you can get to a throughput of 80 requests per second. If the fraction of request time for IO if 50% you can bump your thread count to try to reach 160 request per second. Note that in this case each request consumes 25ms of CPU so you would never be able to get more than 40 requests per second per CPU whether you are using node or python.