python - About the optimal number of gunicorn workers -


about gunicorn: expecting optimal number of workers $num_cores or $num_cores-1, i.e., each worker has own core. gunicorn documentation gives following guidelines:

gunicorn relies on operating system provide of load balancing when handling requests. recommend (2 x $num_cores) + 1 number of workers start off with. while not overly scientific, formula based on assumption given core, 1 worker reading or writing socket while other worker processing request.

i don't understand explanation. suggest same core can used simultaneously 1) reading or writing socket , 2) processing request? (can single core such thing?)

the answer based on processes waiting on things.

for example core doing nothing when make call sql server. having worker per core mean kernel scheduler can use time other process.

you more rps way.

if know time goes per request in details , load patterns able further change suit needs.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -