<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: modpython</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/modpython.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2009-03-16T17:26:59+00:00</updated><author><name>Simon Willison</name></author><entry><title>Load spikes and excessive memory usage in mod_python</title><link href="https://simonwillison.net/2009/Mar/16/graham/#atom-tag" rel="alternate"/><published>2009-03-16T17:26:59+00:00</published><updated>2009-03-16T17:26:59+00:00</updated><id>https://simonwillison.net/2009/Mar/16/graham/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html"&gt;Load spikes and excessive memory usage in mod_python&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
“The final answer? Stop using mod_python, use mod_wsgi and run it with daemon mode instead. You will save yourself a lot of headaches by doing so.”


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/graham-dumpleton"&gt;graham-dumpleton&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modpython"&gt;modpython&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modwsgi"&gt;modwsgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/wsgi"&gt;wsgi&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="graham-dumpleton"/><category term="modpython"/><category term="modwsgi"/><category term="python"/><category term="wsgi"/></entry><entry><title>mod_wsgi 1.0 Release Candiate Available</title><link href="https://simonwillison.net/2007/Jul/26/hex/#atom-tag" rel="alternate"/><published>2007-07-26T20:21:11+00:00</published><updated>2007-07-26T20:21:11+00:00</updated><id>https://simonwillison.net/2007/Jul/26/hex/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://hex-dump.blogspot.com/2007/07/modwsgi-10-release-candiate-available.html"&gt;mod_wsgi 1.0 Release Candiate Available&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
mod_wsgi is shaping up to be an excellent alternative to mod_python.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modpython"&gt;modpython&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modwsgi"&gt;modwsgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/wsgi"&gt;wsgi&lt;/a&gt;&lt;/p&gt;



</summary><category term="django"/><category term="modpython"/><category term="modwsgi"/><category term="python"/><category term="wsgi"/></entry><entry><title>mod_python: Expat Causing Apache Crash</title><link href="https://simonwillison.net/2007/Mar/27/modpython/#atom-tag" rel="alternate"/><published>2007-03-27T11:49:14+00:00</published><updated>2007-03-27T11:49:14+00:00</updated><id>https://simonwillison.net/2007/Mar/27/modpython/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash"&gt;mod_python: Expat Causing Apache Crash&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
We ran in to this problem today.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/expat"&gt;expat&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modpython"&gt;modpython&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="django"/><category term="expat"/><category term="modpython"/></entry><entry><title>Quick Django Benching</title><link href="https://simonwillison.net/2007/Feb/17/quick/#atom-tag" rel="alternate"/><published>2007-02-17T16:56:28+00:00</published><updated>2007-02-17T16:56:28+00:00</updated><id>https://simonwillison.net/2007/Feb/17/quick/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://superjared.com/entry/quick-django-benching/"&gt;Quick Django Benching&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Django under Apache/mod_python outperforms nginx/FastCGI and LightTPD/FastCGI once you ramp up the concurrency levels. My setup for this site (Apache/mod_python behind an nginx proxy, with nginx handling static files) should give the best of both worlds.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/deployment"&gt;deployment&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/fastcgi"&gt;fastcgi&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/lighttpd"&gt;lighttpd&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modpython"&gt;modpython&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/nginx"&gt;nginx&lt;/a&gt;&lt;/p&gt;



