aboutsummaryrefslogtreecommitdiff
path: root/README
blob: b862c1b9f753be364efc03fef80f9928b192ae88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
Vmod-tbf README
See the end of file for copying conditions.

* Introduction

This file contains brief information about configuring, testing
and using vmod-tbf. It is *not* intended as a replacement
for the documentation, and is provided as a brief reference only.
For accessing complete vmod-tbf documentation, see the section
'Documentation' below.

* Overview

This module implements token bucket filtering for Varnish Cache.
Token bucket filtering (TBF) allows for controlling the rate of
data traffic.  The following example illustrates the use of
this module in VCL script:

    import tbf;
    
    sub vcl_recv {
        if (!tbf.check(client.ip, "10 req/1s")) {
            error 429 "Request rate exceeded."
	}
    }

This will keep the incoming HTTP traffic at the rate of 10 requests
per second.

Additionally, this module provides several auxiliary functions for
checking load average of the machine, getting system time, formatting
UNIX timestamps in human-readable form, etc.

The module works with Varnish versions from 4.1 to 6.0.2.

* Installation

In order to compile the package you need to have the
varnishd and varnishapi packages installed.

Supposing that condition is met, run:

  ./configure

It should be able to automatically find the necessary components. In case 
it doesn't, tweak the configuration variables as necessary. The most 
important one is PKG_CONFIG_PATH, which contains a path (in the UNIX sense)
where the .pc files are located. It should contain a directory where the
'varnishapi.pc' file lives. Example usage:

  ./configure PKG_CONFIG_PATH=/usr/local/varnish/lib/pkgconfig:$PKG_CONFIG_PATH

Please read the file INSTALL for a detailed discussion of available variables
and command line options.

Once configured, do

  make

This will build the module.  After this step you can optionally run
'make test' to test the package.

Finally, run the following command as root:

  make install
  
* Documentation

The manual page vmod-tbf(3) will be available after successful install.
To read it without actually installing the module, run
`man src/vmod-tbf.3'.

An online copy of the documentation is available from
http://www.gnu.org.ua/software/vmod-tbf.

* Bug reporting

Send bug reports and suggestions to <gray@gnu.org>


* Copyright information:

Copyright (C) 2013-2018 Sergey Poznyakoff

   Permission is granted to anyone to make or distribute verbatim copies
   of this document as received, in any medium, provided that the
   copyright notice and this permission notice are preserved,
   thus giving the recipient permission to redistribute in turn.

   Permission is granted to distribute modified versions
   of this document, or of portions of it,
   under the above conditions, provided also that they
   carry prominent notices stating who last changed them.


Local Variables:
mode: outline
paragraph-separate: "[ 	]*$"
version-control: never
End:
  

Return to:

Send suggestions and report system problems to the System administrator.