Why should I use WSGI?

后端 未结 6 1550
小蘑菇
小蘑菇 2021-02-05 07:34

Been using mod_python for a while, I read more and more articles about how good WSGI is, without really understanding why.

So why should I switch to it? What are the ben

6条回答
  •  臣服心动
    2021-02-05 08:00

    mod_wsgi vs. mod_python:

    • mod_wsgi is a little faster (internally there's more C, less Python)
    • mod_wsgi processes can be isolated from Apache, which improves security/stability with lower memory use[1]
    • mod_python gives you access to some of Apache's internals

    WSGI in general:

    • lots of reusable middleware (authentication/authorisation, session stuff, caching, filtering)
    • ease of deployment on non-Apache webservers either via native WSGI support or flup

    [1] - compared to a preforking Apache, which maintains a separate Python interpreter in each process

提交回复
热议问题