Does Python scale for heavy web loads?

Tres Seaver tseaver at starbase.neosoft.com
Thu Sep 7 21:49:03 EDT 2000


In article <8p85rh$hmi$1 at nnrp1.deja.com>,  <markhaliday at my-deja.com> wrote:
>Question: Using Python as a CGI and running it under Apache, would
>Python realistically be able to handle 5,000 hits an hour and not
>degrade performance?  With Python's threading, (ex: using a Default.py
>script as an example) I call Default.py to render some information,
>only one thread runs Default.py right?  No other people can hit
>Default.py until Default.py finishes with its original request and
>serving the information back...Correct?

"Plain-ole" CGI is not your best scalability candidate;  the overhead
of starting the Python interpreter for each request is *much* too
high.

What you want is a long-running process (e.g., Zope), to which Apache
delegates the request, or else to get the Python interpreter embedded
somehow in the Apache process ("mod_python", if that beast is available).

WRT your numbers:  I have seen better performance than that on a
400 Mhz Sparc *very* unoptimized Zope application (every page
dynamically generated, with *lots* of DTML, and with Zope serving
uncacheable images), ~1.5 page views/sec/CPU;  moderate tuning pushed
it to 15 PV/s/CPU on that box, or almost 30 on a 650 Mhz Lintel box.

Best,

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org



More information about the Python-list mailing list