Current time: 11-20-2019, 05:26 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Long time to first byte (no wordpress)
08-17-2011, 12:08 AM
Post: #1
Long time to first byte (no wordpress)
Hello,
I'm trying to optimize my website. Its custom made, uses phpBB-like code and structure, but the code is newly written and optimised, both on php and mysql side.

The webserver is Lighttpd, via fastcgi running php-fcgi v5.3

I see big lag between the DNS lookup and the first bytes being sent, as seen here

http://www.webpagetest.org/result/110816_AG_1B583/

When I go microtime my page, it takes only

0.58464700 1313501950
0.63717800 1313501950

0.05 seconds to complete the page, but it takes

0.815 seconds to recieve first byte.

I'm speaking about the very first line (main php page), but I see significant amount of time wasted for first byte in almost all requests.

I wonder why ? Where shall I look for the difference ?

Thank you for any advice.
Find all posts by this user
Quote this message in a reply
08-18-2011, 02:06 AM
Post: #2
RE: Long time to first byte (no wordpress)
I see 238ms for the first byte time of the request itself (with dns and socket connect removed) - http://www.webpagetest.org/result/110816.../#request1

50ms of that is last-mile latency so you're looking at ~150ms.

Most of the difference is probably in lightppd and fastcgi spining up the php interpreter. Are you using APC to cache the php bytecode?
Visit this user's website Find all posts by this user
Quote this message in a reply
08-18-2011, 07:06 PM
Post: #3
RE: Long time to first byte (no wordpress)
thank you

yes, im using lighttpd - php-fastcgi - APC in the chain ...

yesterday, I moved the DNS to reliable company (until then the DNS was hosted on the same server as the web, and as it seems, secondary was not working, so the DNS resolve might be long) so I will see if it makes any difference (i guess it shouldnt take as much as 0.5 second to do DNS resolve ...)

im currently working on caching the pages to harddrive to reduce the PHP processing time and serve as much content static as possible.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)