</summary><category term="apache"/><category term="deployment"/><category term="django"/><category term="fastcgi"/><category term="lighttpd"/><category term="modpython"/><category term="nginx"/></entry><entry><title>mod_python introduction</title><link href="https://simonwillison.net/2003/Oct/3/modPythonIntro/#atom-tag" rel="alternate"/><published>2003-10-03T10:22:15+00:00</published><updated>2003-10-03T10:22:15+00:00</updated><id>https://simonwillison.net/2003/Oct/3/modPythonIntro/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;a href="http://www.onlamp.com/pub/a/python/2003/10/02/mod_python.html"&gt;Introducing mod_python&lt;/a&gt; by Gregory Trubetskoy. One of my biggest problems with mod_python is that documentation outside of the &lt;a href="http://www.modpython.org/live/current/doc-html"&gt;mod_python manual&lt;/a&gt; is pretty hard to come by. This article is more of an executive overview than a tutorial, but anything that adds to the overall body of knowledge out there concerning mod_python has to be a good thing. I'm hoping to write some material on mod_python best practises at some point in the near future, but I have to work out what they are first. Luckily the project has an active and very helpful &lt;a href="http://mailman.modpython.org/mailman/listinfo/mod_python" title="mod_python user mailing list"&gt;mailing list&lt;/a&gt;.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/modpython"&gt;modpython&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="modpython"/><category term="python"/></entry><entry><title>On mod_python</title><link href="https://simonwillison.net/2003/Aug/29/modPython/#atom-tag" rel="alternate"/><published>2003-08-29T04:31:38+00:00</published><updated>2003-08-29T04:31:38+00:00</updated><id>https://simonwillison.net/2003/Aug/29/modPython/#atom-tag</id><summary type="html">
    &lt;p&gt;So, I'm getting stuck in to &lt;a href="http://www.modpython.org/"&gt;mod_python&lt;/a&gt; in a pretty big way at the moment. I've never even used mod_perl before, so coming from &lt;acronym title="PHP: Hypertext Preprocessor"&gt;PHP&lt;/acronym&gt; this is turning out to be a real eye opener.&lt;/p&gt;

&lt;p&gt;The key thing to realise about mod_python is that it gives you full control over the whole Apache request. Unlike &lt;acronym title="PHP: Hypertext Preprocessor"&gt;PHP&lt;/acronym&gt;, you're not writing scripts that just happen to use Apache as a go between - mod_python exposes a pretty big chunk of Apache's internal &lt;acronym title="Application Programming Interface"&gt;API&lt;/acronym&gt;, and you are expected to hook straight in to it and start doing things. This certainly takes a while to get used to, but comes with some pretty big benefits. For one thing, your code is loaded once (well, once by each Apache process) and stays in memory. This means that global variables within your scripts persist between requests! Unfortunately, each Apache process (of which there are usually quite a few) has its own copy of the code so you can't use this persistence ability for things like sessions, but it's great for pooling database connections and keeping unchanging data such as templates in memory.&lt;/p&gt;

&lt;p&gt;You can write your own handlers for the various parts of the Apache request. So far I've only been playing with the handler that serves up content, but it's possible to do things like create a handler for the "Authentication" phase that authenticates users in some special way.&lt;/p&gt;

&lt;p&gt;My biggest worry at the moment concerns the relative lack of documentation for mod_python on the web - the manual is pretty good, but other than that there's precious little to get your teeth in to. Luckily the module has a reasonably high traffic mailing list which has so far answered all of the questions I've thrown at it promptly and in great detail. I hope to write more about mod_python as I become more comfortable with it. If anyone has any tips, I'd love to hear them.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/apache"&gt;apache&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modpython"&gt;modpython&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="apache"/><category term="modpython"/><category term="python"/></entry><entry><title>mod_python donated to the ASF</title><link href="https://simonwillison.net/2002/Sep/13/modPythonDonated/#atom-tag" rel="alternate"/><published>2002-09-13T17:53:20+00:00</published><updated>2002-09-13T17:53:20+00:00</updated><id>https://simonwillison.net/2002/Sep/13/modPythonDonated/#atom-tag</id><summary type="html">
    &lt;p&gt;&lt;a href="http://www.modpython.org/"&gt;mod_python&lt;/a&gt; has been &lt;a href="http://www.modpython.org/donation.txt"&gt;donated&lt;/a&gt; to the Apache Software Foundation. This is excellent news - I have always been slightly wary of mod_python as it has a reputation for being unstable, but with the ASF directly supporting it hopefully any stability problems will soon be a thing of the past.&lt;/p&gt;
    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/asf"&gt;asf&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/modpython"&gt;modpython&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="asf"/><category term="modpython"/><category term="python"/></entry></feed>