Python CGI and Jave Server Pages (JSP)

Sam Penrose sam at ddmweb.com
Wed Aug 15 14:15:10 EDT 2001


Geoffrey Gerriets has made some nice posts on Java-vs-Python for
nontrivial web applications:
<http://groups.google.com/groups?q=group:comp.lang.python+author:geoffrey&num=20&hl=en&safe=off&as_drrb=b&as_mind=29&as_minm=3&as_miny=2001&as_maxd=15&as_maxm=8&as_maxy=2001&filter=0>
For Python pros, see especially:
<http://groups.google.com/groups?q=group:comp.lang.python+author:geoffrey&num=20&hl=en&safe=off&as_drrb=b&as_mind=29&as_minm=3&as_miny=2001&as_maxd=15&as_maxm=8&as_maxy=2001&rnum=13&selm=mailman.991867093.27129.python-list%40python.org&filter=0>
and for Java
<http://groups.google.com/groups?q=group:comp.lang.python+author:geoffrey&num=20&hl=en&safe=off&as_drrb=b&as_mind=29&as_minm=3&as_miny=2001&as_maxd=15&as_maxm=8&as_maxy=2001&rnum=20&selm=mailman.991359661.6922.python-list%40python.org&filter=0>

Summary: with Java you have a huge variety of pre-rolled solutions for
which it is easy to find support, programmers, etc. Java also has
proven solutions for very high load situations. But you are coding
in Java--enough said. Python makes programmers much more productive,
you can teach programmers fast (but you do generally have to teach
them), there aren't any (?) proven very-high-load solutions, there is
much less pre-rolled stuff.

Alex Martelli says:
>>If the connection to the database takes up a substantial fraction of
the CGI's working time, then a true CGI (which runs a new process
on every page-hit) may show bad performance.<<

It seems impossible to have a discussion about CGI without bringing up
performance issues, although almost no one making the comments seems to
have had an actual performance problem (Alex?). My theory is that this
meme started when the average web server was a 486 with 8 megs of RAM
and starting a few processes meant hitting a s-l-o-w swap disk and has
been given eternal life courtesy of Usenet. To my knowledge, there are
two situations in which you need to worry about CGI performance:

1) You are serving on Windows, where starting a process is much more
expensive than on *nix.

2) Your peak load is hundreds of CGI page views a minute per basic
Intel web server or equivalent, or it's lower but you can't afford
$1,000 worth of server.

The only people I have ever heard complain about actual Python CGI
performance limits encountered with production code are those running on
Windows. We run an ecommerce site that serves tens of thousands of
dynamic pages a day on a small cluster of Pentium III boxes (two traffic
managers, two web servers, database server) running RedHat Linux,
plain Apache, and MySQL. it works great. It was working great on a
single PIII server, but we wanted more reliability.




More information about the Python-list mailing list