I'd posted this @ http://lists.drupal.org/pipermail/support/2011-November/019837.html, and got a msg that that list, too, is the 'wrong place', and that this is a better choice. Feeling a bit like a ping pong ball ... Anyways:
I've been considering putting Varnish3 in front of Drupal7.
I've scoured scads of snippets of inconsistent/incomplete/outdated
information from the HighPerformance group, the FourKitchens wiki, the
Varnish wiki, the Drupal Varnish module threads, countless blogs,
BadCamp presentations, various mailing lists, etc.
If there's a "good" setup documented out there, I have yet to find it.
Is there one, complete, example out there that anyone can point to? Written in mere-mortal, non-guru English?
Specifically, a known-to-work Varnish3 VCL + Drupal7 modules (not
Varnish2, Drupal6, PressflowN, or MercuryX), module configs, &
settings.php, and/or overrides that will correctly handle registered &
anonymous caching, cookies, sessions, etc?
Comments
I think most people are
I think most people are running Varnish 2.1 since that's what's included in Debian stable (and I'm assuming derived Linux distributions as well).
--
Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his
That may be the case for
That may be the case for Debian (it's not for Ubuntu, apparently, https://launchpad.net/ubuntu/+source/varnish/).
You're certainly correct in that 'most' publicized configs are out for Varnish2, with, Pressflow6. I really don't know the install base's numbers.
But in any case that's specifically not what I'm looking/asking for.
@ Varnish, "The current stable release of Varnish Cache is 3.0.2.". That's where the development focus and support are. As is the true for Drupal7, itself.
So, this question, at this time, remains: Varnish3 + Drupal7.
Part of the reason why
Part of the reason why varnish is such an exceptionally good tool is the power of VCL. Unfortunately this power comes at a cost, as you've discovered VCL is not a user friendly language.
You need a firm grasp of the HTTP protocol if you want to read and write good VCL.
There's no cookie-cutter varnish configuration because each instance is very site specific.
If you look at the varnish documentation then you'll see it's mostly based around snippets rather than one 'solution'.
These are the reasons why you can't find a definitive answer and even if you did (such as the fourkitchens D6 config) it would be a mediocre solution at best.
I realise this is not a very helpful answer. You will probably get a much better response from me and the rest of the web if you have a much more specific question(s).
If you're looking for a near zero configuration solution then the boost module is extremely effective for anonymous users.
http://www.linkedin.com/in/linuxwizard
There's no cookie-cutter
I disagree. We've got a template for 2.1 that we've used on dozens of sites. It's rare that we need to do any site-specific alteration of the template (What was more common was that we discovered something during setup that we needed to add to the template for all sites. Though that hasn't happened in a while - it's currently very stable).
--
Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his
If you're looking for a near
Not in the least.
I'm looking for a well-considered, detailed configuration across Varnish3, Drupal7, modules & settings, that clearly defines one set of site assumptions -- ideally one that's common enough to be a good "80/20" rule solution -- and works for anonymous & registered users.
One example for D7 with Varnish 3
As the above users mentioned, you need to build your configuration (VCL) specifically to to site/server.
That being said, we made some progress in the project thread:
http://drupal.org/node/1196916
The VLC in #23 works for me. It could be a good basis for you to start with.
Yep, I'm aware of that thread
Yep, I'm aware of that thread -- having posted to it twice myself.
It's one of the partial-solutions to which I referred in my OP. It's not fully 'well behaved' -- if only as evidenced by the comments at the thread by others, as well. Talking to some of the devs @ BadCamp, if their arguments are to be believed (I do ...), the config there, and the module itself have some functional problems that need to, but have not yet been, addressed.
As for not being cookie-cutter, I'll agree the "peak performance" may require tweaking. That's true for just about every cache-related module out there.
I agree with dalin that there's certainly a well-considered, base config for V3, D7, and a nominal collection of modules/settings that will work for a clean D7 install for "90%" of sites. The "Pressflow6" config that FourKitchens published some ages ago has worked well for some time, out of the box, for many sites -- with V2 & PF6, of course.
Per my OP, Im not just talking about the VCL, but also which modules, and what settings in them, are really needed/recommended, what are the settings.php settings, etc.
D7 Modules
You may have also read http://drupal.org/node/1215564 however that covers APC, Memcache and Varnish and their related modules.
Specifically for Varnish:
# Varnish
$conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';
$conf['cache_class_cache_page'] = 'VarnishCache';
$conf['page_cache_invoke_hooks'] = false;
$conf['reverse_proxy'] = true;
$conf['cache'] = 1;
$conf['cache_lifetime'] = 0;
$conf['page_cache_maximum_age'] = 21600;
$conf['reverse_proxy_header'] = 'HTTP_X_FORWARDED_FOR';
$conf['reverse_proxy_addresses'] = array('127.0.0.1');
$conf['omit_vary_cookie'] = true;
- Varnish version: 3
- Varnish Control Terminal: 127.0.0.1:6082
- Varnish Control Key: (from /etc/varnish/secret)
- make sure Cache pages for anonymous users is enabled
I've posted a Drupal 7,
I've posted a Drupal 7, Varnish 3 configuration that I'm using to github here:
https://github.com/halcyonCorsair/varnish-for-drupal
why do you have one healthcheck for both backends?
Correct me if I'm wrong but
https://github.com/halcyonCorsair/varnish-for-drupal/blob/master/etc/var...
"Host: www.domain.com"IMHO you should do it as described here: https://www.varnish-cache.org/docs/trunk/reference/vcl.html#backend-probes
without "Host" in request. Otherwise you'll get the same status for both backends.
probe healthcheck {
.url = "/status.cgi";
.interval = 60s;
.timeout = 0.3 s;
.window = 8;
.threshold = 3;
.initial = 3;
.expected_response = 200;
}
backend www {
.host = "www.example.com";
.port = "http";
.probe = healthcheck;
}
also I'm not aware of any auto-rules in varnish to pass healthcheck requests and I dont see PASS for "status.php" in default.vcl so looks like healthchecks will be cached?
The example above would work
@lury:
The example above would work fine if you have a single backend that the varnish server knows as www.example.com (eg. via /etc/hosts).
My example configuration is built to handle the follwing complications:
Either of the above require the website hostname to be specified as part of the probe via .request.
eg. serving websites www.example.com and www.example2.com
/---- web1.localdomain.com [the internets] ---- firewall/load balancer ---- varnish < \---- web2.localdomain.comMy example (some options removed):
probe healthcheck {
.request =
"GET /status.php HTTP/1.1"
"Host: www.example.com"
"Connection: close";
}
backend web1 {
.host = "web1.servers.domain.com";
.port = "80";
.probe = healthcheck;
}
backend web2 {
.host = "web2.servers.domain.com";
.port = "80";
.probe = healthcheck;
}
Regarding status.php:
For testing I pass status.php here: https://github.com/halcyonCorsair/varnish-for-drupal/blob/master/etc/var..., however I allow health checks on varnish itself in vcl_recv via:
if (req.request == "GET" && req.url ~ "^/varnishcheck$") {error 200 "Varnish is Ready";
}
(https://github.com/halcyonCorsair/varnish-for-drupal/blob/master/etc/var...)
ok got it - .host is an
ok got it - .host is an external address of a machine and Host in .request is a vhost on this machine.
regarding PASS - missed that \.
thanks.