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

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.

Comments

Per Buer's picture

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

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