Heya!
I’m running Nginx on a 512MB Debian 7 Droplet in Amsterdam. The time-to-first-byte is between 400-500ms for static files/pages and funnily enough for a WordPress installation as well.
I’d like to get that down to 100ms, maybe 200ms. Is that a good goal, or are 500ms already good? How do I get that number down without using Varnish? Can I tweak Nginx some way, or would a hardware upgrade change it?
Cheers, Till
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
I was having a very large (500-1500ms) TTFB with
nginx
, wordpress, PHP 7 (php-fpm
), and SSL. This was not the case on non-PHP sites, so it was safe to assume that PHP and SSL each could use some tuning.2 things got me great improvement (<100ms TTFB):
Enable http2 in all of my SSL server blocks (needs nginx 1.9.5+)
Set up
fastcgi_cache
In
/etc/nginx/nginx.conf
:In your server’s .conf file likely in
/etc/nginx/conf.d/
modify the php handling blockrestart nginx
sudo nginx -s reload
This reduced my TTFB to under 100ms consistently, and everything seems to be pretty happy :)
setting up fastcgi_cache did a good job of shortening ttfb
OP right TTFB are very important but people don’t read between the lines I have website Google lower it rank after I move it to another host TTFB was horrible and alot of page failure load . In fact even VPS provider cheating about real resource you get Pleas read this
“” Also, be wary of virtual or “on-demand” hosting systems. These systems will suspend or pause your virtual server if you have not received traffic for a certain period of time. Then, when a new user accesses your site, they will initiate a “resume” activity to spin that server back up for processing. Depending on the provider, this initial resume could take 10 or more seconds to complete. If that first user is the Google search bot, your TTFB metric from that request could be truly awful. “”
http://moz.com/blog/improving-search-rank-by-optimizing-your-time-to-first-byte I think the only solution is using Low End Decided Server Or Xen VPS As it are Hardware Virtualization