Magento & Varnish / Turpentine, Zero-hit rate -
we have strange problems (nginx), magento(1.9.0.1), turpentine , varnish(3.0.2), running on ubuntu 12.04lts. we aren't 2 experienced varnish/turpentine, might basic thing.
we got turpentine vcl applied running varnish instance, , checked result varnishadm vcl.list. enabled debug info in turpentine.
strange thing:
if activate both turpentine caching methods in magento backend->cache, fpc, got following response
server nginx transfer-encoding chunked via 1.1 varnish x-frame-options sameorigin x-powered-by php/5.3.10-1ubuntu3.15 x-turpentine-cache 0 x-turpentine-esi 1 x-varnish 293774805 x-varnish-hits 0 and real bad response time of 3.5sec cause page never seems cached can see in x-turpentine-cache , x-varnish-hits. there's no age set in header.
but if deactivate turpentine fpc, while letting vcl untouched
age 29 server nginx via 1.1 varnish x-frame-options sameorigin x-powered-by php/5.3.10-1ubuntu3.15 x-varnish 293775151 293775096 x-varnish-hits 2 combined optimized resonse time 100ms, seems hit.
what point missing setup turpentine/varnish right way, causing 0 hit rate activated turpentine caching?
thanks in advance...
here's steps troubleshoot:
get varnish working on own:
your varnishd should running several parameters, here's samples ubuntu server install (/etc/defaults/varnish):
-a :6081public port -- port webbrowsers use-t localhost:6082admin port -- used configure varnish-f /etc/varnish/default.vclinitial vcl config file (see below) -- configuration used when varnish first starts-s malloc,256mstorage backend -- 256mb in-memory backend in case-s /etc/varnish/secretpath varnish's admin password file
turpentine's documentation mentions these parameters required:
-p esi_syntax=0x2-p cli_buffer=16384
here's sample default.vcl, barebones config tells varnish proxy requests 127.0.0.1:80, , wil used until turpentine reconfigures varnish:
backend default { .host = "127.0.0.1"; .port = "80"; } you can verify these settings in-use checking running process: ps aux |grep varnishd
testing varnish config
with varnishd running above parameters should able telnet admin port (-t above):
telnet localhost 6082 if provided -s above prompted authorization; use contents of secret file. if can't in via telnet try removing -s parameter disable authentication (you'll want re-enabled later). once login you'll @ varnish console; keep open.
setting turpentine
i assume you've installed turpentine in magento. go system -> configuration , review these settings:
varnish options
- varnish version: set "auto" if don't know specific version you're using
- server list: should match
-tparametervarnishd--localhost:6082in above example - varnish authentication key: should key used
-sabove, or empty if you've disabled authentication
caching options
- backend host:
localhostif magento , varnish on same server, otherwise magento host - backend port: magento's http port (typically 80)
- backend host:
when save these configs should see success or error message. message indicates turpentine able generate new vcl configuration file , make active in varnish. confirm use telnet session run vcl.list. should see like:
vcl.list 200 106 available 4 boot active 2 ef1a15f2132a599ed26520c94c599e71aa7f5e576afcfca211e6249dcd640ddd boot default.vcl above; second vcl turpentine has generated , has been switched active.
- use
system -> cache managementenable both varnish magento caches; flush caches , logout of admin panel ensure takes effect.
at point turpentine should , running. can run varnishstats , load webpage using -a port varnishd. reloading page several times should result in above-zero hitrate.
keep in mind configuration turpentine vcl lost if varnishd restarted (along cached contents). can use cache management page of magento export new .acl file use -f parameter take effect whenever varnish restarts.
Comments
Post a Comment