Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-health
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-health
Commits
09953854
Commit
09953854
authored
Jul 18, 2017
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the docs a bit (just editorial)
parent
14b519ec
Pipeline
#274
skipped
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
44 deletions
+46
-44
README.rst
README.rst
+23
-22
vmod_health.vcc
src/vmod_health.vcc
+23
-22
No files found.
README.rst
View file @
09953854
...
...
@@ -37,8 +37,8 @@ DESCRIPTION
===========
This Varnish Module (VMOD) makes details about the health of a backend
available in VCL
. This is the information that is shown as the reult
the
``backend.list`` command
in
the Varnish CLI, which is commonly invoked
available in VCL
-- the information shown in the output of
the
``backend.list`` command
of
the Varnish CLI, which is commonly invoked
via ``varnishadm``.
If a health probe has been defined for a backend, then its health or
...
...
@@ -46,17 +46,17 @@ sickness may be determined by the results of the probe. But if the
``backend.set_health`` command has been invoked to set the backend
manually to healthy or sick, then that health state will apply in the
decisions that Varnish makes to choose backends. The ``std.healthy()``
method from the ``std`` VMOD returns the result of that decision, but
does not distinguish whether it resulted from a probe or from the us
e
of ``backend.set_health``.
The functions in this VMOD make that distinction possible
-- it can be
determined, for example, that a backend is healthy according to its
probe, but has been set to sick via the CLI. The states of
administrative health are the same as those seen in the output
for the
``backend.list`` command: ``
probe``, ``healthy`` or ``sick`` if the
backend health is determined by the probe, manually set to healthy, or
manually set to unhealthy, respectively.
function from the ``std`` VMOD returns the result of that decision,
but does not distinguish whether it resulted from a probe or from th
e
use
of ``backend.set_health``.
The functions in this VMOD make that distinction possible
in VCL -- it
can be determined, for example, that a backend is healthy according to
its
probe, but has been set to sick via the CLI. The states of
administrative health are the same as those seen in the output
of
``backend.list`` command: ``
"probe"``, ``"healthy"`` or ``"sick"`` if
the backend health is determined by the probe, manually set to
healthy, or
manually set to unhealthy, respectively.
Examples::
...
...
@@ -131,17 +131,18 @@ probe_healthy
BOOL probe_healthy(BACKEND)
Return whether a backend is healthy according to the results of its probe,
independent of any manual state set by ``backend.set_health``.
Return true if the backend is healthy according to the results of its
probe, independent of any state set manually by
``backend.set_health``.
This function M
UST be invoked only if a probe is assigned to the backend,
which is not necessarily true of every backend. If it is called for a
backend
without a probe, then VCL failure is invoked: response status
503 is returned, and an error message with the tag ``VCL_Error`` is
emitted to the
log.
This function M
AY NOT be invoked for a backend unless a probe is
assigned to it, which is not necessarily the case for every
backend
. If it is called for a backend without a probe, then VCL
failure is invoked: response status 503 is returned, and an error
message with the tag ``VCL_Error`` is emitted to the Varnish
log.
To avoid that,
you can call the ``has_probe()`` function before calling
this function
.
To avoid that,
call ``has_probe()`` first, and call this function only
if ``has_probe()`` returns true
.
Example::
...
...
src/vmod_health.vcc
View file @
09953854
...
...
@@ -20,8 +20,8 @@ DESCRIPTION
===========
This Varnish Module (VMOD) makes details about the health of a backend
available in VCL
. This is the information that is shown as the reult
the
``backend.list`` command
in
the Varnish CLI, which is commonly invoked
available in VCL
-- the information shown in the output of
the
``backend.list`` command
of
the Varnish CLI, which is commonly invoked
via ``varnishadm``.
If a health probe has been defined for a backend, then its health or
...
...
@@ -29,17 +29,17 @@ sickness may be determined by the results of the probe. But if the
``backend.set_health`` command has been invoked to set the backend
manually to healthy or sick, then that health state will apply in the
decisions that Varnish makes to choose backends. The ``std.healthy()``
method from the ``std`` VMOD returns the result of that decision, but
does not distinguish whether it resulted from a probe or from the us
e
of ``backend.set_health``.
The functions in this VMOD make that distinction possible
-- it can be
determined, for example, that a backend is healthy according to its
probe, but has been set to sick via the CLI. The states of
administrative health are the same as those seen in the output
for the
``backend.list`` command: ``
probe``, ``healthy`` or ``sick`` if the
backend health is determined by the probe, manually set to healthy, or
manually set to unhealthy, respectively.
function from the ``std`` VMOD returns the result of that decision,
but does not distinguish whether it resulted from a probe or from th
e
use
of ``backend.set_health``.
The functions in this VMOD make that distinction possible
in VCL -- it
can be determined, for example, that a backend is healthy according to
its
probe, but has been set to sick via the CLI. The states of
administrative health are the same as those seen in the output
of
``backend.list`` command: ``
"probe"``, ``"healthy"`` or ``"sick"`` if
the backend health is determined by the probe, manually set to
healthy, or
manually set to unhealthy, respectively.
Examples::
...
...
@@ -91,17 +91,18 @@ Example::
$Function BOOL probe_healthy(BACKEND)
Return whether a backend is healthy according to the results of its probe,
independent of any manual state set by ``backend.set_health``.
Return true if the backend is healthy according to the results of its
probe, independent of any state set manually by
``backend.set_health``.
This function M
UST be invoked only if a probe is assigned to the backend,
which is not necessarily true of every backend. If it is called for a
backend
without a probe, then VCL failure is invoked: response status
503 is returned, and an error message with the tag ``VCL_Error`` is
emitted to the
log.
This function M
AY NOT be invoked for a backend unless a probe is
assigned to it, which is not necessarily the case for every
backend
. If it is called for a backend without a probe, then VCL
failure is invoked: response status 503 is returned, and an error
message with the tag ``VCL_Error`` is emitted to the Varnish
log.
To avoid that,
you can call the ``has_probe()`` function before calling
this function
.
To avoid that,
call ``has_probe()`` first, and call this function only
if ``has_probe()`` returns true
.
Example::
...
...
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