Configuration to avoid dog-pile when cache is empty

Per Buer perbu at varnish-software.com
Mon Jun 7 13:15:32 CEST 2010


On Sat, Jun 5, 2010 at 1:52 PM, Cosimo Streppone <cosimo at streppone.it> wrote:

> That sounds surprising to me. Can you explain?
> Say that I restart varnish.
> Then 10 clients hit the "/takes_long_time_to_load.html" page at
> the same time.
>
> What I understand from your reply is that varnish will hold the
> 9 remaining connections until the first one sees the backend
> reply. At that point, the 9 remaining clients will get served
> the cached object.

Yes. There is a whole lot of work spent on the code that releases the
9 remaining clients. At some point (1.x) we had massive problems when
thousands of clients where released at the same time.

> Is that really how it works?

If it where to work any other way it would be a bit silly, wouldn't
you think? Load spikes could really kill the backend.

> I'm specifically referring to the first time after restart,
> so grace doesn't apply here.

Yes. Grace is something else. Grace is a deliberate, this is not. You
can't turn this behavior off.

Evgeniy: I saw your reference to hit-for-pass. Hit-for-pass objects
are created especially for the situation where we find that it doesn't
make sense to queue up objects. A "hit for pass" object is created to
cache this finding so incomming reqeusts are passed directly when
there is a hit-for-pass object.

-- 
Per Buer,  Varnish Software
Phone: +47 21 54 41 21 / Mobile: +47 958 39 117 / skype: per.buer




More information about the varnish-misc mailing list