Varnish stops file download after 60 seconds
The default installation of Varnish 3 on Debian-based system (including Ubuntu) will set a default timeout for sending files to users (i.e. for users files download) to 60 seconds.
To change this limit, it is necessary to update your default Varnish configuration, in /etc/default/varnish.
For example, if you have something like this:
DAEMON_OPTS="-a :80 \ -T localhost:6082 \ -f /etc/varnish/default.vcl \ -S /etc/varnish/secret \ -s malloc,256m"
make sure you add the send_timeout param, like this (see the -p line):
DAEMON_OPTS=”-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-p send_timeout=900 \
This will obviously increase the maximum download time to 900 seconds (15 minutes), which will make it much more practical and less stressfull to download large files.
The logic behind this very short limit is that, if you’re optimizing your site with Varnish, you shouldn’t make it busy with handling one long-term connection with a large file like this (meanwhile, thousands of other connections could have been treated) and your large files should reside on a CDN or something like this.