在守护进程模式下调整 mod_wsgi
我正在 apache mod_wsgi 上以守护进程模式运行 wsgi 应用程序。 我的配置中有这些行
WSGIDaemonProcess app processes=2 threads=3 display-name=%{GROUP}
WSGIProcessGroup app
如何找到进程和线程的最佳组合/调整?
编辑: 这个链接[在下面的答案中给出]非常有用: https://serverfault.com/ questions/145617/apache-2-2-mpm-worker-more-threads-or-more-processes/146382#146382
现在,我的问题是:如果我的服务器为我的需求提供了相当好的性能,应该我减少线程数以提高稳定性/可靠性?我可以将其设置为 1 吗?
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 combination/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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还可能获得有关 ServerFault 的更多信息。例如: https://serverfault.com/questions /145617/apache-2-2-mpm-worker-more-threads-or-more-processes
这是该主题的另一个很好的资源:http://code.google.com/p/modwsgi/wiki/ProcessesAndThreading#The_mod_wsgi_Daemon_Processes
其中简要描述了选项 - 包括设置线程 = 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.
您最好的选择是尝试不同的基准。您可以使用 apache benchmark 命令来粗略估计您的性能配置正在做。许多调整将取决于您的 Web 应用程序的 CPU/IO 绑定方式。性能还取决于您托管的服务器的规格等。
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.