Bug #15746 Updated: Process exec() is slow from webserver - running from shell is ok ...

From: Date: Wed, 17 Jul 2002 08:36:03 +0000
Subject: Bug #15746 Updated: Process exec() is slow from webserver - running from shell is ok ...
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14393@lists.php.net to get a copy of this message
ID: 15746 Updated by: jonohlsson@hotmail.com Reported By: nigel@green-bean.com Status: Feedback Bug Type: Performance problem Operating System: Windows 2000 Server PHP Version: 4.1.1 New Comment: Other interesting facts: the problem previously was time-outs. Every added jpeg took like forever to upload. but if you studied the taskmanager there was a pattern. Every jpegtopnm.exe call was idle (cpu 0 %) for about 30 secs...then the cpu jumped to 100% for about 1 sec. So there must have been some 30 sec parameter somewhere making the call rest. I dont know: I've checked every parameter there is in php.ini and congig.php (for gallery) and httpd.conf. Could it really be a firewall-issue...? ...it feels strange..BUT alas it works now. /jon Previous Comments: ------------------------------------------------------------------------ [2002-07-17 04:26:53] jonohlsson@hotmail.com Well Im running PHP 4.2.1/Apache 2.0.36...I didn't download that php_win32_latest.zip because after some further tweaking IT STARTED WORKING! I really cannot reconstruct any detailed info about what I did but now I can upload jpegs really fast. Every jpeg-image takes about 1 sec. I think I used the latest netpbm release (10.3) and then I may have used the jpegtopnm.exe from the 9.25 release (not sure). I used the cyg*.dlls from the 9.25 release though. At first there was no improvement BUT THEN I TURNED MY NORTON FIREWALL OFF AND VOILA...IT STARTED WORKING LIKE 'SNAPPING YOUR FINGERS'. Sorry I cannot be of more help...if you like i could zip all files im using for you to analyse... /jon ------------------------------------------------------------------------ [2002-07-16 14:23:19] sniper@php.net Try this snapshot first: http://snaps.php.net/win32/php4-win32-latest.zip ------------------------------------------------------------------------ [2002-07-16 05:51:15] jonohlsson@hotmail.com I have tried every netpbm-distr there is, even mixing different versions and still it takes forever to upload jpeg files (gifs work like a charm)...it MUST be a PHP-bug /Jon ------------------------------------------------------------------------ [2002-07-10 10:33:11] nigel@green-bean.com Ollie tried the suggested workaround with the same (negative) results. ------------------------------------------------------------------------ [2002-07-09 17:33:41] ollie@oliverc.com I don't know if anyone got any further (guessing not...) but I've taken the non-stable CVS snapshot, installed it, and modified the gallery script that makes an exec call to use proc_open. Unfortunatly it doesn't make any difference. The following (mess!) is the code I've used to test the call: $descriptorspec = array( 1 => array("pipe", "w") // stdout is a pipe that the child will write to // 2 => array("file", "/tmp/error-output.txt", "a"), // stderr is a file to write to ); msg("CALLING PROC_OPEN"); $process = proc_open("cmd.exe /c $cmd", $descriptorspec, $pipes); msg("PROC OPEN DONE"); if (is_resource($process)) { msg("SUCCESS"); // $pipes now looks like this: // 0 => writeable handle connected to child stdin // 1 => readable handle connected to child stdout // Any error output will be appended to /tmp/error-output.txt while(!feof($pipes[1])) { msg("+"); echo fgets($pipes[1], 2); msg("-"); } fclose($pipes[1]); $return_value = proc_close($process); echo "RETURNED: $return_value"; } Basically my output window does nothing for about 50 seconds after printing the first + symbol before the actual output from the command starts to appear. Running the identical command in a command prompt takes less than one second to complete. I'm running WinXP (home) with Apache 1.3.26 btw (and have the same problem people have reported above obviously). ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/15746 -- Edit this bug report at http://bugs.php.net/?id=15746&edit=1

« previous php.bugs (#14393) next »