3 ms·
All three work if your goal is simply to avoid forking a new Python interpreter for each incoming request, ala CGI. The difference is in where they hook into t
by rcoder 18y ago
All three work if your goal is simply to avoid forking a new Python interpreter for each incoming request, ala CGI.
The difference is in where they hook into the request-handling workflow within Apache. Both FastCGI and WSGI apps only receive the request after Apache (or lighttpd, nginx, et. al.) have finished doing access control checks, URL rewriting, header parsing, etc.
Code inside the mod_python interpreter, on the other hand, can hook in to any of those earlier stages of request processing, which allows it to do things like block a request, alter the Apache log format, or look up a vhost docroot in a database, all before any content is generated.
The downside is that each and every Apache process on your server has a full copy of the Python interpreter embedded inside, which can cost you a pretty serious chunk of RAM when you start dealing with servers running 25-50 (or more) httpd processes.