php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27240 Apache 2.0.48 + PHP + Win2K = extremely slow
Submitted: 2004-02-13 08:20 UTC Modified: 2004-02-13 19:06 UTC
From: akoerni at rocketmail dot com Assigned:
Status: Not a bug Package: Performance problem
PHP Version: 4.3.4/5.0.0b4 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: akoerni at rocketmail dot com
New email:
PHP Version: OS:

 

 [2004-02-13 08:20 UTC] akoerni at rocketmail dot com
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-13 08:27 UTC] akoerni at rocketmail dot com
Changed Version so that it is correct now.
 [2004-02-13 09:58 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Works fine for me. (there's something wrong with your system apparently)

 [2004-02-13 16:46 UTC] akoerni at rocketmail dot com
If there is something wrong with my system, why does the same config/script work with the old Apache Version 1.3.29?

What works fine for you? The site I mentioned? It works fine for me there, too (the provider has a completely different setup).
 [2004-02-13 19:06 UTC] derick@php.net
Fortune-san says: "stick with apache 1.3 if you are smart"
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC