In production, Apache + mod_wsgi or Nginx + mod_wsgi?

前端 未结 4 914
灰色年华
灰色年华 2020-12-07 11:05

What to use for a medium to large python WSGI application, Apache + mod_wsgi or Nginx + mod_wsgi?

Which combination will need more memory and CPU time?
Whi

4条回答
  •  有刺的猬
    2020-12-07 11:23

    For nginx/mod_wsgi, ensure you read:

    http://blog.dscpl.com.au/2009/05/blocking-requests-and-nginx-version-of.html

    Because of how nginx is an event driven system underneath, it has behavioural characteristics which are detrimental to blocking applications such as is the case with WSGI based applications. Worse case scenario is that with multiprocess nginx configuration, you can see user requests be blocked even though some nginx worker processes may be idle. Apache/mod_wsgi doesn't have this issue as Apache processes will only accept requests when it has the resources to actually handle the request. Apache/mod_wsgi will thus give more predictable and reliable behaviour.

提交回复
热议问题