Performance Problem
| From: | Adriano Manocchia | Date: | Wed, 27 Feb 2008 17:39:05 +0000 |
| Subject: | Performance Problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-270341@lists.php.net to get a copy of this message | ||
Hi all,
I've been chasing what I think is the same performance issue for about
a year and it's driving me batty. First off, the server is a dual core
2.8 P4 with 2G RAM running RHEL5 hosted at The Planet and is under
very light load. This problem started last year while the server was
RHEL4 and I completely rebuilt it with RHEL5.
The PHP-based sites hosted on the server have shown intermittent
performance issues when loading. A page might load fine 2 or 3 times,
then take 5-10 seconds to complete the next page load.
I've gone through everything top-to-bottom to try to eliminate
possibilities:
First thought was MySQL, so I took that out of the equation and tested
pages that didn't use the database and that had no effect.
Second though was httpd, so I compared straight HTML with PHP, and
found the problem only occurred with the PHP pages. Straight html had
no issues, so it's definitely a PHP problem.
I've been compiling my own PHP with MySQL binary releases, so to make
sure I wasn't causing the problem, I rolled back to RHEL5 httpd, php,
and mysql. I even used the RPM's php.ini to try to rule everything
out. To try and quantify the issue, I made a PHP page that just had a
one-line echo and compared it with a regular html page and ran httperf
tests with the following values (run from the server to take network
issues out of the equation):
httperf --hog --num-conn 100 --ra 10 --timeout 5
The html page always ran with no errors:
Connection time [ms]: min 0.2 avg 0.4 max 13.7 median 0.5 stddev 1.4
Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
On the other hand, the PHP on successive attempts:
Connection rate: 6.9 conn/s (145.0 ms/conn, <=31 concurrent connections)
Connection time [ms]: min 83.3 avg 585.4 max 2215.0 median 406.5
stddev 510.6
Reply status: 1xx=0 2xx=70 3xx=0 4xx=0 5xx=0
Errors: total 30 client-timo 30 socket-timo 0 connrefused 0 connreset 0
Connection rate: 10.0 conn/s (99.7 ms/conn, <=6 concurrent connections)
Connection time [ms]: min 25.7 avg 232.1 max 1443.4 median 141.5
stddev 244.0
Reply status: 1xx=0 2xx=100 3xx=0 4xx=0 5xx=0
Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Connection rate: 6.8 conn/s (148.0 ms/conn, <=47 concurrent connections)
Connection time [ms]: min 107.4 avg 1066.1 max 1989.7 median 1201.5
stddev 519.5
Reply status: 1xx=0 2xx=22 3xx=0 4xx=0 5xx=0
Errors: total 78 client-timo 78 socket-timo 0 connrefused 0 connreset 0
As you can see, it's all over the place and it shouldn't really be
taxing it enough to cause problems on that server. At this point, I
don't know what else to do. If anyone can shed any light on this, I'd
be forever grateful. I'll try anything and do whatever I can on my end
to fix this. Thanks in advance.