varnish mp4 streaming
Guillaume Quintard
guillaume.quintard at smartjog.com
Tue Jun 10 11:28:06 CEST 2014
On 06/10/2014 03:07 AM, Hernán Marsili wrote:
> Hi,
>
> We are working on a VIDEO SITE for a sports sites. Currently working
> with Varnish 3.0.5. The average video size is 100mb. We have a 4gb
> malloc storage.
>
> Right now, we are handling mp4 as just a regular file. No problems so
> far. A couple of questions:
>
> 1) STREAM. We tried this on the vcl but we don't see much improvement.
> Should we use it anyway?
>
> if (req.url ~ "\.mp4") {
>
> set beresp.do_*stream* = true;
>
> set beresp.http.X-Cacheable-TTL = "stream";
>
> }
>
>
> 1) VARNISH STREAM BRANCH. We find a all branch of varnish for
> streaming. https://github.com/mbgrydeland/varnish-cache-streaming.
> Does anyway knows if this is now part of Varnish 3.0.5 or Varnish 4?
>
>
You may have two problems:
- the fact that your file is being downloaded, meaning that only the
client who triggered the backend request will profit from the streaming.
This is solved in v4, and data will be send as soon as available, for
all threads.
- the video metadata is at the end of the file, meaning that your
clients must retrieve all the file before starting to read. You're
probably in this case if the video takes a long time to read, even if
cached.
To mitigate the second problem, you may use qt-faststart
(https://github.com/danielgtaylor/qtfaststart) to move the meta data at
the beginning of the file, or switch to a chunked protocol.
(hopefully, if per-request vmods calls come to fruition, or the vfp
mature a bit more, we'll have a vmod to qt-faststartify files on the fly).
Hope that helps.
--
Guillaume Quintard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20140610/67d34d9e/attachment-0001.html>
More information about the varnish-misc
mailing list