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
6f7944c0
Commit
6f7944c0
authored
Aug 31, 2011
by
Kristian Lyngstol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document various director retry-mechanisms
parent
b33301f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
31 deletions
+51
-31
vcl.rst
doc/sphinx/reference/vcl.rst
+51
-31
No files found.
doc/sphinx/reference/vcl.rst
View file @
6f7944c0
...
...
@@ -148,58 +148,69 @@ Configuring a director may look like this:::
}
}
The random director
~~~~~~~~~~~~~~~~~~~
The random director takes one per director option .retries. This
specifies how many tries it will use to find a working backend. The
default is the same as the number of backends defined for the
director.
There is also a per-backend option: weight which defines the portion
of traffic to send to the particular backend.
The round-robin director
~~~~~~~~~~~~~~~~~~~~~~~~
The family of random directors
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are three directors that share the same logic, called the random
director, client director and hash director. They each distribute traffic
among the backends assigned to it using a random distribution seeded with
either the client identity, a random number or the cache hash (typically
url). Beyond the initial seed, they act the same.
Each backend requires a .weight option which sets the amount of traffic
each backend will get compared to the others. Equal weight means equal
traffic. A backend with lower weight than an other will get proportionally
less traffic.
The director has an optional .retries option which defaults to the number
of backends the director has. The director will attempt .retries times to
find a healthy backend if the first attempt fails. Each attempt re-uses the
previous seed in an iterative manner. For the random director this detail
is of no importance as it will give different results each time. For the
hash and client director, this means the same URL or the same client will
fail to the same server consistently.
The round-robin director does not take any options.
The random director
...................
This uses a random number to seed the backend selection.
The client director
~~~~~~~~~~~~~~~~~~~
...................
The client director picks a backend based on the clients
*identity*. You can set the VCL variable *client.identity* to identify
the client by picking up the value of a session cookie or similar.
Note: from 2.1.0 to 2.1.3 *client.identity* isn't available and the
director will use automatically set the idenity based on client.ip In
2.1.4 and onwards you can set client.identity to any string available.
The client director takes one option - *retries* which set the number
of retries the director should take in order to find a healthy
backend.
The hash director
~~~~~~~~~~~~~~~~~
.................
The hash director will pick a backend based on the URL hash
value.
value.
This is useful is you are using Varnish to load balance in front of
other Varnish caches or other web accelerators as objects won't be
duplicated across caches.
The client director takes one option - *retries* which set the number
of retries the director should take in order to find a healthy
backend.
It will use the value of req.hash, just as the normal cache-lookup methods.
The round-robin director
~~~~~~~~~~~~~~~~~~~~~~~~
The round-robin director does not take any options.
It will use the first backend for the first request, the second backend for
the second request and so on, and start from the top again when it gets to
the end.
If a backend is unhealthy or Varnish fails to connect, it will be skipped.
The round-robin director will try all the backends once before giving up.
The DNS director
~~~~~~~~~~~~~~~~
The DNS director can use backends in t
hree
different ways. Either like the
The DNS director can use backends in t
wo
different ways. Either like the
random or round-robin director or using .list::
director directorname dns {
...
...
@@ -216,6 +227,9 @@ random or round-robin director or using .list::
This will specify 384 backends, all using port 80 and a connection timeout
of 0.4s. Options must come before the list of IPs in the .list statement.
The .list-method does not support IPv6. It is not a white-list, it is an
actual list of backends that will be created internally in Varnish - the
larger subnet the more overhead.
The .ttl defines the cache duration of the DNS lookups.
...
...
@@ -223,6 +237,12 @@ The above example will append "internal.example.net" to the incoming Host
header supplied by the client, before looking it up. All settings are
optional.
Health checks are not thoroughly supported.
DNS round robin balancing is supported. If a hostname resolves to multiple
backends, the director will divide the traffic between all of them in a
round-robin manner.
The fallback director
~~~~~~~~~~~~~~~~~~~~~
...
...
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