Streaming in Varnish 3.0

Streaming in Varnish 3.0

Varnish Cache 2.1 does what you can call store-and-forward proxying. It gets the request, then it turns around, gets the whole object from the backend, then turns around and delivers it to the client. If your backend takes time to deliver the object the client might get restless.

If you just want to pass the object to the client, without actually caching it, it is even worse. Delivering a big file, like an ISO image, it can take ages before the download starts and we've seen people do all sorts of weird stuff to work around this.

This has been adressed in Varnish Cache 3.0. You can now, in vcl_fetch, se beresp.do_stream to true and Varnish will deliver the object as it arrives. 

There is one caveat, however. The object will be set to busy while it is streamed. Other clients will be put on hold. Furthermore, the rate at which the object is fetched by the client dictates how fast Varnish will fetch it from the backend. These limitations might be adressed in later releases, however. These limitations do not limit the use of pass, however.

Compression and decompression should work flawlessly with streaming.

Image is copyright 2006 makelessnoise and used under a Creative Commons (CC BY 2.0) licence.


Add comment

Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.


Per Buer's picture

Duh. :-) It is a 100% natural river.

Amazing picture, it actally looks like a 100% natural river!