Python does not play well with others
John Nagle
nagle at animats.com
Mon Feb 5 12:52:01 EST 2007
sjdevnull at yahoo.com wrote:
> John Nagle wrote:
>
>>Graham Dumpleton wrote:
>>
>>>On Feb 4, 1:05 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
>>>
>>>
>>>>"Paul Boddie" <p... at boddie.org.uk> writes:
>> Realistically, mod_python is a dead end for large servers,
>>because Python isn't really multi-threaded. The Global Python
>>Lock means that a multi-core CPU won't help performance.
>
>
> The GIL doesn't affect seperate processes, and any large server that
> cares about stability is going to be running a pre-forking MPM no
> matter what language they're supporting.
Pre-forking doesn't reduce load; it just improves responsiveness.
You still pay for loading all the modules on every request. For
many AJAX apps, the loading cost tends to dominate the transaction.
FastCGI, though, reuses the loaded Python (or whatever) image.
The code has to be written to be able to process transactions
in sequence (i.e. don't rely on variables intitialized at load),
but each process lives for more than one transaction cycle.
However, each process has a copy of the whole Python system,
although maybe some code gets shared.
John Nagle
More information about the Python-list
mailing list