How to make multiple clients can get the response at the same time by stream.

Jakub Słociński kuba at ovh.net
Tue Jan 29 13:13:40 CET 2013


Hi Xianzhe Wang,
you should try option 
"set req.hash_ignore_busy = true;"
in vlc_recv.

Regards,
-- 
Jakub S.


Xianzhe Wang napisał(a):
> Hello everyone,
>     My varnish version is 3.0.2-streaming release.And I set
> "beresp.do_stream  = true" in vcl_fetch in order to "Deliver the object to
> the client directly without fetching the whole object into varnish";
> 
> This is a part of my *.vcl file:
> 
>  sub vcl_fetch {
>     set beresp.grace = 30m;
> 
>     set beresp.do_stream = true;
> 
>     if (beresp.http.Content-Length && beresp.http.Content-Length ~
> "[0-9]{8,}") {
>        return (hit_for_pass);
>     }
> 
>      if (beresp.http.Pragma ~ "no-cache" || beresp.http.Cache-Control ~
> "no-cache" || beresp.http.Cache-Control ~ "private") {
>            return (hit_for_pass);
>        }
> 
>      if (beresp.ttl <= 0s ||
>          beresp.http.Set-Cookie ||
>          beresp.http.Vary == "*") {
> 
>                 set beresp.ttl = 120 s;
>                 return (hit_for_pass);
>      }
> 
>     return (deliver);
>  }
> 
> Then I request a big file(about 100M+) like "xxx.zip" from clients.There is
> only one client can access the object.because "the object will marked as
> busy as it is delivered."
> 
> But if  the request goes directly to “pass” ,multiple clients can get the
> response at the same time.
> 
> Also if I remove
>   if (beresp.http.Content-Length && beresp.http.Content-Length ~
> "[0-9]{8,}") {
>        return (hit_for_pass);
>     }
> to make the file cacheable,multiple clients can get the response at the
> same time.
> 
> Now I want "multiple clients can get the response at the same time." in all
> situations("pass","hit","hit_for_pass").
> 
> What can I do for it?
> Any suggestions  will be appreciate.
> Thank you.
> 
>  -Shawn Wang

> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc




More information about the varnish-misc mailing list