Magento – Time To First Byte with varnish cache – 12 seconds

full-page-cachemagento-2.1magento2performancevarnish

I installed varnish cache and verified using official guide.

In official guide mention 5ms to load the url with varnish but mine it is 12s.

Info:

OS : ubuntu 14.0.4, webserver : apache2, php : 7, php memory_limit : 2G, Varnish : varnish-4.0.5

Below attached my store front(http://host/codebase/production) chrome console output

Easy for your reference

what I need to tune? please feel free to post answer/comment, any help would be much appreciated, we can keep consolidating answer of tuning page load speed.

Best Answer

i have export varnish vcl config in backend and move it to varnish config folder

configuration in my dev enviroment
Enable all cache types
No js or css minify or bundle. Dev site no need this feature
Backend port 8080 i'm using nginx server listening 8080 port


Move magento exported file varnish.vcl (located in magentoroot/var) to /etc/varnish/ change name to default.vcl I use ubuntu os and change default varnish port 6081 to 80 for listen all traffic user

daemon varnish config service located in /etc/varnish/default

DAEMON_OPTS="-a :80 -T localhost:6082 -f /etc/varnish/default.vcl"

Change port nignx to 8080

After that restart all service such as nginx, varnish, php

Above is all my experiences in my dev machine