aboutsummaryrefslogtreecommitdiff
path: root/src/vmod-tbf.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/vmod-tbf.3')
-rw-r--r--src/vmod-tbf.332
1 files changed, 21 insertions, 11 deletions
diff --git a/src/vmod-tbf.3 b/src/vmod-tbf.3
index cf12ea7..bd7b233 100644
--- a/src/vmod-tbf.3
+++ b/src/vmod-tbf.3
@@ -13,13 +13,13 @@
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>. 15.\" along with vmod-tbf. If not, see <http://www.gnu.org/licenses/>.
16.TH VMOD-TBF 1 "July 23, 2013" "VMOD-TBF" "User Reference" 16.TH VMOD-TBF 1 "August 2, 2013" "VMOD-TBF" "User Reference"
17.SH NAME 17.SH NAME
18vmod-tbf \- token bucket filtering for Varnish 18vmod-tbf \- token bucket filtering for Varnish
19.SH SYNOPSIS 19.SH SYNOPSIS
20.B import tbf; 20.B import tbf;
21 21
22.BI "VOID tbf.open(STRING " dbfile ", STRING " params ");" 22.BI "VOID tbf.open(STRING " dbdir ", STRING " params ");"
23 23
24.B VOID tbf.close(); 24.B VOID tbf.close();
25 25
@@ -108,13 +108,17 @@ sub vcl_recv {
108.EE 108.EE
109.SS Storage 109.SS Storage
110.PP 110.PP
111Buckets are kept in a Berkeley DB file. The \fBtbf.open\fR function 111Buckets are kept in a Berkeley database file. The \fBtbf.open\fR function
112controls its location and permissions. The \fBdbfile\fR argument 112controls its location and permissions. The \fBdbdir\fR argument
113supplies the full pathname to the file. The \fBparams\fR argument is 113supplies the full pathname to the directory where the database is
114a semicolon separated list of the following parameters: 114located. The \fBparams\fR argument is a semicolon separated list of
115the following parameters:
116.TP
117.BI dbname= NAME
118Sets the name of the database file. Default is \fBtbf.bdb\fR.
115.TP 119.TP
116.BR truncate " or " trunc 120.BR truncate " or " trunc
117Truncate the file if it already exists. 121Truncate the database if it already exists.
118.TP 122.TP
119.BI mode= OCT 123.BI mode= OCT
120Set the file mode. \fIOCT\fR is an octal number. The default file 124Set the file mode. \fIOCT\fR is an octal number. The default file
@@ -141,10 +145,16 @@ Note that the directory where the database file is located must be
141writable for the user \fBVarnish\fR runs as. 145writable for the user \fBVarnish\fR runs as.
142.PP 146.PP
143Unless the \fBtbf.open\fR function was called, both \fBtbf.rate\fR and 147Unless the \fBtbf.open\fR function was called, both \fBtbf.rate\fR and
144\fBtbf.check\fR will attempt to use the file \fIlocalstatedir\fB/tbf.db\fR, 148\fBtbf.check\fR will attempt to use the database located in
145where \fIlocalstatedir\fR is the directory for modifiable 149\fIlocalstatedir\fB/vmod-tbf\fR, where \fIlocalstatedir\fR is the
146single-machine data, which is set when configuring the package 150directory for modifiable single-machine data, which is set when
147(e.g. \fB/var/run/tbf\fR or the like). 151configuring the package (e.g. \fB/var/run\fR or the like).
152.PP
153If the database directory does not exist, \fBtbf.open\fR will attempt
154to create it, deducing its mode from the database file mode (see the
155\fBmode=\fR parameter above) by setting executable
156bit in each triplet that has read or write bit set (e.g. \fB640\fR
157will become \fB750\fR).
148.PP 158.PP
149The \fBtbf.close\fR function flushes the data and closes the database. 159The \fBtbf.close\fR function flushes the data and closes the database.
150It is normally called from the \fBvcl_fini\fR subroutine: 160It is normally called from the \fBvcl_fini\fR subroutine:

Return to:

Send suggestions and report system problems to the System administrator.