Hi folks,<div><br></div><div>Hope I'm on the right list. I have Varnish setup and running correctly with a good hitrate (i think) 1011 Cache hits - 13 misses</div><div>I've setup a test Linode VPS configured as follows:</div>
<div><br></div><div>Ubuntu 10.10</div><div>512MB RAM</div><div>PHP-FPM</div><div>NGINX 1.0 (8080)</div><div>Varnish (80)</div><div><br></div><div>I've got WordPress running the latest W3 Total Cache development version with Page Caching (enhanced) working correctly.</div>
<div><br></div><div>My default.vcl is posted below. I've assigned 128MB memory to Varnish.</div><div><br></div><div>Prior to running Varnish I was getting about 40 reqs/sec running the follow bench test</div><div><br>
</div><div><div>ab -n 1000 -c 100 <a href="http://staging2.themesforge.com/">http://staging2.themesforge.com/</a></div></div><div><br></div><div>Post Varnish install I'm getting the same or slightly less. I've tried the bench from a few different servers and getting similar results.</div>
<div><br></div><div>Has anyone any ideas where I might be going wrong?</div><div><br></div><div>Thanks,</div><div><br></div><div>Ed</div><div><br></div><div>default.vcl</div><div><br></div><div><div>backend default {</div>
<div> .host = "127.0.0.1";</div><div> .port = "8080";</div><div>}</div><div> </div><div>acl purge {</div><div> "127.0.0.1";</div><div>}</div><div><br></div><div>sub vcl_recv {</div>
<div> # Add a unique header containing the client address</div><div> remove req.http.X-Forwarded-For;</div><div> set req.http.X-Forwarded-For = client.ip;</div><div><br></div><div># Let's make sure we aren't compressing already compressed formats.</div>
<div> if (req.http.Accept-Encoding) {</div><div> if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|mp3|mp4|m4v)(\?.*|)$") {</div><div> remove req.http.Accept-Encoding;</div><div> } elsif (req.http.Accept-Encoding ~ "gzip") {</div>
<div> set req.http.Accept-Encoding = "gzip";</div><div> } elsif (req.http.Accept-Encoding ~ "deflate") {</div><div> set req.http.Accept-Encoding = "deflate";</div>
<div> } else {</div><div> remove req.http.Accept-Encoding;</div><div> }</div><div> }</div><div><br></div><div> if (req.request == "PURGE") {</div><div> if (!client.ip ~ purge) {</div>
<div> error 405 "Not allowed.";</div><div> }</div><div> return(lookup);</div><div> }</div><div>if (req.url ~ "^/$") {</div><div> unset req.http.cookie;</div>
<div> }</div><div> </div><div>}</div><div><br></div><div>sub vcl_hit {</div><div> if (req.request == "PURGE") {</div><div> set obj.ttl = 0s;</div><div> error 200 "Purged.";</div>
<div> }</div><div>}</div><div>sub vcl_miss {</div><div> if (req.request == "PURGE") {</div><div> error 404 "Not in cache.";</div><div> }</div><div>if (!(req.url ~ "wp-(login|admin)")) {</div>
<div> unset req.http.cookie;</div><div> }</div><div> if (req.url ~ "^/[^?]+.(jpeg|jpg|png|gif|ico|js|css|txt|gz|zip|lzma|bz2|tgz|tbz|html|htm)(\?.|)$") {</div><div> unset req.http.cookie;</div>
<div> set req.url = regsub(req.url, "\?.$", "");</div><div> }</div><div> if (req.url ~ "^/$") {</div><div> unset req.http.cookie;</div><div> }</div><div>}</div><div>sub vcl_fetch {</div>
<div> if (req.url ~ "^/$") {</div><div> unset beresp.http.set-cookie;</div><div> }</div><div>if (!(req.url ~ "wp-(login|admin)")) {</div><div> unset beresp.http.set-cookie;</div>
<div>}</div><div>}</div></div><div><br></div><div><br></div><div><br></div>