Mod_Python vs mod_wsgi

57 views
Skip to first unread message

ray

unread,
Jul 26, 2009, 10:37:45 PM7/26/09
to Trac Users
After looking into the most current version of mod_python, I found
that there is little to no support for it - development seems to have
stopped about 1 1/2 years ago.

The last active developer has suggested that users move to mod_wsgi.
Reference:
http://code.google.com/p/modwsgi/

The message can be found at:
http://modpython.org/pipermail/mod_python/2009-July/026279.html

I would appreciate comments.

Ray

Graham Dumpleton

unread,
Jul 26, 2009, 10:45:54 PM7/26/09
to Trac Users
Development on mod_python effectively stopped 2 1/2 years ago, not 1
1/2.. Quoting time of last release from mod_python site:

Feb-14-2007 3.3.1 is out and available on the download page.

There may have been a few commits in repository since then, but only
because I got sick of answering questions as to why last release
wouldn't build on latest APR versions and MacOS X. I wouldn't construe
those commits as being an indication of active development. :-)

Graham

Greg Troxel

unread,
Jul 27, 2009, 7:39:36 AM7/27/09
to trac-...@googlegroups.com

I would appreciate comments.

I am running trac on about 5 boxes, NetBSD 4 or 5, i386 or amd64, apache
2.2.x. Most are running mod_wsgi and perhaps one or two mod_python. My
plan is to make them all run mod_wsgi. I suspect that mod_python leaks
memory into apache, even the master process, but I can't quite prove
that. mod_wsgi is slightly tricky to set up in that you need to install
a small script but once you get it working it is entirely reliable, so
this is in my view not a worry.

So I recommend that you use mod_wsgi.
Graham presumably would have said that too, but I'm disinterested :-)

Graham Dumpleton

unread,
Jul 27, 2009, 9:00:30 PM7/27/09
to Trac Users


On Jul 27, 9:39 pm, Greg Troxel <g...@ir.bbn.com> wrote:
> After looking into the most current version of mod_python, I found
>   that there is little to no support for it - development seems to have
>   stopped about 1 1/2 years ago.
>
>   The last active developer has suggested that users move to mod_wsgi.
>   Reference:
>  http://code.google.com/p/modwsgi/
>
>   The message can be found at:
>  http://modpython.org/pipermail/mod_python/2009-July/026279.html
>
>   I would appreciate comments.
>
> I am running trac on about 5 boxes, NetBSD 4 or 5, i386 or amd64, apache
> 2.2.x.  Most are running mod_wsgi and perhaps one or two mod_python.  My
> plan is to make them all run mod_wsgi.  I suspect that mod_python leaks
> memory into apache, even the master process, but I can't quite prove
> that.

Yes, mod_python has a problem in it whereby it doesn't destroy the
interpreter properly in Apache parent process resulting in all the
memory in use by the interpreter being leaked. See:

https://issues.apache.org/jira/browse/MODPYTHON-235

In mod_wsgi, it does destroy the interpreter properly and so doesn't
suffer the same problem.

That said, the Python interpreter itself, even when destroyed, does
leak a small amount of memory depending on which version of Python you
are using.

End result is that for mod_wsgi, you still may see Apache parent
process grow in memory usage if you do a lot of restarts or graceful
restart, rather than complete stop/start.

> mod_wsgi is slightly tricky to set up in that you need to install
> a small script but once you get it working it is entirely reliable, so
> this is in my view not a worry.

Although some like that mod_python can just refer to a installed
Python module, that it does this is a PITA. This is because it is
completely contrary to the Apache resource model and as a result the
SCRIPT_NAME value which identifies where an application is mounted is
usually never correct for mod_python. As a result, applications when
using mod_python usually have to provide a way of fudging things by
telling the application manually where it is mounted.

> So I recommend that you use mod_wsgi.
> Graham presumably would have said that too, but I'm disinterested :-)

As much as I would like to see mod_python vanish, I am not that
blatant about telling people that mod_python is a stinking pile of cow
turd and that mod_wsgi is much sweeter smelling. :-)

Graham

Jeroen Ruigrok van der Werven

unread,
Jul 28, 2009, 6:35:23 AM7/28/09
to trac-...@googlegroups.com
-On [20090728 03:00], Graham Dumpleton (graham.d...@gmail.com) wrote:
>That said, the Python interpreter itself, even when destroyed, does
>leak a small amount of memory depending on which version of Python you
>are using.

I assume you logged something about this on bugs.python.org, Graham?

--
Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
イェルーン ラウフロック ヴァン デル ウェルヴェン
http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
I dream of gardens in the desert sand...

Graham Dumpleton

unread,
Jul 28, 2009, 6:38:42 AM7/28/09
to Trac Users


On Jul 28, 8:35 pm, Jeroen Ruigrok van der Werven <asmo...@in-
nomine.org> wrote:
> -On [20090728 03:00], Graham Dumpleton (graham.dumple...@gmail.com) wrote:
>
> >That said, the Python interpreter itself, even when destroyed, does
> >leak a small amount of memory depending on which version of Python you
> >are using.
>
> I assume you logged something about this on bugs.python.org, Graham?

No. Apparently it is a design decision in later versions that they
leave some stuff to leak. For whatever reason it is just too hard to
clean up everything.

Graham
Reply all
Reply to author
Forward
0 new messages