Varnish install and configuration on Ubuntu 9.x (notes)

Here are my notes on installing and configuring varnish proxy cache on ubuntu systems ::

# Install varnish on webserver via apt-get

# Uncomment the backend default setting in /etc/varnish/default.vcl

# Change the port numbers in /etc/default/varnish

# Change the port numbers in /etc/apache/ports.conf

# Restart Apache and Varnish

More information here : http://varnish.projects.linpro.no/static/getting-started.html

Function Description Possible keywords
vcl_recv Called after receiving a request. Decides how to serve the request error, pass, pipe
vcl_pipe Called after entering pipe mode.Creates a direct connection between the client and the backend, bypassing Varnish all together. error, pipe
vcl_pass Called
after entering pass mode. Unlike pipe mode, only the current request
bypasses Varnish. Subsequent requests for the same connection are
handled normally.
error, pass
vcl_hash Called when computing the hash key for an object. hash
vcl_hit Called after a cache hit. error, pass, deliver
vcl_miss Called after a cache miss. error, pass, fetch
vcl_fetch Called
after a successful retrieval from the backend. An ‘insert’ will add the
retrieved object in the cache and then continue to vcl_deliver
error, pass, insert
vcl_deliver Called before the cached object is delivered to the client. error, deliver
vcl_timeout Called
by the reaper thread shortly before an object expires in the cache
‘discard’ will discard the object and ‘fetch’ will retrieve a fresh copy
discard, fetch
vcl_discard Called by the reaper thread when a cached object is about to be discarded due to expiration or space is running low discard, keep

Varnish tools

Varnish has a set of command line tools and utilities to monitor and administer Varnish. These are:

  • varnishncsa: Displays the varnishd shared memory logs in Apache / NCSA combined log format
  • varnishlog: Reads and presents varnishd shared memory logs.
  • varnishstat: Displays statistics from a running varnishd instance.
  • varnishadm: Sends a command to the running varnishd instance.
  • varnishhist: Reads varnishd shared memory logs and presents a continuously updated histogram showing the distribution of the last N requests by their processing.
  • varnishtop: Reads varnishd shared memory logs and presents a continuously updated list of the most commonly occurring log entries.
  • varnishreplay: Parses varnish logs and attempts to reproduce the traffic.



Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.
Bg