Varnish buildout recipe
This version only supports varnish 3.x.
This package also doesn't provide all the features of plone.recipe.varnish, since it's designed to be used slightly differently. Using this recipe you have one varnish daemon per deployed backend application server. If you have three different applications on a server, you will run three varnish daemons. This means they can be separately deployed, configured and maintained. This also means there is no need for host-header based routing.
Note that this package provides no support for installing varnish. Use the binary provided by your OS, or use zc.recipe.cmmi perhaps.
The key differences are:
- This packages uses isotoma.recipe.gocaptain to write the start/stop scripts, so it's more likely to play well with your OS and behaves more normally
- Support for a separate logging system with each varnish instance, again using GoCaptain
- A different (and arguably more sane) basic varnish configuration
- Easy support for custom templates
A recipe for this package would look something like:
[varnish] recipe = isotoma.recipe.varnish name = mysite bind = 127.0.0.1:8080 backends = 127.0.0.1:9000 varnishlog = /usr/bin/varnishncsa logfile = /var/log/varnish/mysite.log
This would create two start scripts in your bin directory: varnish and varnishlog. The log instance will only log activity for this varnish instance.
- The host:port to listen on
- A list of backends (note only one backend is currently supported with the default template, because some director code is required. A custom template should work ok though, if you write one.)
- This identifies the individual varnish instance - see the -n option to varnishd. (required if you are using varnishlog and recommended even if not)
- The size of the cache.
- The .connect_timeout option in the output VCL
- The .first_byte_timeout option in the output VCL
- The .between_bytes_timeout in the output VCL
- The path to the varnishd daemon (default /usr/sbin/varnishd)
- Any other parameters to pass at runtime (without the -p)
- The user to run the daemon as (default nobody)
- The group to run the daemon as (default nobody)
- If you set this, you will get some very useful debugging headers in your HTTP output.
- The path to the template to use, if you wish to provide a different one. It's expected that this will be a Varnish 2.1 template. If you try to use Varnish 2.0, isotoma.recipe.varnish will attempt to downgrade the template.
- Include lines matching the specified regex in the log output
- Exclude lines matching the specified regex from the log output
- Include lines with the specified tag in the log output
- Exclude lines with the specified tag from the log output
- The path to the logfile to write (required if varnishlog specified)
- The path to the varnishlog binary - you can use either varnishlog or varnishncsa
- Offer a management interface on the specified address and port. (format: address:port) Will generate a varnishadm wrapper in bin dir with the -T address:port already provided
- By default HTML is explicitly excluded from being cached, to avoid various broken configurations we've seen. If you really want to cache HTML pages, set this to 'on'
Copyright 2010 Isotoma Limited
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.