Varnish

From Wikitech
(Difference between revisions)
Jump to: navigation, search
(initial docs)
(configuration)
Line 3: Line 3:
 
We currently use Varnish for serving <tt>bits.wikimedia.org</tt>.
 
We currently use Varnish for serving <tt>bits.wikimedia.org</tt>.
  
 +
== Configuration ==
 +
Deployment of Varnish is done using [[Puppet]], using class <tt>varnish</tt> in file <tt>manifests/varnish.pp</tt>.
  
 +
We use the ''varnish'' package of Ubuntu/Debian, minimum version 2.1.2. Puppet installs this, and replaces its <tt>/etc/default/varnish</tt> file to set some startup parameters (discussed below). Varnish uses a ''VCL file'' (Varnish Configuration Language), a DSL where Varnish behaviour is controlled using subroutines that are compiled into C and executed during each request. The Wikimedia VCL file is
 +
/etc/varnish/wikimedia.vcl
  
You also may want to read [[Bits varnish testing]] instead, for Domas his findings during a pilot project.
 
  
  
 +
 +
 +
You also may want to read [[Bits varnish testing]] instead, for Domas his findings during a pilot project.
  
 
----
 
----

Revision as of 14:58, 26 July 2010

Varnish is a fast caching proxy, and can be used as an alternative to Squid in a reverse caching accelerator setup.

We currently use Varnish for serving bits.wikimedia.org.

Contents

Configuration

Deployment of Varnish is done using Puppet, using class varnish in file manifests/varnish.pp.

We use the varnish package of Ubuntu/Debian, minimum version 2.1.2. Puppet installs this, and replaces its /etc/default/varnish file to set some startup parameters (discussed below). Varnish uses a VCL file (Varnish Configuration Language), a DSL where Varnish behaviour is controlled using subroutines that are compiled into C and executed during each request. The Wikimedia VCL file is

/etc/varnish/wikimedia.vcl



You also may want to read Bits varnish testing instead, for Domas his findings during a pilot project.


Mark intends to test Varnish for feasibility of using it instead of Squid for Wikimedia CDN purposes.

Things that need special consideration

  • HTCP purging
  • Immediate purging of cache objects (nuke?)
  • Header normalization (Host, Accept-Encoding...)
  • Two-layer setup (CARP style)
  • Compatible logging
  • Request stats

Would be nice

  • SSL
  • IPv6

Many of these are probably already taken care of by our friends at Wikia, and therefore possibly also within Varnish itself...

External links

Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox