File manager - Edit - /usr/share/doc/varnish/html/reference/vcl-probe.html
Back
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>VCL-probe — Varnish version 7.1.1 documentation</title> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/classic.css" type="text/css" /> <script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Varnish Processing States" href="states.html" /> <link rel="prev" title="VCL-backends" href="vcl-backend.html" /> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="states.html" title="Varnish Processing States" accesskey="N">next</a> |</li> <li class="right" > <a href="vcl-backend.html" title="VCL-backends" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 7.1.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Varnish Reference Manual</a> »</li> <li class="nav-item nav-item-this"><a href="">VCL-probe</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <div class="section" id="vcl-probe"> <span id="vcl-probe-7"></span><h1>VCL-probe<a class="headerlink" href="#vcl-probe" title="Permalink to this headline">¶</a></h1> <div class="section" id="configuring-backend-health-probes"> <h2>Configuring Backend Health Probes<a class="headerlink" href="#configuring-backend-health-probes" title="Permalink to this headline">¶</a></h2> <dl class="field-list simple"> <dt class="field-odd">Manual section</dt> <dd class="field-odd"><p>7</p> </dd> </dl> <div class="section" id="backend-health-probes"> <span id="reference-vcl-probes"></span><h3>Backend health probes<a class="headerlink" href="#backend-health-probes" title="Permalink to this headline">¶</a></h3> <p>Varnish can be configured to periodically send a request to test if a backend is answering and thus “healthy”.</p> <p>Probes can be configured per backend:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">backend</span> <span class="n">foo</span> <span class="p">{</span> <span class="p">[</span><span class="o">...</span><span class="p">]</span> <span class="o">.</span><span class="n">probe</span> <span class="o">=</span> <span class="p">{</span> <span class="p">[</span><span class="o">...</span><span class="p">]</span> <span class="p">}</span> <span class="p">}</span> </pre></div> </div> <p>They can be named and shared between backends:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">probe</span> <span class="n">light</span> <span class="p">{</span> <span class="p">[</span><span class="o">...</span><span class="p">]</span> <span class="p">}</span> <span class="n">backend</span> <span class="n">foo</span> <span class="p">{</span> <span class="o">.</span><span class="n">probe</span> <span class="o">=</span> <span class="n">light</span><span class="p">;</span> <span class="p">}</span> <span class="n">backend</span> <span class="n">bar</span> <span class="p">{</span> <span class="o">.</span><span class="n">probe</span> <span class="o">=</span> <span class="n">light</span><span class="p">;</span> <span class="p">}</span> </pre></div> </div> <p>Or a <code class="docutils literal notranslate"><span class="pre">default</span></code> probe can be defined, which applies to all backends without a specific <code class="docutils literal notranslate"><span class="pre">.probe</span></code> configured:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">probe</span> <span class="n">default</span> <span class="p">{</span> <span class="p">[</span><span class="o">...</span><span class="p">]</span> <span class="p">}</span> </pre></div> </div> <p>The basic syntax is the same as for backends:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">probe</span> <span class="n">name</span> <span class="p">{</span> <span class="o">.</span><span class="n">attribute1</span> <span class="o">=</span> <span class="n">value</span><span class="p">;</span> <span class="o">.</span><span class="n">attribute2</span> <span class="o">=</span> <span class="s2">"value"</span><span class="p">;</span> <span class="p">[</span><span class="o">...</span><span class="p">]</span> <span class="p">}</span> </pre></div> </div> <p>There are no mandatory attributes, they all have defaults.</p> </div> <div class="section" id="attribute-url"> <h3>Attribute <code class="docutils literal notranslate"><span class="pre">.url</span></code><a class="headerlink" href="#attribute-url" title="Permalink to this headline">¶</a></h3> <p>The URL to query. Defaults to <code class="docutils literal notranslate"><span class="pre">/</span></code>:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">.</span><span class="n">url</span> <span class="o">=</span> <span class="s2">"/health-probe"</span><span class="p">;</span> </pre></div> </div> </div> <div class="section" id="attribute-request"> <h3>Attribute <code class="docutils literal notranslate"><span class="pre">.request</span></code><a class="headerlink" href="#attribute-request" title="Permalink to this headline">¶</a></h3> <p>Can be used to specify a full HTTP/1.1 request to be sent:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">.</span><span class="n">request</span> <span class="o">=</span> <span class="s2">"GET / HTTP/1.1"</span> <span class="s2">"Host: example.com"</span> <span class="s2">"X-Magic: We're fine with this."</span> <span class="s2">"Connection: close"</span><span class="p">;</span> </pre></div> </div> <p>Each of the strings will have <code class="docutils literal notranslate"><span class="pre">CRNL</span></code> appended and a final HTTP header block terminating <code class="docutils literal notranslate"><span class="pre">CRNL</span></code> will be appended as well.</p> <p>Because connection shutdown is part of the health check, <code class="docutils literal notranslate"><span class="pre">Connection:</span> <span class="pre">close</span></code> is mandatory.</p> </div> <div class="section" id="attribute-expected-response"> <h3>Attribute <code class="docutils literal notranslate"><span class="pre">.expected_response</span></code><a class="headerlink" href="#attribute-expected-response" title="Permalink to this headline">¶</a></h3> <p>The expected HTTP status, defaults to <code class="docutils literal notranslate"><span class="pre">200</span></code>:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">.</span><span class="n">expected_response</span> <span class="o">=</span> <span class="mi">418</span><span class="p">;</span> </pre></div> </div> </div> <div class="section" id="attribute-timeout"> <h3>Attribute <code class="docutils literal notranslate"><span class="pre">.timeout</span></code><a class="headerlink" href="#attribute-timeout" title="Permalink to this headline">¶</a></h3> <p>How fast the probe must succeed, default is two seconds:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">.</span><span class="n">timeout</span> <span class="o">=</span> <span class="mi">10</span><span class="n">s</span><span class="p">;</span> </pre></div> </div> </div> <div class="section" id="attribute-interval"> <h3>Attribute <code class="docutils literal notranslate"><span class="pre">.interval</span></code><a class="headerlink" href="#attribute-interval" title="Permalink to this headline">¶</a></h3> <p>Time between probes, default is five seconds:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">.</span><span class="n">interval</span> <span class="o">=</span> <span class="mi">1</span><span class="n">m</span><span class="p">;</span> </pre></div> </div> </div> <div class="section" id="the-backend-health-shift-register"> <h3>The backend health shift register<a class="headerlink" href="#the-backend-health-shift-register" title="Permalink to this headline">¶</a></h3> <p>Backend health probes uses a 64 stage shift register to remember the most recent health probes and to evaluate the total health of the backend.</p> <p>In the CLI, a good backend health status looks like this:</p> <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>varnish> backend.list -p boot.backend Backend name Admin Probe Health Last change boot.backend probe 5/5 healthy Wed, 13 Jan 2021 10:31:50 GMT Current states good: 5 threshold: 4 window: 5 Average response time of good probes: 0.000793 Oldest ================================================== Newest 4444444444444444444444444444444444444444444444444444444444444444 Good IPv4 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Good Xmit RRRRRRRRRRRRRRRRRRRRRRR----RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR Good Recv HHHHHHHHHHHHHHHHHHHHHHH--------HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH Happy </pre></div> </div> <p>Starting from the bottom, the last line shows that this backend has been declared “Happy” for most the 64 health probes, but there were some trouble some while ago.</p> <p>However, in this case the <code class="docutils literal notranslate"><span class="pre">.window</span></code> is configured to five, and the <code class="docutils literal notranslate"><span class="pre">.threshold</span></code> is set to four, so at this point in time, the backend is considered fully healthy.</p> <p>An additional <code class="docutils literal notranslate"><span class="pre">.initial</span></code> fills that many “happy” entries in the shift register when the VCL is loaded, so that backends can quickly become healthy, even if their health is normally considered over many samples:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">.</span><span class="n">interval</span> <span class="o">=</span> <span class="mi">1</span><span class="n">s</span><span class="p">;</span> <span class="o">.</span><span class="n">window</span> <span class="o">=</span> <span class="mi">60</span><span class="p">;</span> <span class="o">.</span><span class="n">threshold</span> <span class="o">=</span> <span class="mi">45</span><span class="p">;</span> <span class="o">.</span><span class="n">initial</span> <span class="o">=</span> <span class="mi">43</span><span class="p">;</span> </pre></div> </div> <p>This backend will be considered healthy if three out of four health probes in the last minute were good, but it becomes healthy as soon as two good probes have happened after the VCL was loaded.</p> <p>The default values are:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">.window</span></code> = 8</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">.threshold</span></code> = 3</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">.initial</span></code> = one less than <code class="docutils literal notranslate"><span class="pre">.threshold</span></code></p></li> </ul> <p>Note that the default <code class="docutils literal notranslate"><span class="pre">.initial</span></code> means that the backend will be marked unhealthy until the first probe response come back successful. This means that for backends created on demand (by vmods) cannot use the default value for <code class="docutils literal notranslate"><span class="pre">.initial</span></code>, as the freshly created backend would very likely still be unhealthy when the backend request happens.</p> <div class="section" id="see-also"> <h4>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h4> <ul class="simple"> <li><p><a class="reference internal" href="varnishd.html#varnishd-1"><span class="std std-ref">varnishd</span></a></p></li> <li><p><a class="reference internal" href="vcl.html#vcl-7"><span class="std std-ref">VCL</span></a></p></li> <li><p><a class="reference internal" href="vcl-backend.html#vcl-backend-7"><span class="std std-ref">VCL-backends</span></a></p></li> <li><p><a class="reference internal" href="vmod_directors.html#vmod-directors-3"><span class="std std-ref">VMOD directors - Varnish Directors Module</span></a></p></li> <li><p><a class="reference internal" href="vmod_std.html#vmod-std-3"><span class="std std-ref">VMOD std - Varnish Standard Module</span></a></p></li> </ul> </div> <div class="section" id="history"> <h4>HISTORY<a class="headerlink" href="#history" title="Permalink to this headline">¶</a></h4> <p>VCL was developed by Poul-Henning Kamp in cooperation with Verdens Gang AS, Redpill Linpro and Varnish Software. This manual page is written by Per Buer, Poul-Henning Kamp, Martin Blix Grydeland, Kristian Lyngstøl, Lasse Karstensen and others.</p> </div> <div class="section" id="copyright"> <h4>COPYRIGHT<a class="headerlink" href="#copyright" title="Permalink to this headline">¶</a></h4> <p>This document is licensed under the same license as Varnish itself. See LICENSE for details.</p> <ul class="simple"> <li><p>Copyright (c) 2006 Verdens Gang AS</p></li> <li><p>Copyright (c) 2006-2021 Varnish Software AS</p></li> </ul> </div> </div> </div> </div> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="../index.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">VCL-probe</a><ul> <li><a class="reference internal" href="#configuring-backend-health-probes">Configuring Backend Health Probes</a><ul> <li><a class="reference internal" href="#backend-health-probes">Backend health probes</a></li> <li><a class="reference internal" href="#attribute-url">Attribute <code class="docutils literal notranslate"><span class="pre">.url</span></code></a></li> <li><a class="reference internal" href="#attribute-request">Attribute <code class="docutils literal notranslate"><span class="pre">.request</span></code></a></li> <li><a class="reference internal" href="#attribute-expected-response">Attribute <code class="docutils literal notranslate"><span class="pre">.expected_response</span></code></a></li> <li><a class="reference internal" href="#attribute-timeout">Attribute <code class="docutils literal notranslate"><span class="pre">.timeout</span></code></a></li> <li><a class="reference internal" href="#attribute-interval">Attribute <code class="docutils literal notranslate"><span class="pre">.interval</span></code></a></li> <li><a class="reference internal" href="#the-backend-health-shift-register">The backend health shift register</a><ul> <li><a class="reference internal" href="#see-also">SEE ALSO</a></li> <li><a class="reference internal" href="#history">HISTORY</a></li> <li><a class="reference internal" href="#copyright">COPYRIGHT</a></li> </ul> </li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="vcl-backend.html" title="previous chapter">VCL-backends</a></p> <h4>Next topic</h4> <p class="topless"><a href="states.html" title="next chapter">Varnish Processing States</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../_sources/reference/vcl-probe.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="../search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" /> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="states.html" title="Varnish Processing States" >next</a> |</li> <li class="right" > <a href="vcl-backend.html" title="VCL-backends" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">Varnish version 7.1.1 documentation</a> »</li> <li class="nav-item nav-item-1"><a href="index.html" >The Varnish Reference Manual</a> »</li> <li class="nav-item nav-item-this"><a href="">VCL-probe</a></li> </ul> </div> <div class="footer" role="contentinfo"> © Copyright 2010-2014, Varnish Software AS. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.4.3. </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.1 |
proxy
|
phpinfo
|
Settings