httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yair Eshel <>
Subject [users@httpd] proformance problem with apache - php handles a request 5 or 10 sec too late.
Date Tue, 30 Jan 2007 07:57:14 GMT
Hi all.

I'm using Apache/2.2.4 with Php 5.2.0, installed from source on a Centos 
4.3. I'm using IP based virtualhosting, to allow multiple site handling. 
As my sites went a bit slow from time to time, I've created a test, that 
sends a request using http 1.0 , from another machine to those sites, 
and measure the time it takes to get the server response. Most of the 
time it took in less then a second, but from time to time, I got the 
reply in 5 or 10 seconds for a page. Now strange as it may seem, it, 
almost allways, was around 5 sec, or around 10 sec. Rarly 3, 4, 6 or 7.

The first thing I did was to see that my php application is not taking 
too long. To my surprise, it didn't. So, I've added a log that tells me 
when the application started handling the request. This is a rather 
normal example of a failed test:

885623055 - started on: 01-00-35
(With 885623055 being a random number assigned for this test)

Then I've looked at apache log (Combined plus %D to state when the 
request sent all it's data, and %f with mod_log_firstbyte)

<My super secret test machine ip> - - [30/Jan/2007:01:00:30 -0600] "GET 
/?TestId=885623055&date=01-00-30 HTTP/1.0" 200 36566 "-" "Test Bot" 
5423730 5405310

As you can see, apache got the request on 01:00:30, about the time it 
was sent, but the php script started handling it on 01-00-35. What 
happend on that 5 seconds, I cannot tell.

I have heard that 5/10 seconds could have somthing to do with hostname 
lookup (as 5 sec is, in some systems, the timeout for a dns lookup and 
it could be searching twice). At the time hostnamelookups was on, and it 
seemed reasonable. So I turned it off. As it didn't do any help, I've 
decided to monitor all the connections to the name server using tcpdump. 
Test have failed, but no reverse lookups were found during that period. 
Now I can't figure out a way to understand what apache does when it's 
taking 5 sec to answer the request.

Can anyone think of a way to found out whats wrong?

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message