Commit 1ab1291c authored by Nils Goroll's avatar Nils Goroll

update README based on master README.40.rst

parent 39042bb7
...@@ -8,7 +8,7 @@ Varnish Consistent Hashing Director Module ...@@ -8,7 +8,7 @@ Varnish Consistent Hashing Director Module
:Author: Julian Wiesener :Author: Julian Wiesener
:Date: 2014-07-16 :Date: 2014-07-16
:Version: 1.0 :Version: 1.1
:Manual section: 3 :Manual section: 3
.. _synopsis: .. _synopsis:
...@@ -109,8 +109,11 @@ Exception To the Rule) ;-) http://varnish-cache.org/wiki/VTLA ...@@ -109,8 +109,11 @@ Exception To the Rule) ;-) http://varnish-cache.org/wiki/VTLA
FUNCTIONS FUNCTIONS
========= =========
_Note_ The vmod functions differ for varnish 4.0 and 4.1. This is the
documentation for the varnish 4.0 interface.
VSLP needs to be configured before it can hand out backends. The functions not VSLP needs to be configured before it can hand out backends. The functions not
returning a backend, should only be called in vcl_init, as we can safely skip returning a backend should only be called in vcl_init, as we can safely skip
locking for most parts of the code, if we do not modify the hash ring after locking for most parts of the code, if we do not modify the hash ring after
initialization. initialization.
...@@ -121,9 +124,9 @@ Adds a backend to the Director, must be called in before init_hashcircle(). ...@@ -121,9 +124,9 @@ Adds a backend to the Director, must be called in before init_hashcircle().
VOID .set_rampup_ratio(REAL) VOID .set_rampup_ratio(REAL)
---------------------------- ----------------------------
Sets the raito of requests (0.0 to 1.0) that goes to the next alternate backend Sets the ratio of requests (0.0 to 1.0) that goes to the next alternate backend
to warm it up if the preferd backend is healthy. If the prefered backend just to warm it up when the preferd backend is healthy. If the preferred backend just
recoverd from beeing unhealthy, the ratio will be used to warm the prefered recovered from being unhealthy, the ratio will be used to warm the preferred
backend. Defaults to 0.1 (10%). backend. Defaults to 0.1 (10%).
VOID .set_rampup_time(DURATION) VOID .set_rampup_time(DURATION)
...@@ -159,17 +162,23 @@ BACKEND .backend() ...@@ -159,17 +162,23 @@ BACKEND .backend()
Returns a backend based on the default hash of the request URL. Returns a backend based on the default hash of the request URL.
BACKEND .backend_n(INT, BOOL, BOOL, INT) BACKEND .backend_n(INT, BOOL, BOOL, INT)
---------------------------- ----------------------------------------
Returns the n-th backend (first parameter) with respect of altsrv_p (second Returns the n-th backend (first parameter) with respect of altsrv_p
parameter) and respect of its healthy state (third parameter) for the given (second parameter) and respect of its healthy state (third parameter)
hash (last parameter). for the given hash (last parameter).
BACKEND .backend_by_int(INT) BACKEND .backend_by_int(INT)
---------------------------- ----------------------------
Returns a backend based on the value of its parameter. The value should be Returns a backend based on the value of its parameter. The value
evenly distributet between 0 and MAX_INT to get a good distribution of requests. should be evenly distributed between 0 and MAX_INT to get a good
distribution of requests.
Example: To select a backend from director `vd` based on a string
value hashed with `SHA256`, use::
vd.backend_by_int(vd.hash_string("some_string", SHA256))
BACKEND .backend_by_string(STRING) BACKEND .backend_by_string(STRING)
---------------------------------- ----------------------------------
...@@ -224,6 +233,18 @@ Make targets: ...@@ -224,6 +233,18 @@ Make targets:
* make check - runs the unit tests in ``src/tests/*.vtc`` * make check - runs the unit tests in ``src/tests/*.vtc``
* make distcheck - run check and prepare a tarball of the vmod. * make distcheck - run check and prepare a tarball of the vmod.
Installation directories
------------------------
By default, the vmod ``configure`` script installs the built vmod in
the same directory as Varnish, determined via ``pkg-config(1)``. The
vmod installation directory can be overridden by passing the
``VMOD_DIR`` variable to ``configure``.
Other files like man-pages and documentation are installed in the
locations determined by ``configure``, which inherits its default
``--prefix`` setting from Varnish.
MISSING MISSING
======= =======
...@@ -247,5 +268,4 @@ COPYRIGHT ...@@ -247,5 +268,4 @@ COPYRIGHT
This document is licensed under the same license as the This document is licensed under the same license as the
libvmod-vslp project. See LICENSE for details. libvmod-vslp project. See LICENSE for details.
Copyright (c) 2013-2015 UPLEX Nils Goroll Systemoptimierung. All rights Copyright 2013-2015 UPLEX Nils Goroll Systemoptimierung. All rights reserved.
reserved.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment