[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

python readlines() is slow when run in an apache2 cgi running in a vserver



Hi,

I'm just clueless with one particular behavior of the readlines
function. I've written a sample program that illustrates this "prehaps
bug" I'm encountering.

The box I used for this is an AMD Sempron 2800+ with 256 Mb of RAM :
- When run on this standard etch box as a cgi script in apache2, it
runs in less than a second.
- When run in a vserver guest on this standard etch box from the
commandline, it runs in less than a second.

When run in a vserver guest on this standard etch box as a cgi script
in apache2, it takes 7 seconds to complete! During this time, CPU
usage is 100%.

A friend of mine cannot reproduce on a Gentoo box with a similar
setup. Updating vserver and the kernel to the latest version does not
fix the problem. Using a brand new vserver (using newvserver and
aptitude install apache2, with standard conffiles) does not fix the
issue.

I've narrowed the problem to the readlines() function.

Questions arise from this :
- can I narrow it better than readlines(), perhaps in C/C++ ?
- is this apache2's or vserver's fault although similar perl or php
programs (i.e. that read input) do not have the same problem?
- any ideas, advices on all this?

Thanks in advance,

Alexandre

Attachment: test.cgi
Description: Binary data


Reply to: