..
.. NB: This file is machine generated, DO NOT EDIT!
..
.. Edit vmod.vcc and run make instead
..
.. role:: ref(emphasis)
.. _vmod_directors(3):
==============
vmod_directors
==============
------------------------
Varnish Directors Module
------------------------
:Manual section: 3
SYNOPSIS
========
import directors [from "path"] ;
DESCRIPTION
===========
`vmod_directors` enables backend load balancing in Varnish.
The module implements a set of basic load balancing techniques, and
also serves as an example on how one could extend the load balancing
capabilities of Varnish.
To enable load balancing you must import this vmod (directors).
Then you define your backends. Once you have the backends declared you
can add them to a director. This happens in executed VCL code. If you
want to emulate the previous behavior of Varnish 3.0 you can just
initialize the directors in vcl_init, like this::
sub vcl_init {
new vdir = directors.round_robin();
vdir.add_backend(backend1);
vdir.add_backend(backend2);
}
As you can see there is nothing keeping you from manipulating the
directors elsewhere in VCL. So, you could have VCL code that would
add more backends to a director when a certain URL is called.
Note that directors can use other directors as backends.
CONTENTS
========
* :ref:`obj_fallback`
* :ref:`func_fallback.add_backend`
* :ref:`func_fallback.backend`
* :ref:`func_fallback.remove_backend`
* :ref:`obj_hash`
* :ref:`func_hash.add_backend`
* :ref:`func_hash.backend`
* :ref:`func_hash.remove_backend`
* :ref:`obj_random`
* :ref:`func_random.add_backend`
* :ref:`func_random.backend`
* :ref:`func_random.remove_backend`
* :ref:`obj_round_robin`
* :ref:`func_round_robin.add_backend`
* :ref:`func_round_robin.backend`
* :ref:`func_round_robin.remove_backend`
.. _obj_round_robin:
Object round_robin
==================
Description
Create a round robin director.
This director will pick backends in a round robin fashion.
Example
new vdir = directors.round_robin();
.. _func_round_robin.add_backend:
VOID round_robin.add_backend(BACKEND)
-------------------------------------
Prototype
VOID round_robin.add_backend(BACKEND)
Description
Add a backend to the round-robin director.
Example
vdir.add_backend(backend1);
vdir.add_backend(backend2);
.. _func_round_robin.remove_backend:
VOID round_robin.remove_backend(BACKEND)
----------------------------------------
Prototype
VOID round_robin.remove_backend(BACKEND)
Description
Remove a backend from the round-robin director.
Example
vdir.remove_backend(backend1);
vdir.remove_backend(backend2);
.. _func_round_robin.backend:
BACKEND round_robin.backend()
-----------------------------
Prototype
BACKEND round_robin.backend()
Description
Pick a backend from the director.
Example
set req.backend_hint = vdir.backend();
.. _obj_fallback:
Object fallback
===============
Description
Create a fallback director.
A fallback director will try each of the added backends in turn,
and return the first one that is healthy.
Example
new vdir = directors.fallback();
.. _func_fallback.add_backend:
VOID fallback.add_backend(BACKEND)
----------------------------------
Prototype
VOID fallback.add_backend(BACKEND)
Description
Add a backend to the director.
Note that the order in which this is done matters for the fallback
director.
Example
vdir.add_backend(backend1);
vdir.add_backend(backend2);
.. _func_fallback.remove_backend:
VOID fallback.remove_backend(BACKEND)
-------------------------------------
Prototype
VOID fallback.remove_backend(BACKEND)
Description
Remove a backend from the director.
Example
vdir.remove_backend(backend1);
vdir.remove_backend(backend2);
.. _func_fallback.backend:
BACKEND fallback.backend()
--------------------------
Prototype
BACKEND fallback.backend()
Description
Pick a backend from the director.
Example
set req.backend_hint = vdir.backend();
.. _obj_random:
Object random
=============
Description
Create a random backend director.
The random director distributes load over the backends using
a weighted random probability distribution.
Example
new vdir = directors.random();
.. _func_random.add_backend:
VOID random.add_backend(BACKEND, REAL)
--------------------------------------
Prototype
VOID random.add_backend(BACKEND, REAL)
Description
Add a backend to the director with a given weight.
Each backend backend will receive approximately
100 * (weight / (sum(all_added_weights))) per cent of the traffic sent
to this director.
Example
# 2/3 to backend1, 1/3 to backend2.
vdir.add_backend(backend1, 10.0);
vdir.add_backend(backend2, 5.0);
.. _func_random.remove_backend:
VOID random.remove_backend(BACKEND)
-----------------------------------
Prototype
VOID random.remove_backend(BACKEND)
Description
Remove a backend from the director.
Example
vdir.remove_backend(backend1);
vdir.remove_backend(backend2);
.. _func_random.backend:
BACKEND random.backend()
------------------------
Prototype
BACKEND random.backend()
Description
Pick a backend from the director.
Example
set req.backend_hint = vdir.backend();
.. _obj_hash:
Object hash
===========
Description
Create a hashing backend director.
The director chooses the backend server by computing a hash/digest
of the string given to .backend().
Commonly used with ``client.ip`` or a session cookie to get
sticky sessions.
Example
new vdir = directors.hash();
.. _func_hash.add_backend:
VOID hash.add_backend(BACKEND, REAL)
------------------------------------
Prototype
VOID hash.add_backend(BACKEND, REAL)
Description
Add a backend to the director with a certain weight.
Weight is used as in the random director. Recommended value is
1.0 unless you have special needs.
Example
vdir.add_backend(backend1, 1.0);
vdir.add_backend(backend2, 1.0);
.. _func_hash.remove_backend:
VOID hash.remove_backend(BACKEND)
---------------------------------
Prototype
VOID hash.remove_backend(BACKEND)
Description
Remove a backend from the director.
Example
vdir.remove_backend(backend1);
vdir.remove_backend(backend2);
.. _func_hash.backend:
BACKEND hash.backend(STRING_LIST)
---------------------------------
Prototype
BACKEND hash.backend(STRING_LIST)
Description
Pick a backend from the backend director.
Use the string or list of strings provided to pick the backend.
Example
# pick a backend based on the cookie header from the client
set req.backend_hint = vdir.backend(req.http.cookie);
COPYRIGHT
=========
This document is licensed under the same licence as Varnish
itself. See LICENCE for details.
* Copyright (c) 2013-2015 Varnish Software AS
Henceforth, whatever our philosopher says about Matter will apply to extension and to extension alone. It cannot be apprehended by sight, nor by hearing, nor by smell, nor by taste, for it is neither colour, nor sound, nor odour, nor juice. Neither can it be touched, for it is not a body, but it becomes corporeal on being blended with sensible qualities. And, in a later essay, he describes it as receiving all things and letting them depart again without retaining the slightest trace of their presence.483 Why then, it may be asked, if Plotinus meant extension, could he not say so at once, and save us all this trouble in hunting out his meaning? There were very good reasons why he should not. In the first place, he wished to express himself, so far as possible, in Aristotelian phraseology, and this was incompatible with the reduction of Matter to extension. In the next place, the idea of an infinite void had been already appropriated by the Epicureans, to whose system he was bitterly opposed. And, finally, the extension of ordinary327 experience had not the absolute generality which was needed in order to bring Matter into relation with that ultimate abstraction whence, like everything else, it has now to be derived. That the millionaire was genuine, ¡°in person and not a caricature,¡± as Dick put it, was evident. Both the nurse, his relative, and his wife, were chatting with him as Jeff delivered the heavy packed ball made up of the gum. 233 "I guess not," said Landor, tolerantly, as he turned[Pg 106] his horse over to his orderly; "but, anyway," he added to Ellton, "we had a picnic¡ªof a sort." Si, unable to think of anything better, went with him. The train had stopped on a switch, and seemed likely to rust fast to the rails, from the way other trains were going by in both directions. The bridge gang, under charge of a burly, red-faced young Englishman, was in the rear car, with their tools, equipments, bedding and cooking utensils. THE DEACON HAS SOME EXPERIENCES WITH THE QUADRUPED. "You are not within a mile of the truth. I know it. Look here: I believe that is Gen. Rosecrans's own cow. She's gone, and I got an order to look around for her. I've never seen her, but from the description given me I believe that's she. Who brought her here?" "Deacon, these brothers and sisters who have come here with me to-night are, like myself, deeply interested in the moral condition of the army, where we all have sons or kinsmen. Now, can't you sit right there and tell us of your observations and experiences, as a Christian man and father, from day to day, of every day that you were down there? Tell us everything, just as it happened each day, that we may be able to judge for ourselves." HAS AN ENCOUNTER WITH THE PROVOST-MARSHAL. "Wonder which one o' them is the 200th Injianny's?" said Si to Shorty. "And your mother, and Harry?" The daughter must be the girl who was talking to him now. She sat on a little stool by the fire, and had brought out some sewing. "Over at Grandturzel¡ªcan't see wot's burning from here. Git buckets and come!" These things, however, gave little concern to the worthy who commanded the Kentish division. Tyler, though an excellent blacksmith, possessed few of the qualities requisite for forming a good general. Provided there was no very sensible diminution in the number of his followers, he cared not a straw for the score or two who, after quarrelling, or perhaps fighting, withdrew in such disgust that they vowed rather to pay the full tax for ever than submit to the insolence of the rebels. One man could fight as well as another, reasoned he; and, provided he was obeyed, what mattered it by whom. Dick went and Tom came¡ªit was sure to be all one in the end. But this burst of indignation soon passed away, and upon the suggestion of the prudent Sir Robert Hailes, he sent an evasive answer, with a command that the Commons should attend him at Windsor on the Sunday following. That it was a stratagem to gain entrance to the Tower, was the opinion of several, but, after much discussion, it was decided that the man should be admitted, and that the monk should be exhibited merely to intimidate the rebels, until the result of this promised communication should be known. HoMEŮͬÐÔÁµcbcb
ENTER NUMBET 0017
1688qp.com.cn
www.qfvqn.com.cn
www.gdic.net.cn
nige5.com.cn
www.tv100.com.cn
www.yuanziba.com.cn
www.fenwu1.com.cn
www.zuchi8.com.cn
www.iminii.com.cn
houze1.com.cn