Current time: 11-22-2017, 09:16 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
First byte time on first run
11-14-2017, 09:17 PM
Post: #1
First byte time on first run
Hi all,

Here's my test -

http://www.webpagetest.org/result/171114...75fb53ffe/

I'm just curious why the first byte time is so high on the first run, CPU utilisation is zero during this time so I'm clueless to what's causing the delay.

Caching has kicked in from the second run and I'm very happy with the results, but would be nice to get to the bottom of that delay.

Running NginX / PHP-FPM on a Kimsufi KS-1 server

Thanks for looking
Visit this user's website Find all posts by this user
Quote this message in a reply
11-16-2017, 03:16 AM
Post: #2
RE: First byte time on first run
Time to serve first asset relates to...

1) Hosting environment.

2) Code you're running.

Since you're running WordPress the optimization process is fairly simple.

You say you're running NGINX + likely your running NGINX -> Apache -> FPM.

Likely problem is your WordPress caching. Currently WP Super Cache is broken + W3TC is always slow.

Try setting up WP Fastest Cache + likely this will help some.

And... how your hosting (runtime environment) is setup has a huge amount to do with your site speed.

You're running on OVH SAS, which likely means some sort of cloud services. If this setup uses software VMs, then this may be the problem... as VMs dramatically decrease performance.

If you have ssh access, run mysqltuner + ensure your database is optimized for speed (so fix all emitted diagnostics).

Since you're running FPM, setup your config to emit the normal access.log file + you can likely seem immediately where the slowness comes from.

Like help speeding up your site? Skype me @ ID davidfavor for a quote. Be sure to include your site name in your Skype Add Contact request.
Find all posts by this user
Quote this message in a reply
11-17-2017, 05:03 AM
Post: #3
RE: First byte time on first run
Thanks for the response

Mysqltuner has given me a lot to think about and only time will tell if its suggested tweaks will make a difference.

Nginx + php-fpm is the sole webserver, no Apache involved. The server is dedicated, not VPS, though it is very low spec. I have caching set up on Nginx which works very well after the TTFB problem on the first run, I'll look at the Wordpress plugins if I can't make a big difference with other tweaks.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-18-2017, 07:15 PM
Post: #4
RE: First byte time on first run
Things seem to be going well!!

I'd like to think that MySQL tuning has had the biggest difference, but another change I made was to point Wordpress to 127.0.0.1 for the database rather than localhost. I think that's made the biggest difference.

http://www.webpagetest.org/result/171118...a324a94cf/
Visit this user's website Find all posts by this user
Quote this message in a reply
11-19-2017, 10:47 PM
Post: #5
RE: First byte time on first run
(11-18-2017 07:15 PM)Cloudmaster Wrote:  Things seem to be going well!!

I'd like to think that MySQL tuning has had the biggest difference, but another change I made was to point Wordpress to 127.0.0.1 for the database rather than localhost. I think that's made the biggest difference.

http://www.webpagetest.org/result/171118...a324a94cf/

Changing 127.0.0.1 to localhost has so tiny difference in your case that you really shouldn't even think about it unless your WP executes dozens of thousands of SQL queries.

Most probably you have caching plugin installed (W3TC or something similar) or your web server is caching your pages on per URL basis. On first visit you hit empty cache and PHP code has to be run on your server which results in 1.0+ sec response times. On subsequent requests the cache for this URL is already populated and it's a basically matter of sending back static content to the user browser.

You can easily verify that. Check response times for:
http://randomthoughts.trisect.uk/?t=3
(alter the "3" at the end). You will notice that the first request takes 1.0sec+ time to complete and next requests to that URL require substantially less time to complete. Then change the URL parameter again to notice that the first request again requires 1.0sec+.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


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