From: akoerni at rocketmail dot com Operating system: Windows 2000 PHP version: 4.3.4 PHP Bug Type: Performance problem Bug description: Apache 2.0.48 + PHP + Win2K = extremely slow
Description: ------------ This bug was postet at apache.org as Bugzilla Bug 26912 but the guys there told me to post here... I wrote a small PHP script to display a simple table fetched from MySQL on my system. The response time from sending a request until the page is displayed is EXTREMELY slow 5-7 seconds (!) even for tables with only 27 rows. In this time period the hard disk is accessed continously (writing sound). The more rows are added, the slower it gets (each row ~200ms). I installed the same script at (http://akoerni.lima-city-webspace.de/list.php?EinsatzID=1) so you can get an idea. At this site it works as fast as usual (a few milliseconds) if you do not consider request time. It is **NOT** a database/query issue. MySQL response time is some milliseconds (tested with MySQL Control Center, mysql.exe, PHP script). It is **NOT** a latency issue. (Installed on localhost. Redirected above mentioned website to my local database resulting in good performance). The problem is reproduceable with the following configuration: Windows 2000 SP4 (AMD 2400+, 512MB) Apache 2.0.48 (apache_2.0.48-win32-x86-no_ssl.msi) PHP 4.3.4 AND 5.0.0b4 (php-4.3.4-Win32.zip / php-5.0.0b4-Win32.zip) MySQL 4.0.17 (mysql-4.0.17-win-noinstall.zip) Using Apache 1.3.29 on together with PHP 4.3.4 results in good performance! (It does not work with 5.0.0b4, however). I installed each version of Apache as service to all users. The httpd.conf is the default config + 3 PHP specific lines. The php.ini is the php.ini-recommended file with adaptions for the extension_dir and the uncommented line "extension=php_mysql.dll" (PHP 5). Reproduce code: --------------- PHP code for the creation of the HTML table follows: function xmicrotime($name, $starttime) { $now = explode(" ", microtime()); $before = explode(" ", $starttime); $mseconds = $now[0] - $before[0]; $seconds = $now[1] - $before[1]; echo $name . " took " . $seconds . " sec. and " . $mseconds . " ms."; } $i = 0; $start= microtime(); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $i++; echo "\t<tr class=\""; if ($i%2 == 0) {echo "GERADE";} else {echo "UNGERADE";} echo "\">\n"; echo "\t\t<td class=\"datum\">" .$line[Datum]. "</td>\n"; echo "\t\t<td class=\"zeit\">" .$line[Zeit]. "</td>\n"; echo "\t\t<td class=\"kanal\">" .$line[Kanal]. "</td>\n"; echo "\t\t<td class=\"betriebsart\">" .$line[Betriebsart]. "</td>\n"; echo "\t\t<td class=\"an\">" .$line[An]. "</td>\n"; echo "\t\t<td class=\"von\">" .$line[Von]. "</td>\n"; echo "\t\t<td class=\"ereignis\">" .htmlspecialchars($line[Ereignis]). "</td>\n"; echo "\t\t<td class=\"vermerk\">" .htmlspecialchars($line[Vermerk]). "</td>\n"; } xmicrotime("total_time:", $start); Expected result: ---------------- The script should not take longer than 200ms. -- Edit bug report at http://bugs.php.net/?id=27240&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27240&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27240&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27240&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27240&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27240&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27240&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27240&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27240&r=support Expected behavior: http://bugs.php.net/fix.php?id=27240&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27240&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27240&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27240&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27240&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27240&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27240&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27240&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27240&r=float