vcl_hash

I’ve been trying to figure out the effect of this line in my Varnish config:

sub vcl_hash { if (req.http.Cookie) { set req.hash += req.http.Cookie; } }

It seemed to make sense, but I was having a hard time wrapping my head around its ramifications. I was looking at some of the docs on the Varnish site and at this great Varnish config walkthrough when the metaphorical lightbulb went on. By adding the cookie to the hash it’s effectively creating a per-session cache.

Hmm. An interesting tradeoff. On one hand it’s filling up my available cache with duplicate copies of the same content because the hash identifying the cached content is cookie-specific. On the other, it is delivering content from cache that wouldn’t normally be cached because of the cookie.

High performance Varnish/Pressflow/Drupal community of practice

At DrupalCamp PDX this weekend, I was fortunate enough to have some very interesting (if tantalizingly-brief) discussions with Josh Koenig (joshk), Sam Boyer (sdboyer) and Damien Tournoud around sharing configs and best practices for scaling Drupal sites, especially using Varnish and Pressflow. OK. We’ve talked about it. Now let’s do it!

I see three primary places we might start building on that seed:

Those of you out there running Drupal in large scale environments, let’s start sharing configs and techniques so we can all do better.

Pressflow, Varnish and Caching … oh my!

It all started with an itch. It was a really painful itch that involved a Drupal site that was essentially down due to load. I scratched it with the help of a few incredibly helpful blog posts I found, so now it’s my turn to add to them so someone else can benefit as well.

The Problem:

HALP! The site, it is sinking!
HALP! The site, it is sinking!

A large school district wanted to replace their existing outdated static web site with a modern CMS. They chose Drupal as their platform. The new site was successful.

Too successful.

The average traffic of 5 hits/sec jumped to over 100 hits/sec and the server went into a swap death spiral.

Fear not! Help is on the way in to form of a couple of technological superheroes …

Pressflow and Varnish - Technology superheroes
Pressflow and Varnish to the rescue!

The mutually-complimentary combination of these two tools can vastly increase the number of users your site can serve. Here’s the what, why, and how:
Continue reading ‘Pressflow, Varnish and Caching … oh my!’

24 hours to go!

Get your Google Summer of Code proposal in now! They’re due by noon tomorrow.

Don’t miss out on your chance to get paid to work on open source software for the summer!