httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dishko Georgiev" <dishk...@rozabg.com>
Subject [users@httpd] Apache Memory consumption
Date Fri, 23 Apr 2004 18:17:45 GMT
Hi,

I have strange problem with Apache 2.0.48/PHP4.3.3 on Fedora Core1.
I use PHP script that reads very big files and send content to clients.
Scripts is:

        $file=fopen($user_dir."/".$i->fname,"rb");
        fseek($file,$f_pos);
        do {
            $b=fread($file,1024*4);
            if (strlen($b) == 0) {
                break;
            };
            print($b);
            unset($b);
            flush();
            while(@ob_end_flush());
            usleep(50000);

        } while (true);
The flush() function must flush buffers (if any) to client imediatly, but i
think its doesnt work. For 2-3 hours all memory of my server is used + all
swap memory (3GB) then kernel start killing httpd processes to free memory!
I tryed to stop all output buffering in PHP and Apache, stoped all modules
that i dont use + all cache modules, all proxy and etc... But problem is
same, apache just use all memory! At first i thinked its memory leak in PHP,
but after few hours of testing i can tell that problem isnt there. Its look
like for some reason apache chields doesnt free memory that it use for
buffering before all download finish! Log of apache have just this msg
regularly:
[Fri Apr 23 19:28:59 2004] [info] (32)Broken pipe: core_output_filter:
writing data to the network
[Fri Apr 23 19:35:01 2004] [info] (32)Broken pipe: core_output_filter:
writing data to the network
[Fri Apr 23 19:38:17 2004] [info] (32)Broken pipe: core_output_filter:
writing data to the network
[Fri Apr 23 19:44:13 2004] [info] (32)Broken pipe: core_output_filter:
writing data to the network
[Fri Apr 23 19:47:25 2004] [info] (32)Broken pipe: core_output_filter:
writing data to the network
[Fri Apr 23 19:50:36 2004] [info] (32)Broken pipe: core_output_filter:
writing data to the network
[Fri Apr 23 19:53:44 2004] [info] (104)Connection reset by peer:
core_output_filter: writing data to the network


Can some help me whats the problem? Server is running Fedora Core 1,
httpd-2.0.48-1.2, PHP 4.3.3-1 all provided from RedHat, system: P4 2.4Ghz,
512MB RAM, 370GB LVM disk




---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message