[mod_python] One Interpreter for All Requests?

Deron Meranda deron.meranda at gmail.com
Fri Feb 17 14:48:11 EST 2006


On 2/17/06, Alexis Marrero <amarrero at mitre.org> wrote:
> As I'm testing my application doing multiple requests that are CPU
> and IO intensive I'm noticing that only one request is handled at a
> time.
>...
> Is there a way of forcing that each request executes in a new
> interpreter?

I think you are misunderstanding what an "interpreter" is.  What
you are really looking for, I think, is to adjust your Apache MPM
configuration.  See
  http://httpd.apache.org/docs/2.0/mpm.html

Apache is what drives the request processing, and it is what
assigns the requests to a particular process/thread.  So any sort
of concurrency of requests is up to Apache.  And all this happens
outside of mod_python.

The PythonInterpreter is really just a way to create different
"sandboxed" python run-time VM environments.  However those
interpreters still "run" within some thread or process.  Having
more or fewer interpreters (VM's) won't change the concurrency
of request processing.  It only helps to isolate your python handlers
from each other (it's not perfect 100% isolation though).

So, no, there's no way to have a pool of python interpreters which
get randomly assigned to handle requests; but, I don't think
that would be a very useful thing anyway.
--
Deron Meranda



More information about the Mod_python mailing list