r3402 - trunk/varnish-cache/man

tfheen at projects.linpro.no tfheen at projects.linpro.no
Tue Nov 18 21:53:03 CET 2008


Author: tfheen
Date: 2008-11-18 21:53:03 +0100 (Tue, 18 Nov 2008)
New Revision: 3402

Modified:
   trunk/varnish-cache/man/vcl.7so
Log:
Document grace

Thanks to perbu for suggested documentation
Fixes 355


Modified: trunk/varnish-cache/man/vcl.7so
===================================================================
--- trunk/varnish-cache/man/vcl.7so	2008-11-18 13:29:34 UTC (rev 3401)
+++ trunk/varnish-cache/man/vcl.7so	2008-11-18 20:53:03 UTC (rev 3402)
@@ -186,6 +186,24 @@
     pipe;
 }
 .Ed
+.Ss Grace 
+If the backend takes a long time to generate an object there is a risk
+of a thread pile up.
+In order to prevent this you can enable grace.
+This allows varnish to serve an expired version of the object while a
+fresh object is being generated by the backend.
+.Pp
+The following vcl code will make Varnish serve expired objects.
+All object will be kept up to two minutes past their expiration time
+or a fresh object is generated.
+.Bd -literal -offset 4n
+sub vcl_recv {
+    set req.grace = 2m;
+}
+sub vcl_fetch {
+    set obj.grace = 2m;
+}
+.Ed
 .Ss Functions
 The following built-in functions are available:
 .Bl -tag -width indent



More information about the varnish-commit mailing list