Last modified 2014-11-17T14:21:02+01:00 ago

Builtin VCL / default VCL

The builtin VCL (builtin.vcl) (in 3.0 lingo this was called the default VCL (default.vcl)) is a set of VCL rules that are built in to Varnish.

Make sure you understand this: Your own VCL-configuration will not overwrite this default configuration, it will just be prepended to each sub. Unless your VCL code executes a terminating statement (e.g. return(pass)) it will continue into these default subs.

The VCL flow diagram can help with understanding how the request processing state engine is executed, and at which time Varnish calls into the functions of your VCL configuration.

In Varnish 4.0, the flow diagram looks like varnish_flow_4_0.png Download (in 3.0 like varnish_flow_3_0.png Download). If you'd like to to generate an image like below from the source, you will need to install  GraphViz. This will provide you with the dot command which is used to generate the chart. From your checkout, run:

  ### Varnish 4.0:
  $ sed -n '/^DOT/s///p' varnish-cache/bin/varnishd/cache/cache_req_fsm.c | dot -Tpdf > /tmp/varnish_flow.pdf

  ### Varnish 3.0:
  $ sed -n '/^DOT/s///p' varnish-cache/bin/varnishd/cache_center.c | dot -Tpdf > /tmp/varnish_flow.pdf

Attachments

  • vcl.png Download (97.4 KB) - added by perbu 2008-09-12T19:59:04+02:00 ago. VCL graph
  • vlc.dot Download (738 bytes) - added by perbu 2008-09-12T20:05:00+02:00 ago. The dot-file for the graph.
  • varnish-2.0.4-flow.jpg Download (181.5 KB) - added by kane 2009-08-28T13:26:53+02:00 ago. VCL flow
  • varnish-flow.png Download (59.0 KB) - added by kristian 2011-09-08T09:50:46+02:00 ago. Update the 3.0-flow to include return(restart) in vcl_error
  • varnish_flow_3_0.png Download (59.0 KB) - added by martin 2014-11-17T14:18:41+01:00 ago.
  • varnish_flow_4_0.png Download (89.4 KB) - added by martin 2014-11-17T14:18:54+01:00 ago.