app hosting with multiple versions of python

89 views
Skip to first unread message

Gary Wilson Jr.

unread,
Feb 26, 2009, 10:57:21 AM2/26/09
to modwsgi list
I'm working on setting up an internal Django hosting environment at
the university I work for, and we will eventually need to support
multiple versions of Python and Django. From what I've gathered,
mod_wsgi is compiled using a certain version of Python and that is the
only version that can run in that Apache instance. What would be the
best way to go about supporting multiple Python versions with
mod_wsgi?

Do I need to spin up multiple apache instances, each with a mod_wsgi
module complied for a different version of Python?

Would it be possible (perhaps in the future) to compile a single
mod_wsgi module for multiple versions of Python or have the ability
load multiple mod_wsgi modules, one for each Python version, into a
single Apache instance? Then, maybe there could be a configuration
option or parameter to WSGIDaemonProcess to specify which version to
use.

Gary

Graham Dumpleton

unread,
Feb 26, 2009, 7:57:20 PM2/26/09
to mod...@googlegroups.com
2009/2/27 Gary Wilson Jr. <gary....@gmail.com>:

>
> I'm working on setting up an internal Django hosting environment at
> the university I work for, and we will eventually need to support
> multiple versions of Python and Django.  From what I've gathered,
> mod_wsgi is compiled using a certain version of Python and that is the
> only version that can run in that Apache instance.

Correct.

> What would be the
> best way to go about supporting multiple Python versions with
> mod_wsgi?
> Do I need to spin up multiple apache instances, each with a mod_wsgi
> module complied for a different version of Python?

Yes, you would have to have multiple Apache installations.

> Would it be possible (perhaps in the future) to compile a single
> mod_wsgi module for multiple versions of Python or have the ability
> load multiple mod_wsgi modules, one for each Python version, into a
> single Apache instance?  Then, maybe there could be a configuration
> option or parameter to WSGIDaemonProcess to specify which version to
> use.

Some thought has been given to that, but non trivial. First off it
means no longer supporting embedded mode. Secondly, it means having to
have a separate monitor process for each Python version, rather than
having Apache parent process do it. That presumes of course that same
fork model is used. The alternative is to use fork/exec model and
defer loading Python until exec, but then you would just have FASTCGI.

So, if running multiple Apache installations is an issue, it may be
easier for you to use FASTCGI solutions instead.

Graham

Reply all
Reply to author
Forward
0 new messages