In Ubuntu (and Debian, and other distro) there is a few Apache packages (mpm-event, mpm-prefork, mpm-worker). Which is the most suitable for hosting Django mod_wsgi application on single CPU server? Which package is best choice for OpenVZ container?
In Ubuntu (and Debian, and other distro) there is a few Apache packages (mpm-event, mpm-prefork, mpm-worker). Which is the most suitable for hosting Django mod_wsgi application on single CPU server? Which package is best choice for OpenVZ container?
If you use mod_wsgi daemon mode, it doesn't matter which Apache MPM you use, although suggested that for UNIX systems worker MPM be used unless you are stuck with having to also host PHP applications using mod_php as some PHP extensions aren't thread safe.
The suggestion that you have to have worker MPM in order to use mod_wsgi daemon mode is wrong. What is important is whether the underlying Apache Runtime Library (APR) is built with threading capabilities. This is usually always the case, even if the prefork MPM is being used in Apache. The only systems that don't have threading capabilities built in to APR are older BSD based systems where threading was a bit broken.
The worker MPM would be your best choice. It's compatible with mod_wsgi. The event MPM might give higher performance, but is far less often used, and any performance improvement is minimal -- hence I won't recommend it. The worker MPM handles each request in a separate thread, which makes it much more suitable for use on a VPS than the traditional prefork model, which uses a whole process for each connection.
Worker is required if you use mod-wsgi in daemon mode (which I prefer as there are other sites running on my apache server).
If you use mod-wsgi in embedded mode, either is OK.
It's in the docs: http://code.google.com/p/modwsgi/