Skip to content

Instantly share code, notes, and snippets.

@wbotelhos
Created January 31, 2018 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wbotelhos/a1a2c17fdcf44d3ed31d71ad10ef3f79 to your computer and use it in GitHub Desktop.
Save wbotelhos/a1a2c17fdcf44d3ed31d71ad10ef3f79 to your computer and use it in GitHub Desktop.
Varnish Commands

Local

atom /usr/local/etc/varnish/default.vcl
ln -s /usr/local/sbin/varnishd /usr/local/bin/varnishd

Runs

/usr/local/sbin/varnishd -f /usr/local/etc/varnish/default.vcl -a 127.0.0.1:8000 -T 127.0.0.1:3001 -s file,/tmp,500M
/usr/local/sbin/varnishd -a 127.0.0.1:8000 -b 127.0.0.1:3000 -s file,/tmp,500M

Console

varnishncsa
varnishadm

varnishhist:  a histogram that shows the time taken for the requests processing.
varnishlog:   it allows us to see all the requests made to the web backend server.
varnishsizes: it performs the same task as “varnishhist” but showing the size of the objects.
varnishstat:  it shows many contents on cache hits, resource consumption, etc..
varnishtop:   grouped list with the most usual entries from different logs.

Logging request

varnishlog -i BereqMethod,BereqURL,BereqHeader,BerespStatus,BerespHeader,reqMethod,reqURL,reqHeader,respStatus,respHeader,TTL,VCL_call,VCL_return,RespHeader

Load new VCL version

vcl.load v2 /usr/local/etc/varnish/default.vcl
vcl.use v2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment