[Eckard -- please wrap your lines to 80 columns!]
On 26 July 2002, Eckhard Licher said:
> after having explored several Python appservers, frameworks and the
> like (which all have their specific pros and cons) I finally found
> quixote (by accident) and I have to admit that I very much liked the
> concept instantly. Having not (yet) gone much beyond the demo examples
> I already experienced severe performance problems.
>
> My workstation setup is as follows:
> - Linux 2.2.18 (SuSE 7.2) running on a 700MHz Duron machine (640MB RAM)
> - Apache 1.3.x
> - Python 2.0 (gcc 2.95.x) w/ the compiler installed from the Python source
distribution
>
> A typical request to a quixote-generated page via the demo.cgi driver
> takes (depending on the page requested) between 2,4 and 3,5 seconds
> (!) on an otherwise idle machine. For comparison: the legendary
> WelloWorld.py CGI program takes some 60 ms to process and a more
> realistic Python CGI program including access to a SQL database
> (including establishment of a new connection) takes some 240 ms
> (MySQL) and 350 ms (PgSQL) on this machine.
Yes, something is definitely wrong with your setup. My setup is roughly
similar -- 800 MHz Athlon, 256 MB RAM, Linux 2.4.19-rc2, Apache 1.3.23,
Python 2.2. The newer kernel and Python might make a small performance
difference, but new Python releases are usually slower while Linux gets
faster, so it's probably a wash. ;-)
My timings, using ApacheBench with no concurrency (ie. one request at a
time -- "ab -c 1"):
demo.cgi 242 ms min, 261 ms mean, 642 ms max (100 requests)
demo.fcgi 6 ms min, 6 ms mean, 24 ms max (500 requests)
If I remove all *.pyc and *.ptlc files, and make the directories where
they live unwriteable, CGI performance takes a nosedive:
demo.cgi 1141 ms min, 1240 ms mean, 2203 ms max (100 requests)
So inability to write bytecode files really makes a difference.
> There must be something terribly wrong with my setup. BTW, after
> running the demo I did not find any byte-compiled ptlc files in demo
> directory even after permitting the webserver to have write access to
> the relevant directory and manually byte-compiling the ptl files in
> the demo dir did not enhance the performance a bit.
The demo exercises pretty much all of Quixote, so the web server will
need write access to quixote, quixote/demo, and quixote/form .
Did you manually byte-compile the Quixote .py files as well? Just
compiling the .ptl files will help a bit, but there's more to it than
that.
Greg