Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
32530b5c
Unverified
Commit
32530b5c
authored
May 12, 2020
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document connection pooling
Closes #3312 (probably)
parent
8f3f5b57
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
1 deletion
+38
-1
VSC_vbe.vsc
bin/varnishd/VSC_vbe.vsc
+6
-1
vcl-backends.rst
doc/sphinx/users-guide/vcl-backends.rst
+32
-0
No files found.
bin/varnishd/VSC_vbe.vsc
View file @
32530b5c
...
...
@@ -71,7 +71,12 @@
.. varnish_vsc:: conn
:type: gauge
:level: info
:oneliner: Concurrent connections to backend
:oneliner: Concurrent connections used
The number of currently used connections to the backend. This
number is always less or equal to the number of connections to
the backend (as, for example shown as ESTABLISHED for TCP
onnections in netstat) due to connection pooling.
.. varnish_vsc:: req
:type: counter
...
...
doc/sphinx/users-guide/vcl-backends.rst
View file @
32530b5c
...
...
@@ -219,3 +219,35 @@ VCLs. Varnish will coalesce probes that seem identical - so be careful
not to change the probe config if you do a lot of VCL loading. Unloading
the VCL will discard the probes. For more information on how to do this
please see ref:`reference-vcl-director`.
.. _users-guide-advanced_backend_connection-pooling:
Connection Pooling
------------------
Opening connections to backends always comes at a cost: Depending on
the type of connection and backend infrastructure, the overhead for
opening a new connection ranges from pretty low for a local Unix
domain socket (see :ref:`backend_definition` ``.path`` attribute) to
substantial for establishing possibly multiple TCP and/or TLS
connections over possibly multiple hops and long network
paths. However relevant the overhead, it certainly always exists.
So because re-using existing connections can generally be considered
to reduce overhead and latencies, Varnish pools backend connections by
default: Whenever a backend task is finished, the used connection is
not closed but rather added to a pool for later reuse. To avoid a
connection from being reused, the ``Connection: close`` http header
can be added in :ref:`vcl_backend_fetch`.
While backends are defined per VCL, connection pooling works across
VCLs and even across backends: By default, the identifier for pooled
connections is constructed from the ``.host``\ /\ ``.port`` or
``.path`` attributes of the :ref:`backend_definition` (VMODs can make
use of custom identifiers). So whenever two backends share the same
address information, irrespective of which VCLs they are defined in,
their connections are taken from a common pool.
If not actively closed by the backend, pooled connections are kept
open by Varnish until the :ref:`ref_param_backend_idle_timeout`
expires.
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