best way to serve wsgi with multiple processes

M.-A. Lemburg mal at egenix.com
Wed Feb 11 16:48:31 CET 2009


On 2009-02-11 16:16, Diez B. Roggisch wrote:
> Robin wrote:
> 
>> On Feb 11, 1:28 pm, Robin <robi... at gmail.com> wrote:
>>> On Feb 11, 12:10 pm, Robin Becker <ro... at reportlab.com> wrote:
>>>
>>>> We've used forked fastcgi (flup) with success as that decouples the
>>>> wsgi process (in our case django) from the main server (in our case
>>>> apache). Our reasons for doing that were to allow the backend to use
>>>> modern pythons without having to upgrade the server (which is required
>>>> if using say mod_python). The wsgi process runs as an ordinary user
>>>> which eases some tasks.
>> I'm sorry - I originally missed the worked 'forked' and hence the
>> whole point of your message I think.
>>
>> I looked at flup before but had forgotten about the forked version.
>> Having revisited it I think the forked version does keep a process
>> pool so each request is processed by a seperate process, which is
>> exactly what I wanted.
> 
> You can have that with mod_wsgi & daemon mode as well, with presumably less
> setup hassle.

Another option that works well on Unix and even Windows is SCGI
which deals with the forking and piping of data for you:

    http://www.mems-exchange.org/software/scgi/
    http://python.ca/scgi/

Lighttpd even ships with a mod_scgi module built-in.

More on the protocol used by SCGI (basically net-strings):

    http://python.ca/scgi/protocol.txt

Unlike FastCGI, it's very easy to setup.

Since SCGI provides standard CGI on the Python side, it's easy to
wrap this up as WSGI interface (using e.g. the code from PEP 333).

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Feb 11 2009)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/



More information about the Python-list mailing list