Generally we recommend (2 x $num_cores) + 1 as the number of workers to start off with.

https://github.com/benoitc/gunicorn/blob/97a45805f85830d1f80bf769f5787704daa635d3/docs/source/design.rst    -》》》》》not overly scientific  

Gunicorn relies on the operating system to provide all of the load balancing when handling requests. Generally we recommend (2 x $num_cores) + 1 as the number of workers to start off with. While not overly scientific, the formula is based on the assumption that for a given core, one worker will be reading or writing from the socket while the other worker is processing a request.      

Gunicorn should only need 4-12 worker processes to handle hundreds or thousands of requests per second.

猜你喜欢

转载自www.cnblogs.com/yuanjiangw/p/10834364.html
we