开发者

Tuning mod_wsgi in daemon mode

开发者 https://www.devze.com 2023-01-24 14:17 出处:网络
I\'m running wsgi application on apache mod_wsgi in daemon mode. I have these lines in the configuration

I'm running wsgi application on apache mod_wsgi in daemon mode. I have these lines in the configuration

WSGIDaemonProcess app processes=2 threads=3 display-name=%{GROUP} 
WSGIProcessGroup app

How do I find the optimal combinat开发者_Python百科ion/tuning of processes and threads?

EDIT: This link [given in answer bellow] was quite usefull: https://serverfault.com/questions/145617/apache-2-2-mpm-worker-more-threads-or-more-processes/146382#146382

Now, my question is this: If my server gives quite good performance for my needs, should I reduce the number of threads to increase stability / reliability? Can I even set it to 1?


You might get more information on ServerFault as well. For example: https://serverfault.com/questions/145617/apache-2-2-mpm-worker-more-threads-or-more-processes

This is another good resource for the topic: http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading#The_mod_wsgi_Daemon_Processes which briefly describes the options -- including setting threads = 1.

I haven't done this yet but it sounds like it doesn't much matter. Supporting multiple threads as well as multiple processors are both well supported. But for my experience level (and probably yours) its worthwhile to eliminate threading as an extra source of concern -- even if it is theoretically rock solid.


Your best bet is to probably try different bench marks. You can use the apache benchmark command to get a rough estimate at how your configuration is doing. A lot of the tweaking is going to depend on how CPU / IO bound your web app is. The performance is also going to depend on the specs of the server you are hosting on etc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号