[mod_python] Difference between run the web service standalone and via mod_python

Jim Gallacher jpg at jgassociates.ca
Wed Jul 19 08:24:43 EDT 2006


wang yingqi wrote:
> First of all,Thank you very much!:)
> Additionally,Someone tell me we can share session via Apache service
> between
> different web apps,

Probably not. If the web app has a standalone server that can be run
without mod_python it will only be using the the mod_python version to
get access to a python interpreter embedded in apache. Thus it will not
likely be using the mod_python session code and providing it's own
session code instead.

Also, session data used by different apps is likely to be different and
incompatible as well.

> and the four points you mentioned are the best
> argumatation for choose Apache + Mod_python instead of standalone mode.
> So,Maybe the development process is a loop like this,Coding and Debuging at
> standalone mode ,Publishing on Apache with mod_python.

That seems reasonable.

Jim

> 
> On 7/18/06, Jim Gallacher <jpg at jgassociates.ca> wrote:
>>
>> wang yingqi wrote:
>> > hi everyone!
>> > some excellent python web framework has its own web-service
>> instance,Just
>> > like Quixote & Djanso, that means we can run our web service without
>> Apache
>> > etc.
>> > so could anybody tell me what's the difference between these
>> modes:1,run
>> > the
>> > service standalone of the python web framework 2,attach the python web
>> app
>> > to Apache via mod_python..
>> > thank u!
>>
>> Consider the following points:
>>
>> 1. Performance
>>
>> The standalone servers will serve all content, including static content.
>> Since they are likely written in pure python, their performance for
>> static content likely be slower.
>>
>> Whether this is an important factor will depend on the mix of static vs
>> dynamic content. If the ratio of static/dynamic is high, using apache +
>> mod_python will likely be better.
>>
>> 2. Server management
>>
>> If the host is not running apache, it will be easier to use the
>> standalone server.
>>
>> If the host is already running apache, it may be simpler to use
>> mod_python rather than managing a separate application server.
>>
>> If the user wants multiple instances of the application, they will need
>> to run and manage additional standalone servers, as opposed to apache
>> where it will just be an extra configuration stanza.
>>
>> There is also the issue of contention for port 80. What if you need
>> different standalone application servers such as Trac for issue tracking
>> and Quixote for some other web service. Only one of them will be able to
>> use port 80, while the other will need to use a non-standard port. This
>> could be a PITA, and indeed some corporate users may not be able to
>> access the second application due to firewall restrictions.
>>
>> 3. Virtual hosts
>>
>> The standalone server may not support virtual hosts. To me this would be
>> a show stopper.
>>
>> 4. Apache goodness
>>
>> There are a wealth of apache modules which may be useful, with no
>> equivalent in the standalone server.
>>
>> Apache is robust. Some applications (such as Zope) recommend that the
>> Zope server be used behind apache as an extra bit of insurance against
>> the malicious requests. (Or at least this used to be the recommendation.
>> I don't follow Zope development anymore and this may have changed).
>>
>> These comments may seem biased towards Apache, but then consider the
>> source - mod_python is an Apache module after all. ;)
>>
>> Jim
>>
> 



More information about the Mod_python mailing list