Jump to: navigation, search


< Dev


Varnish Cheat Sheet[edit]

For Varnish 4.

Show most requested URLs from backend[edit]

varnishtop -i BereqURL

Show specific requested URLs from backend[edit]

varnishlog -q 'BereqURL ~ "^/forum/Themes/default/scripts/"

Show requests for single URL[edit]

varnishlog -q 'ReqURL ~ "^/wiki/Translatetest"'

Show backend responses[edit]

varnishlog -g request -q "RespStatus eq 503"
varnishlog -g request -q "BerespStatus eq 503"

HTTP Purges[edit]

curl -X "PURGE / HTTP/1.0"
or: curl --head -X "PURGE / HTTP/1.0"
check (Resets Age in http header to 0.): curl --head https://www.whonix.org/adrelanos.asc

Show HTTP requests[edit]

varnishlog -q "ReqMethod eq PURGE"

Show HTTP purges[edit]

varnishlog -q "VCL_return eq purge"

Ban single URL[edit]

varnishadm 'ban req.url ~ "/adrelanos.asc"'
varnishadm 'ban req.url ~ "/wiki/Translatetest"'

Ban all URLs[edit]

varnishadm 'ban req.url ~ "."'

Show how many connections are currently open[edit]

netstat -anp | grep :443 | grep ESTABLISHED | wc -l

wordpress Total Cache varnish setup[edit]

wordpress -> Performance (on the side) -> General Settings -> Reverse Proxy run in shell: varnishlog -q "VCL_return eq purge"
test: wordpress -> Performance (at the top) -> empty all cache

list of all variables such as client.ip[edit]


default built-in vcl[edit]


Show nuked items[edit]

Elements that have been removed from cache due to lack of memory.

varnishstat -1 -f MAIN.n_lru_nuked



## Patrick: changed from
## -s malloc,256m
## to
## -s malloc,8G

varnish advantages[edit]

Feature Requests[edit]


Random News:

Have you read our Documentation, Technical Design and Developer Portal links yet?

Impressum | Datenschutz | Haftungsausschluss

https | (forcing) onion
Share: Twitter | Facebook | Google+
This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! See Conditions for Contributions to Whonix, then Edit! IP addresses are scrubbed, but editing over Tor is recommended. Edits are held for moderation. Whonix (g+) is a licensee of the Open Invention Network. Unless otherwise noted above, the content of this page is copyrighted and licensed under the same Free (as in speech) license as Whonix itself.