Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-file
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-file
Commits
b9fb4c59
Commit
b9fb4c59
authored
Mar 01, 2021
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the docs about VCL cold/warm transitions.
parent
6bd2c9f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
40 deletions
+68
-40
README.rst
README.rst
+34
-20
vmod_file.vcc
src/vmod_file.vcc
+34
-20
No files found.
README.rst
View file @
b9fb4c59
...
@@ -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 (se
e
unmapped, and file update checks for any of the instance's objects ar
e
|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|_ i
f
back to the warm state (which also happens during an invocation o
f
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
...
...
src/vmod_file.vcc
View file @
b9fb4c59
...
@@ -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 (se
e
unmapped, and file update checks for any of the instance's objects ar
e
|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|_ i
f
back to the warm state (which also happens during an invocation o
f
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment