(random) 503 errors with varnish

If you’re getting 503 errors when using varnish and everything works fine without varnish, then you may run in to the max-header-lines limit.

When looking at the output of varnishlog you might see errors like this when fetching the page from the backend:

FetchError   c http first read error: -2 0 (No error recorded)

I’ve noticed that certain web software sometimes goes berserk with adding cookies (usually the same ones over and over again, so you don’t see them in your browser).  But perhaps you really need that many headers. 🙂

Anyway, varnish has a default limit on the header-lines of 64. Increasing that size may help eliminate those pesky 503’s. The run-time parameter in varnish is http_max_hdr. You must set it on the command line when starting varnish. You cannot set this parameter in a .vcl file.

The syntax to set this run-time parameter to, say 256, is:

-p http_max_hdr=256

You usually add this the the start-up settings for varnish. On debian for instance, you add them to the DAEMON_OPTS in /etc/default/varnish.


This is what the varnish manual has to say about the http_max_hdr parameter:

  • Units: header lines
  • Default: 64

Maximum number of HTTP headers we will deal with in client request or backend reponses. Note that the first line occupies five header fields. This paramter does not influence storage consumption, objects allocate exact space for the headers they store.

Posted on May 21, 2012 at 20:06 by alex · Permalink · Leave a comment
In: linux

Very cool Uncharted cake!

For my 40th birthday I got this very cool Uncharted birthday cake. (with Sackboy Drake!)
(cake made by Cindelicious)













Posted on April 5, 2012 at 21:58 by alex · Permalink · Leave a comment
In: games

itunes could not backup…session could not be created

When you get the dreaded “itunes could not backup the ipad because the backup session could not be created” error, try to powercycle your ipad first before you look into itunes. It could have saved me an evening googling and syncing in vain.

To turn off your ipad hold de sleep/wake button for a few seconds, and slide the slider to really turn off your ipad.

Turn on: hold the sleep/wake button until the apple logo appears.

If your ipad hangs while shutting down (the throbber keeps spinning) hold both the sleep/wake and the home button until the apple logo appears.

Posted on January 6, 2011 at 20:53 by alex · Permalink · Leave a comment
In: apple · Tagged with: 

Getting the lirc_nct677 module to work on ION330 with (ubuntu) kernel 2.6.32-23+

Due to a change in the lirc_dev module the LIRC driver module provided by ASRock will no longer compile / install (depending on your approach) on ubuntu kernels that came with a recent update for ubuntu 10.40.

Compiling the module via dkms might give errors like:

error: ‘struct irctl’ has no member named ‘lock’ in lirc_wb677_main.c

Loading a previous version of the module might give errors like:

lirc_wb677: disagrees about version of symbol lirc_register_driver
lirc_wb677: Unknown symbol lirc_register_driver

To solve this problem I created an updated source-deb of the wb677 driver that does compile on 2.6.32-23 and newer kernels.
You can download it here .

How to use (as root or use sudo):

  1. remove and uninstalled all old modules and (source) packages for the lirc_wb677 module.
  2. download the updated driver dkms-source file
  3. apt-get install dkms
  4. apt-get install lirc-modules-source
  5. dpkg -i  ./lirc-nct677x-src-dkms_1.0.4-ubuntu10.04_all.deb[1]
  6. dkms add -m lirc-nct677x-src -v 1.0.4-ubuntu10.04
  7. dkms build -m lirc-nct677x-src -v 1.0.4-ubuntu10.04
  8. dkms install -m lirc-nct677x-src -v 1.0.4-ubuntu10.04

Make sure you use the default lirc_dev module that comes with the 2.6.32-23 kernel! Delete /lib/modules/2.6.32-23-generic/updates/dkms/lirc_dev.ko folder if it exists and run depmod -a.

To see if the new module loads run modprobe lirc_wb677 and check dmesg for errors.

Configure the lirc modules as outlined in the PDF provided by ASRock.


A compiled .ko module for the 2.6.32-24 kernel can be found here. Remove everything after the .ko and put the file here: /lib/modules/2.6.32-24-generic/updates/dkms/lirc_wb677.ko


[Back to post] 1) You can safely ignore the warning generated by dpkg listed below. It must be due to do with my inferior packaging skills. Dpkg just needs to install the source code at the right location (/usr/src) and that bit works just fine.

This package appears to be a binaries-only package
you will not be able to build against kernel 2.6.32-23-generic
since the package source was not provided

Posted on July 3, 2010 at 16:12 by alex · Permalink · 60 Comments
In: linux · Tagged with: , ,

Webdav and multiviews

Fortunately the excellent KeePass password manager has the ability to store its database on a webdrive. However, since version 2.09 KeePass changed the way it saves files to such a webdrive.  Instead of just saving over the old file it first creates a .tmp file that it moves to the real file after a successful save. And that’s when the problem arises.

It turns out that renaming a file from mypasswd.kdbx.tmp to mypasswd.kdbx doesn’t play nice with the apache multiviews option. When trying to save a file to the webdav  location, KeePass fails with a message like:
Failed to save the current database  to the specified location!
The remote server returned an error: (404) Not Found.

When looking at the apache error log it logs a line like:
Negotiation: discovered file(s) matching request: /var/www/path/to/some_dav_location/mypasswd.kdbx (None could be negotiated)
The solution to this problem is to disable MultiViews in the apache config. Find the part in your config that has the “Dav on” statement and add a line like:
Options -MultiViews
For security reasons you may want to add “-Indexes” there as well (and of course password protect your dav space using digest authentication).

Posted on November 29, 2009 at 20:37 by alex · Permalink · 2 Comments
In: linux · Tagged with: , ,