httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BAO RuiXian <>
Subject Re: [users@httpd] Apache 2.0.49 flushing CGI script causes huge memory consumption
Date Sun, 30 May 2004 13:41:33 GMT

David Greenaway wrote:

>The following CGI script causes the Apache worker process to consume
>huge amounts of memory (in my case, 'top' shows 526MB of virtual memory
>allocated to the process), causing the system to grind to a crawl.
I tested your following script both with and without the flush. It seems 
no problem. The excution time is about couple of sencods. My environment 
is Win 2K pro, 125 MB memorey, Apache 2.0.47. What is the memory of your 
computer? How long does it take? "Causing the system to grind to a 
crawl' is not a much descriptive.



>--- script start ---
>print "Content-Type: text/plain\n\n";
>$| = 1; # flush output
>for (my $i = 0; $i < 100000; $i++) {
>        print "moo\n";
>--- script end ---
>By turning off output flushing, the problem seems to go away.
>Obviously, having the output constantly flushing is not the most
>efficient way to write CGI script, but it surprises me that it would
>have such devastating effects. Is this a bug, or am I just missing
>something? Can anybody else reproduce this?
>I am running Linux 2.6.4, Apache/2.0.49 (official Debian/Testing
>package, version 2.0.49-1). The script is being run with 'cgi-script',
>and *not* mod_perl.
>-David Greenaway

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message