Bug #7747 Updated: after opening a socket and while reading from it php start growing CPU/MEM usag

From: Date: Sun, 21 Oct 2001 01:48:45 +0000
Subject: Bug #7747 Updated: after opening a socket and while reading from it php start growing CPU/MEM usag
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-68531@lists.php.net to get a copy of this message
ID: 7747 Updated by: sniper Reported By: pov@club-internet.fr Old Status: Open Status: Feedback Bug Type: Performance problem Operating System: FreeBSD 4.0-RELEASE Apache 1.3.1 PHP Version: 4.0.3pl1 New Comment: Does this happen with PHP 4.0.6 ? Previous Comments: ------------------------------------------------------------------------ [2000-11-10 10:42:09] pov@club-internet.fr I use a small script grabbed from fopen to get a ftp file since fopen is buggy when dealing with ftp:// urls with encoded path name (ie using abc%20def for example). $datei = fsockopen("localhost", 3128, &$errno, &$errstr); if( !$datei ) { echo "proxy not available !"; fclose($resultfile); exit(); } else { fputs($datei,"GET $url HTTP/1.0\n\n"); set_time_limit(0); fpassthru($datei); } The result is that as fpassthru sends the info from socket the mem usage grows dangerously and so does the CPU usage (up to 75% of CPU on a P100 after sending 4 Megs). Doing a "while" with a "print fgets" is even worth (but that sounds logical at least). Another "interesting" behavior of this, is that when I don't add a set_time_limit, the httpd child which delivers the info is killed with a signal 11 after 2-3 minutes and 40-45 sec. of CPU time, even though my default time-limit is 30sec. That's all I see for now. ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=7747&edit=1

« previous php.dev (#68531) next »