IMS: grace & keep

Geoff Simmons geoff at uplex.de
Sun Mar 13 10:37:59 CET 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 3/13/11 9:51 AM, Poul-Henning Kamp wrote:
> 
>> So: if TTL has elapsed, but Varnish finds an object in grace, and
>> decides as it does now to serve it from cache, then it does so;
>> otherwise Varnish uses it to attempt the conditional request (if the
>> object has the headers for it).
> 
> Well, this sort of goes to the max(grace,keep) vs (grace+keep) issue.
> 
> If we make it max(grace,keep), then only keep should be considered
> for IMS, and the two timers are 100% independent.
> 
> If we make it (grace+keep) they act in tandem and any object in grace
> is automatically subject to IMS and you can not totally disable
> IMS on an object.

I agree. (In the latter case, you could disable IMS, but only in VCL.)

> Which is more intuitive ?

We had originally gone with max(grace,keep) because it gives admins all
of the options.

The difference is that with max(grace,keep), it's possible to have keep
< grace. In this configuration, there is a period (keep < t < grace) in
which the cache can retain an object that it could serve in grace mode,
but if it decides not to, then the backend fetch will not be attempted
with IMS.

I think it's not out of the question that an admin might want that. A
site may need to have a long grace period, due to many concurrent
sessions and occasionally unhealthy backends. They might also want to
guard against the "PHP bug" scenario that you talked about -- the
backend can't always determine that a certain resource has changed, so
it might return 304 for IMS when it actually shouldn't. For that, it
would make sense to have the long grace but short keep period.

With (grace+keep), ie the keep interval extends strictly after the grace
interval, as in the trunk right now, I don't think you can do that, not
even in VCL, if I'm not mistaken. (Maybe there's some very clever VCL
that I'm overlooking.)

So I think that with max(grace,keep), and default_keep == default_grace,
we have the widest range of options and simplest defaults.


Best,
Geoff
- -- 
UPLEX Systemoptimierung
Schwanenwik 24
22087 Hamburg
http://uplex.de/
Mob: +49-176-63690917
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJNfJB2AAoJEOUwvh9pJNURsZcP/iPIogLHuIzm0gnqxiIEYsvK
w41XPjsm+cGTQX670qC37vHDiBzMhF54ZU2e9Pw/zGjlgXN2vMXmw7jKF7jIn7+v
r58R4s18vkf8YRUSLyru3+YJoU1iaR0wVg+KjcjLrknDTXNM4g+dwg5cj/BNXsAE
a9MyL8HkvrMl5XfeoyZ+oGY+cdUF32fIIQ6VHfuyW95HZ51M+FSDkM4qHDOyNc5+
NeDkCrrF7rCXj2O88H/7D6ERNSmdZKn8d3emrSkTb9+m0Q3M+3+RLZ6xX+MMAjQc
z8QNwrcZHyczhb3xsYisn+vqeLjRLXr1oboPit2iOlFoEO4g9Wrg57jl/z9t+VT6
ol0w8lYD9/gCuhVFmjmJQBrq/M2m7xqw9X2xBgnzUQp820wHJ1Y0T/qaKWm6gPs2
QzawFxerNWv5KhqAqK4z3dIoL052aBt1n8BDnOBwvZ/UwunCemerdKHkvlboZAoD
PcR25nkwcPah7tz0sersvpTAlMqkDLB6zwAv7vYlUp+dBFFolk5oRiwQhoPSUVpC
WIpgOealAp6iKKrfnFZsGtkeYviVvfaBFv6byH+A2dokzjhGm2CEojw78rkTMI77
lyFswEbHYc8CYiRN3wZDpgW4BpUuy3ROTGa06g9ufHgzlNRn1ArGMMngkGNbAv1s
llKNDC2ijY/PtxYMv09m
=LBFb
-----END PGP SIGNATURE-----



More information about the varnish-dev mailing list