Does Python scale for heavy web loads?

Sam Penrose see at message.body
Thu Sep 7 11:24:49 EDT 2000


In article <87r96wcml9.fsf at eugene.prosa.it>, davidw at linuxcare.com 
(David N. Welton) wrote:

> markhaliday at my-deja.com writes:
> 
> > 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?
> 
> You might want to investigate some of the options for integrating
> Python with Apache, such as mod_python, PyApache (?), and mod_snake.
> Maybe someone else can furnish the URL's.

2) PyApache 4.whatever has a memory leak and appears to have been 
abandoned; shun it unless you determine otherwise.

1) We build ecommerce sites with Python CGIs. Our busiest site handles 
about 50,000 dynamic hits a day, which probably means 5,000-8,000 during 
the busiest hour. It does fine running on a 500 MHz Pentium III with a 
relatively unoptimized Apache/Redhat 6.1 installation and a ton of RAM. 
How well your site hold up is going to depend on the details of your 
CGIs and possibly your server setup. 5,000 hits an hour is certainly 
enough to bog down a system that uses Python if the system is doing 
certain kinds of work, or if you do something silly such as building all 
your pages with a big for loop that concantenates strings, or if you are 
trying to do it with 32 megs of RAM and swap memory on an ATA hard 
drive. If you give Linux/Apache 256-512 megs of RAM to play with on 
modern hardware (fast Intel/AMD hardware or better, SCSI hard 
drive--figure $2,000+ worth of server) and code your CGIs with a minimum 
of cluefulness, and aren't trying to calculate the gross national 
product on every hit, you should be fine.

-- 
spenrose at well dot com



More information about the Python-list mailing list