1VARNISHD(1) BSD General Commands Manual VARNISHD(1)
2
4 varnishd — HTTP accelerator daemon
5
7 varnishd [-a address[:port]] [-b host[:port]] [-d] [-F] [-f config]
8 [-g group] [-h type[,options]] [-n name] [-P file]
9 [-p param=value] [-s type[,options]] [-T address[:port]]
10 [-t ttl] [-u user] [-V] [-w min[,max[,timeout]]]
11
13 The varnishd daemon accepts HTTP requests from clients, passes them on to
14 a backend server and caches the returned documents to better satisfy
15 future requests for the same document.
16
17 The following options are available:
18
19 -a address[:port]
20 Listen for client requests on the specified address and port.
21 The address can be a host name (“localhost”), an IPv4 dotted-
22 quad (“127.0.0.1”), or an IPv6 address enclosed in square
23 brackets (“[::1]”). If address is not specified, varnishd
24 will listen on all available IPv4 and IPv6 interfaces. If
25 port is not specified, the default HTTP port as listed in
26 /etc/services is used.
27
28 -b host[:port]
29 Use the specified host as backend server. If port is not
30 specified, the default is 8080.
31
32 -d Enables debugging mode. This causes varnishd to fork; the
33 child process daemonizes and runs as usual, while the parent
34 process remains attached to the console and will accept man‐
35 agement commands from stdin. If the parent process receives
36 EOF, it will terminate, but the child process will continue
37 to run.
38
39 The child process will not start accepting client connections
40 until the start command is given.
41
42 If the -d flag is specified twice, the child process will not
43 daemonize, and terminating the parent process will also ter‐
44 minate the child.
45
46 -F Run in the foreground.
47
48 -f config Use the specified VCL configuration file instead of the
49 builtin default. See vcl(7) for details on VCL syntax.
50
51 -g group Specifies the name of an unprivileged group to which the
52 child process should switch before it starts accepting con‐
53 nections. This is a shortcut for specifying the group run-
54 time parameter.
55
56 -h type[,options]
57 Specifies the hash algorithm. See Hash Algorithms for a list
58 of supported algorithms.
59
60 -n Specify a name for this instance. Amonst other things, this
61 name is used to construct the name of the directory in which
62 varnishd keeps temporary files and persistent state. If the
63 specified name begins with a forward slash, it is interpreted
64 as the absolute path to the directory which should be used
65 for this purpose.
66
67 -P file Write the process's PID to the specified file.
68
69 -p param=value
70 Set the parameter specified by param to the specified value.
71 See Run-Time Parameters for a list of parameters.
72
73 -s type[,options]
74 Use the specified storage backend. See Storage Types for a
75 list of supported storage types.
76
77 -T address[:port]
78 Offer a management interface on the specified address and
79 port. See Management Interface for a list of management com‐
80 mands.
81
82 -t ttl Specifies a hard minimum time to live for cached documents.
83 This is a shortcut for specifying the default_ttl run-time
84 parameter.
85
86 -u user Specifies the name of an unprivileged user to which the child
87 process should switch before it starts accepting connections.
88 This is a shortcut for specifying the user run-time parame‐
89 ter.
90
91 If specifying both a user and a group, the user should be
92 specified first.
93
94 -V Display the version number and exit.
95
96 -w min[,max[,timeout]]
97 Start at least min but no more than max worker threads with
98 the specified idle timeout. This is a shortcut for specify‐
99 ing the thread_pool_min, thread_pool_max and
100 thread_pool_timeout run-time parameters.
101
102 If only one number is specified, thread_pool_min and
103 thread_pool_max are both set to this number, and
104 thread_pool_timeout has no effect.
105
106 Hash Algorithms
107 The following hash algorithms are available:
108
109 simple_list
110 A simple doubly-linked list. Not recommended for production use.
111
112 classic[,buckets]
113 A standard hash table. This is the default.
114
115 The hash key is the CRC32 of the object's URL modulo the size of
116 the hash table. Each table entry points to a list of elements
117 which share the same hash key.
118
119 The buckets parameter specifies the number of entries in the hash
120 table. The default is 16383.
121
122 Storage Types
123 The following storage types are available:
124
125 malloc
126 Storage for each object is allocated with malloc(3). Not recom‐
127 mended for production use.
128
129 file[,path[,size]]
130 Storage for each object is allocated from an arena backed by a
131 file. This is the default.
132
133 The path parameter specifies either the path to the backing file or
134 the path to a directory in which varnishd will create the backing
135 file. The default is /tmp.
136
137 The size parameter specifies the size of the backing file. The
138 size is assumed to be in bytes, unless followed by one of the fol‐
139 lowing suffixes:
140
141 K, k The size is expressed in kibibytes.
142
143 M, m The size is expressed in mebibytes.
144
145 G, g The size is expressed in gibibytes.
146
147 T, t The size is expressed in tebibytes.
148
149 % The size is expressed as a percentage of the free space on
150 the file system where it resides.
151
152 The default size is 50%.
153
154 If the backing file already exists, it will be truncated or
155 expanded to the specified size.
156
157 Note that if varnishd has to create or expand the file, it will not
158 pre-allocate the added space, leading to fragmentation, which may
159 adversely impact performance. Pre-creating the storage file using
160 dd(1) will reduce fragmentation to a minimum.
161
162 Management Interface
163 If the -T option was specified, varnishd will offer a command-line man‐
164 agement interface on the specified address and port. The following com‐
165 mands are available:
166
167 dump.pool
168
169 help Display a list of available commands.
170
171 param.set param value
172 Set the parameter specified by param to the specified value. See
173 Run-Time Parameters for a list of parameters.
174
175 param.show param
176 Display the value of the parameter specified by param. See
177 Run-Time Parameters for a list of parameters.
178
179 param.show [-l]
180 Display a list of run-time parameters and their values. If the -l
181 option is specified, the list includes a brief explanation of each
182 parameter.
183
184 ping [timestamp]
185 Ping the child process.
186
187 start
188 Start the child process if it is not already running.
189
190 stats
191 Display server statistics. All the numbers presented are totals
192 since server startup; for a better idea of the current situation,
193 use the varnishstat(1) utility.
194
195 status
196 Check the status of the child process.
197
198 stop Stop the child process.
199
200 url.purge regexp
201 Immediately invalidate all documents whos URL matches the specified
202 regular expression.
203
204 vcl.discard configname
205 Discard the configuration specified by configname. This will have
206 no effect if the specified configuration has a non-zero reference
207 count.
208
209 vcl.inline configname vcl
210 Create a new configuration named configname with the VCL code spec‐
211 ified by vcl, which must be a quoted string.
212
213 vcl.list
214 List available configurations and their respective reference
215 counts. The active configuration is indicated with an asterisk
216 ("*").
217
218 vcl.load configname filename
219 Create a new configuration named configname with the contents of
220 the specified file.
221
222 vcl.show configname
223 Display the source code for the specified configuration.
224
225 vcl.use configname
226 Start using the configuration specified by configname for all new
227 requests. Existing requests will continue using whichever configu‐
228 ration was in use when they arrived.
229
230 Run-Time Parameters
231 auto_restart
232 Whether to automatically restart the child process if it dies.
233
234 The default is on.
235
236 backend_http11
237 Whether to force the use of HTTP/1.1 when requesting documents from
238 the server, or just use the same protocol version as the client
239 which triggered the retrieval.
240
241 The default is off.
242
243 client_http11
244 Whether to force the use of HTTP/1.1 when responding to client
245 requests, or just use the same protocol version as that used by the
246 backend server which delivered the requested document.
247
248 The default is off.
249
250 default_ttl
251 The default time-to-live assigned to objects if neither the backend
252 nor the configuration assign one. Note that changes to this param‐
253 eter are not applied retroactively.
254
255 The default is 120 seconds.
256
257 fetch_chunksize
258 The default chunk size used when retrieving documents for which the
259 backend server does not specify a content length.
260
261 The default is 128 kilobytes.
262
263 group
264 The name of an unprivileged group to which the child process should
265 switch before it starts accepting connections. Note that setting
266 user will automatically set group to the primary group of the spec‐
267 ified user, so if both user and group are specified, the latter
268 should be specified last.
269
270 The default is "nogroup".
271
272 http_workspace
273 The size of the per-session workspace for HTTP protocol data. For
274 performance reasons, this space is preallocated, so any change to
275 this parameter will only apply to new client sessions.
276
277 The default is 8192 bytes.
278
279 listen_address
280 The address at which to listen for client connections. Changes to
281 this parameter will only take effect when the child process is
282 restarted.
283
284 The default is 0.0.0.0:80.
285
286 listen_depth
287 The depth of the TCP listen queue.
288
289 The default is 512.
290
291 overflow_max
292 The maximum depth of the overflow queue as a percentage of
293 thread_pool_max. The overflow queue holds requests waiting for a
294 worker thread to become available. If the overflow queue fills up,
295 varnishd will start dropping new connections.
296
297 The default is 100%.
298
299 ping_interval
300 The interval at which the parent process will ping the child
301 process to ascertain that it is still present and functioning.
302
303 The default is 3 seconds.
304
305 pipe_timeout
306 The time to wait before dropping an idle pipe mode connection.
307
308 The default is 60 seconds.
309
310 sendfile_threshold
311 The size threshold beyond which documents are sent to the client
312 using sendfile(2) instead of writev(2). This is not likely to have
313 any effect unless the working set is too large to fit in physical
314 memory.
315
316 Note that several operating systems have known bugs which make it
317 inadvisable to use this.
318
319 The default is -1, which disables the use of sendfile altogether.
320
321 send_timeout
322 The time to wait before dropping the connection to a client which
323 is not accepting data sent to it.
324
325 The default is 600 seconds.
326
327 sess_timeout
328 The time to wait before dropping an idle client session.
329
330 The default is 5 seconds.
331
332 srcaddr_hash
333 The size of the hash table used to store per-client accounting
334 data. This should preferably be a prime number.
335
336 The default is 1049.
337
338 srcaddr_ttl
339 The length of time to keep per-client accounting records. Setting
340 this to 0 will disable per-client accounting.
341
342 thread_pool_max
343 The maximum total number of worker threads. If the number of con‐
344 current requests rises beyond this number, requests will start
345 queueing up waiting for a worker thread to pick them up. Higher
346 values may improve response time but will increase pressure on the
347 scheduler.
348
349 The default is 1000.
350
351 thread_pool_min
352 The minimum total number of worker threads. Higher values may
353 allow varnishd to respond faster to a sudden increase in traffic.
354
355 The default is 1.
356
357 thread_pools
358 The number of worker thread pools. Higher values reduce lock con‐
359 tention but increase pressure on the scheduler. Note that a
360 decrease of this parameter will only take effect after a restart.
361
362 The default is 1.
363
364 thread_pool_timeout
365 The amount of time a worker thread can be idle before it is killed,
366 when the number of worker threads exceeds thread_pool_min.
367
368 The default is 120 seconds.
369
370 user The name of an unprivileged user to which the child process should
371 switch before it starts accepting connections. Note that setting
372 user will automatically set group to the primary group of the spec‐
373 ified user, so if both user and group are specified, the latter
374 should be specified last.
375
376 The default is "nobody".
377
378 vcl_trace
379 Whether to issue log entries for calls to VCL code and their
380 results. Note that this will generate large amounts of log data.
381
382 The default is off.
383
385 varnishlog(1), varnishhist(1), varnishncsa(1), varnishstat(1),
386 varnishtop(1), vcl(7)
387
389 The varnishd daemon was developed by Poul-Henning Kamp
390 <phk@phk.freebsd.dk> in cooperation with Verdens Gang AS and Linpro AS.
391 This manual page was written by Dag-Erling Smørgrav <des@linpro.no>.
392
393BSD July 5, 2007 BSD