Commit b9fb4c59 authored by Geoff Simmons's avatar Geoff Simmons

Update the docs about VCL cold/warm transitions.

parent 6bd2c9f1
...@@ -118,13 +118,13 @@ transaction. ...@@ -118,13 +118,13 @@ transaction.
.. |vcl.use| replace:: ``vcl.use`` .. |vcl.use| replace:: ``vcl.use``
When a VCL instance transitions to the cold state, the file update When a VCL instance transitions to the cold state, the file cache is
checks for any of the instance's objects are suspended (see unmapped, and file update checks for any of the instance's objects are
|vcl.state|_ in `varnish-cli(7)`_). When it transitions back to the suspended (see |vcl.state|_ in `varnish-cli(7)`_). When it transitions
warm state (which also happens during an invocation of |vcl.use|_ if back to the warm state (which also happens during an invocation of
the VCL had previously been cold), then the files are immediately |vcl.use|_ if the VCL had previously been cold), then the files are
checked for changes, updating the cached contents if necessary, and immediately re-read and cached, and the update checks in the
the update checks in the background resume at the TTL interval. background resume at the TTL interval.
File deletion and file updates File deletion and file updates
------------------------------ ------------------------------
...@@ -682,19 +682,33 @@ they are cached by many VMOD objects in many VCL instances. ...@@ -682,19 +682,33 @@ they are cached by many VMOD objects in many VCL instances.
.. |vcl.discard| replace:: ``vcl.discard`` .. |vcl.discard| replace:: ``vcl.discard``
File caches are unmapped, and timers are deleted, when the VMOD's .. _vcl_cooldown: https://varnish-cache.org/docs/trunk/reference/varnishd.html#vcl-cooldown
reader objects are finalized. This happens when the |vcl.discard|_
command is used to unload VCL instances. While it is not uncommon for .. |vcl_cooldown| replace:: ``vcl_cooldown``
Varnish admins to neglect ``vcl.discard``, it can become a resource
leak if too many obsolete VCL instances that use VMOD file are allowed File caches are unmapped and timers are suspended when the VCL
to accumulate. Consider implementing a housekeeping procedure to clean instance transitions to the cold state. Timers are deleted when the
up old VCLs. VMOD's reader objects are finalized, which happens when the
|vcl.discard|_ command is used to unload VCL instances. When a new VCL
If the file unmappings and timer deletions fail during object instance is made active (with ``vcl.use``), the previously active
finalization, error messages are written to the Varnish log using the instance enters the cold state after the period defined by the
tag ``Error`` (visible with raw grouping). While these errors are varnishd parameter |vcl_cooldown|_ elapses (10 minutes in recent
unlikely, if they do happen, they may be indications of resource Varnish versions), unless ``vcl.discard`` is invoked first. The cold
leaks. Consider monitoring the log for such errors. transition always takes place on VCL discard, if the instance is not
already cold.
So if you need to release the resources held by objects of this VMOD
in inactive VCL instances, consider shortening the ``vcl_cooldown``
period and/or automating the removal of old instances with
``vcl.discard``. (Housekeeping with ``vcl.discard`` is a good
practice for Varnish that is often neglected.)
If the file unmappings and timer suspensions and deletions fail during
the cold transition or object finalization, error messages are written
to the Varnish log using the tag ``Error`` (visible with raw
grouping). While these errors are unlikely, if they do happen, they
may be indications of resource leaks. Consider monitoring the log for
such errors.
.. _VSL query: https://varnish-cache.org/docs/trunk/reference/vsl-query.html .. _VSL query: https://varnish-cache.org/docs/trunk/reference/vsl-query.html
......
...@@ -114,13 +114,13 @@ transaction. ...@@ -114,13 +114,13 @@ transaction.
.. |vcl.use| replace:: ``vcl.use`` .. |vcl.use| replace:: ``vcl.use``
When a VCL instance transitions to the cold state, the file update When a VCL instance transitions to the cold state, the file cache is
checks for any of the instance's objects are suspended (see unmapped, and file update checks for any of the instance's objects are
|vcl.state|_ in `varnish-cli(7)`_). When it transitions back to the suspended (see |vcl.state|_ in `varnish-cli(7)`_). When it transitions
warm state (which also happens during an invocation of |vcl.use|_ if back to the warm state (which also happens during an invocation of
the VCL had previously been cold), then the files are immediately |vcl.use|_ if the VCL had previously been cold), then the files are
checked for changes, updating the cached contents if necessary, and immediately re-read and cached, and the update checks in the
the update checks in the background resume at the TTL interval. background resume at the TTL interval.
File deletion and file updates File deletion and file updates
------------------------------ ------------------------------
...@@ -632,19 +632,33 @@ they are cached by many VMOD objects in many VCL instances. ...@@ -632,19 +632,33 @@ they are cached by many VMOD objects in many VCL instances.
.. |vcl.discard| replace:: ``vcl.discard`` .. |vcl.discard| replace:: ``vcl.discard``
File caches are unmapped, and timers are deleted, when the VMOD's .. _vcl_cooldown: https://varnish-cache.org/docs/trunk/reference/varnishd.html#vcl-cooldown
reader objects are finalized. This happens when the |vcl.discard|_
command is used to unload VCL instances. While it is not uncommon for .. |vcl_cooldown| replace:: ``vcl_cooldown``
Varnish admins to neglect ``vcl.discard``, it can become a resource
leak if too many obsolete VCL instances that use VMOD file are allowed File caches are unmapped and timers are suspended when the VCL
to accumulate. Consider implementing a housekeeping procedure to clean instance transitions to the cold state. Timers are deleted when the
up old VCLs. VMOD's reader objects are finalized, which happens when the
|vcl.discard|_ command is used to unload VCL instances. When a new VCL
If the file unmappings and timer deletions fail during object instance is made active (with ``vcl.use``), the previously active
finalization, error messages are written to the Varnish log using the instance enters the cold state after the period defined by the
tag ``Error`` (visible with raw grouping). While these errors are varnishd parameter |vcl_cooldown|_ elapses (10 minutes in recent
unlikely, if they do happen, they may be indications of resource Varnish versions), unless ``vcl.discard`` is invoked first. The cold
leaks. Consider monitoring the log for such errors. transition always takes place on VCL discard, if the instance is not
already cold.
So if you need to release the resources held by objects of this VMOD
in inactive VCL instances, consider shortening the ``vcl_cooldown``
period and/or automating the removal of old instances with
``vcl.discard``. (Housekeeping with ``vcl.discard`` is a good
practice for Varnish that is often neglected.)
If the file unmappings and timer suspensions and deletions fail during
the cold transition or object finalization, error messages are written
to the Varnish log using the tag ``Error`` (visible with raw
grouping). While these errors are unlikely, if they do happen, they
may be indications of resource leaks. Consider monitoring the log for
such errors.
.. _VSL query: https://varnish-cache.org/docs/trunk/reference/vsl-query.html .. _VSL query: https://varnish-cache.org/docs/trunk/reference/vsl-query.html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment