[PATCH] Add a recycle_maxage attribute to backend definitions.

Martin Blix Grydeland martin at varnish-software.com
Thu Aug 28 11:16:29 CEST 2014

I guess it would be possible to add a failed flag to the struct vbc, and
then have the struct backend keep some running average of (now - last_use)
on BackendClose() where failed==true and recycled==true. But for that
approach to get close to accurate, the time the connection fails would need
to be picked up accurately, which would make the nanny thread keeping a
poll() running on the connections necessary.

But in the case of these transparent loadbalancers that don't RST an open
connection that poll() would not succeed in noticing the connection goes
bad, and then the averaging value would not be accurate any more. It would
be averaging when we happened to notice the bad connection due to a reused
backend connection attempt failing instead of when the connection actually
went bad.

So I guess the answer is no, I can't think of any sensible way we could
make this auto-tuning.

What the default value should be is another good question. I put it at 60
because it's a round number, and long enough for it to not bother people
who don't need the feature. Perhaps we should have a 'disabled' value
instead and default to that. And then it can be turned on for those that
actually need it. Or even put it at e.g. 10 seconds, and we might sort out
some problems for people being hit by this. Input most welcome :)


On 28 August 2014 10:37, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:

> --------
> In message <1409151673-23375-1-git-send-email-martin at varnish-software.com>,
> Mar
> tin Blix Grydeland writes:
> Is there any (sensible) way we can make this auto-tuning ?
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk at FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.

<http://varnish-software.com>*Martin Blix Grydeland*
Senior Developer | Varnish Software AS
Cell: +47 21 98 92 60
We Make Websites Fly!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20140828/3dcd54de/attachment.html>

More information about the varnish-dev mailing list