DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=29318>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=29318 Apache 2.0.49 / mod_deflate and flushing CGI script causes huge memory consumption Summary: Apache 2.0.49 / mod_deflate and flushing CGI script causes huge memory consumption Product: Apache httpd-2.0 Version: 2.0.49 Platform: PC OS/Version: Linux Status: NEW Severity: Normal Priority: Other Component: mod_deflate AssignedTo: [email protected] ReportedBy: [EMAIL PROTECTED] The following Perl CGI script causes the Apache worker process to consume huge amounts of memory (up to 650M for a page about 100k in size.) if the 'SetOutputFilter DEFLATE' is used. --- script start --- #!/usr/bin/perl print "Content-Type: text/plain\n\n"; $| = 1; # flush output for (my $i = 0; $i < 100000; $i++) { print "moo\n"; } --- script end --- By commenting out the line 'flush output' and trying again, the page is served without any problems. Removing 'SetOutputFilter DEFLATE' also allows the page to be served without any trouble. Changing the values of 'DeflateMemLevel', 'DeflateCompressionLevel' and 'DeflateBufferSize' do not affect the behaviour. However, if 'DeflateWindowSize' is <= 7, the problem goes away. At the value 8, the problem appears randomly (approximately one in two requests.) As the value increases, the probability of the process 'blowing up' increases. At a value of 15, the apache worker process always appears to blow up. The script is being run with 'cgi-script', and not mod_perl. The same symptoms are experienced if the perl script is replaced with an identical compiled C program: --- script start --- #include <stdio.h> int main(void) { int i; printf("Content-Type: text/plain\n\n"); for (i = 0; i < 100000; i++) { printf("moo\n"); fflush(stdout); /* flush output */ } return 0; } --- end start --- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
