VARNISHD(1) | General Commands Manual | VARNISHD(1) |
varnishd - HTTP accelerator daemon
varnishd [-x parameter|vsl|cli|builtin|optstring]
varnishd [-?]
The varnishd daemon accepts HTTP requests from clients, passes them on to a backend server and caches the returned documents to better satisfy future requests for the same document.
Name is referenced in logs and available to vcl as local.socket. If name is not specified, a with a numerical sequence ("a0", "a1", etc.) is used.
Any arguments after the listen_address separated by comma are taken as either an acceptor option=value pair if containing a =, or as a PROTO(col) selection otherwise.
Valid options depend on the acceptor type, see below.
PROTO can be "HTTP" (the default) or "PROXY". Both version 1 and 2 of the proxy protocol can be used.
Multiple -a arguments are allowed.
If no -a argument is given, the default -a :80 will listen on all IPv4 and IPv6 interfaces.
The port can be a port number (80), a service name (http), or a port range (80-81). Port ranges are inclusive and cannot overlap. If port is not specified, port 80 (http) is used.
At least one of ip_address or port is required.
Accept connections on a Unix domain socket. Path must be absolute ("/path/to/listen.sock") or "@" followed by the name of an abstract socket ("@myvarnishd").
The user, group and mode sub-arguments may be used to specify the permissions of the socket file -- use names for user and group, and a 3-digit octal value for mode. These sub-arguments do not apply to abstract sockets.
If the value of -b begins with /, it is interpreted as the absolute path of a Unix domain socket to which Varnish connects. In that case, the value of -b must satisfy the conditions required for the .path field of a backend declaration, see vcl(7). Backends with Unix socket addresses may only be used with VCL versions >= 4.1.
-b can be used only once, and not together with f.
If a single -f option is used, then the VCL instance loaded from the file is named "boot" and immediately becomes active. If more than one -f option is used, the VCL instances are named "boot0", "boot1" and so forth, in the order corresponding to the -f arguments, and the last one is named "boot", which becomes active.
Either -b or one or more -f options must be specified, but not both, and they cannot both be left out, unless -d is used to start varnishd in debugging mode. If the empty string is specified as the sole -f option, then varnishd starts without starting the worker process, and the management process will accept CLI commands. You can also combine an empty -f option with an initialization script (-I option) and the child process will be started if there is an active VCL at the end of the initialization.
When used with a relative file name, config is searched in the vcl_path. It is possible to set this path prior to using -f options with a -p option. During startup, varnishd doesn't complain about unsafe VCL paths: unlike the varnish-cli(7) that could later be accessed remotely, starting varnishd requires local privileges.
In performance critical applications, this directory should be on a RAM backed filesystem.
The default is taken from the VARNISH_DEFAULT_N environment variable.
Relative paths will be appended to /var/lib/varnish.
If neither VARNISH_DEFAULT_N nor -n are present, the value is /var/lib/varnish/varnishd.
Note: These defaults may be distribution specific.
For these options, varnishd prints information to standard output and exits. When a -x option is used, it must be the only option (it outputs documentation in reStructuredText, aka RST).
-?
The server identity is used for the received-by field of Via headers generated by Varnish. For this reason, it must be a valid token as defined by the HTTP grammar.
If not specified the output of gethostname(3) is used, in which case the syntax is assumed to be correct.
This option can be used multiple times to specify multiple storage files. Name is referenced in logs, VCL, statistics, etc. If name is not specified, "s0", "s1" and so forth is used.
If this argument is not provided, a secret drawn from the system PRNG will be written to a file called _.secret in the working directory (see opt_n) with default ownership and permissions of the user having started varnish.
Thus, users wishing to delegate control over varnish will probably want to create a custom secret file with appropriate permissions (ie. readable by a unix group to delegate control to).
Only one of -d or -F can be specified, and -d cannot be used together with -C.
The following hash algorithms are available:
The argument format to define storage backends is:
For kind and options see details below.
Storages can be used in vcl as storage.name, so, for example if myStorage was defined by -s myStorage=malloc,5G, it could be used in VCL like so:
set beresp.storage = storage.myStorage;
A special name is Transient which is the default storage for uncacheable objects as resulting from a pass, hit-for-miss or hit-for-pass.
If no -s options are given, the default is:
-s default,100m
If no Transient storage is defined, the default is an unbound default storage as if defined as:
-s Transient=default
The following storage types and options are available:
See the section on umem in chapter Storage backends of The Varnish Users Guide for details.
The path is mandatory. If path points to a directory, a temporary file will be created in that directory and immediately unlinked. If path points to a non-existing file, the file will be created.
If size is omitted, and path points to an existing file with a size greater than zero, the size of that file will be used. If not, an error is reported.
Granularity sets the allocation block size. Defaults to the system page size or the filesystem block size, whichever is larger.
Advice tells the kernel how varnishd expects to use this mapped region so that the kernel can choose the appropriate read-ahead and caching techniques. Possible values are normal, random and sequential, corresponding to MADV_NORMAL, MADV_RANDOM and MADV_SEQUENTIAL madvise() advice argument, respectively. Defaults to random.
Varnish jails are a generalization over various platform specific methods to reduce the privileges of varnish processes. They may have specific options. Available jails are:
The optional worker argument can be used to pass a privilege-specification (see ppriv(1)) by which to extend the effective set of the varnish worker process. While extended privileges may be required by custom vmods, not using the worker option is always more secure.
Example to grant basic privileges to the worker process:
-j solaris,worker=basic
With the unix jail mechanism activated, varnish will switch to an alternative user for subprocesses and change the effective uid of the master process whenever possible.
The optional user argument specifies which alternative user to use. It defaults to varnish.
The optional ccgroup argument specifies a group to add to varnish subprocesses requiring access to a c-compiler. There is no default.
The optional workuser argument specifies an alternative user to use for the worker process. It defaults to vcache.
The users given for the user and workuser arguments need to have the same primary ("login") group.
To set up a system for the default users with a group name varnish, shell commands similar to these may be used:
groupadd varnish useradd -g varnish -d /nonexistent -s /bin/false \ -c "Varnish-Cache Daemon User" varnish useradd -g varnish -d /nonexistent -s /bin/false \ -c "Varnish-Cache Worker User" vcache
If the -T option was specified, varnishd will offer a command-line management interface on the specified address and port. The recommended way of connecting to the command-line management interface is through varnishadm(1).
The commands available are documented in varnish-cli(7).
The -I option makes it possible to run arbitrary management commands when varnishd is launched, before the worker process is started. In particular, this is the way to load configurations, apply labels to them, and make a VCL instance active that uses those labels on startup:
vcl.load panic /etc/varnish_panic.vcl vcl.load siteA0 /etc/varnish_siteA.vcl vcl.load siteB0 /etc/varnish_siteB.vcl vcl.load siteC0 /etc/varnish_siteC.vcl vcl.label siteA siteA0 vcl.label siteB siteB0 vcl.label siteC siteC0 vcl.load main /etc/varnish_main.vcl vcl.use main
Every line in the file, including the last line, must be terminated by a newline or carriage return or is otherwise considered truncated, which is a fatal error.
If a command in the file is prefixed with '-', failure will not abort the startup.
Note that it is necessary to include an explicit vcl.use command to select which VCL should be the active VCL when relying on CLI Command File to load the configurations at startup.
Runtime parameters can either be set during startup with the -p command line option for varnishd(1) or through the CLI using the param.set or param.reset commands. They can be locked during startup with the -r command line option.
There are different types of parameters that may accept a list of specific values, or optionally take a unit suffix.
A boolean parameter accepts the values on and off.
It will also recognize the following values:
A bytes parameter requires one of the following units suffixes:
Multiplicator units may be appended with an extra b. For example 32k is equivalent to 32kb. Bytes units are case-insensitive.
A duration parameter may accept the following units suffixes:
If the parameter is a timeout or a deadline, a value of "never" (when allowed) disables the effect of the parameter.
Runtime parameters are marked with shorthand flags to avoid repeating the same text over and over in the table below. The meaning of the flags are:
We have no solid information about good/bad/optimal values for this parameter. Feedback with experience and observations are most welcome.
This parameter can be changed on the fly, but will not take effect immediately.
The worker process must be stopped and restarted, before this parameter takes effect.
The VCL programs must be reloaded for this parameter to take effect.
Do not touch unless you really know what you're doing.
Only works if varnishd is running as root.
Be aware that on 32 bit systems, certain default or maximum values are reduced relative to the values listed below, in order to conserve VM space:
This text is produced from the same text you will find in the CLI if you use the param.show command:
NB: This parameter depends on a feature which is not available on all platforms.
Enable kernel accept-filters. This may require a kernel module to be loaded to have an effect when enabled.
Enabling accept_filter may prevent some requests to reach Varnish in the first place. Malformed requests may go unnoticed and not increase the client_req_400 counter. GET or HEAD requests with a body may be blocked altogether.
If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts. This parameter (multiplicatively) reduce the sleep duration for each successful accept. (ie: 0.9 = reduce by 10%)
If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts. This parameter control how much longer we sleep, each time we fail to accept a new connection.
If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts. This parameter limits how long it can sleep between attempts to accept new connections.
Automatically restart the child/worker process if it dies.
Timeout before we close unused backend connections.
When connecting to backends, certain error codes (EADDRNOTAVAIL, EACCESS, EPERM) signal a local resource shortage or configuration issue for which retrying connection attempts may worsen the situation due to the complexity of the operations involved in the kernel. This parameter prevents repeated connection attempts for the configured duration.
When connecting to backends, certain error codes (ECONNREFUSED, ENETUNREACH) signal fundamental connection issues such as the backend not accepting connections or routing problems for which repeated connection attempts are considered useless This parameter prevents repeated connection attempts for the configured duration.
Maximum number of transactions that can queue waiting for a backend connection to become available. This default of 0 (zero) means that there is no transaction queueing. VCL can override this default value for each backend.
Note that this feature must be used with caution, as it can cause threads to pile up and increase response times.
When a backend has no connections available for a transaction, the transaction can be queued (see backend_wait_limit) to wait for a connection. This is the default time that the transaction will wait before giving up. VCL can override this default value for each backend.
It is strongly advised to never set this higher than a couple of seconds.
Expurge long tail content from the cache to keep the number of bans below this value. 0 disables.
When this parameter is set to a non-zero value, the ban lurker continues to work the ban list as usual top to bottom, but when it reaches the ban_cutoff-th ban, it treats all objects as if they matched a ban and expunges them from cache. As actively used objects get tested against the ban list at request time and thus are likely to be associated with bans near the top of the ban list, with ban_cutoff, least recently accessed objects (the "long tail") are removed.
This parameter is a safety net to avoid bad response times due to bans being tested at lookup time. Setting a cutoff trades response time for cache efficiency. The recommended value is proportional to rate(bans_lurker_tests_tested) / n_objects while the ban lurker is working, which is the number of bans the system can sustain. The additional latency due to request ban testing is in the order of ban_cutoff / rate(bans_lurker_tests_tested). For example, for rate(bans_lurker_tests_tested) = 2M/s and a tolerable latency of 100ms, a good value for ban_cutoff may be 200K.
Eliminate older identical bans when a new ban is added. This saves CPU cycles by not comparing objects to identical bans. This is a waste of time if you have many bans which are never identical.
The ban lurker will ignore bans until they are this old. When a ban is added, the active traffic will be tested against it as part of object lookup. Because many applications issue bans in bursts, this parameter holds the ban-lurker off until the rush is over. This should be set to the approximate time which a ban-burst takes.
The ban lurker sleeps ${ban_lurker_sleep} after examining this many objects. Use this to pace the ban-lurker if it eats too many resources.
How long the ban lurker sleeps when giving way to lookup due to lock contention.
How long the ban lurker sleeps after examining ${ban_lurker_batch} objects. Use this to pace the ban-lurker if it eats too many resources. A value of zero will disable the ban lurker entirely.
We only wait for this many seconds between bytes received from the backend before giving up the fetch. VCL values, per backend or per backend request take precedence. This parameter does not apply to pipe'ed requests.
NB: The actual default value for this parameter depends on the Varnish build environment and options.
The command used for compiling the C source code to a dlopen(3) loadable object. The following expansions can be used:
Unknown percent expansion sequences are ignored, and to avoid future incompatibilities percent characters should be escaped with a double percent sequence.
The %d and %D expansions allow passing the parameter's default value to a wrapper script to perform additional processing.
NB: The actual default value for this parameter depends on the Varnish build environment and options.
Warnings used when compiling the C source code with the cc_command parameter. By default, VCL is compiled with the same set of warnings as Varnish itself.
Maximum size of CLI response. If the response exceeds this limit, the response code will be 201 instead of 200 and the last line will indicate the truncation.
Timeout for the child's replies to CLI requests.
How much clockskew we are willing to accept between the backend and our own clock.
How much observed clock step we are willing to accept before we panic.
Default connection timeout for backend connections. We only try to connect to the backend for this many seconds before giving up. VCL can override this default value for each backend and backend request.
How long the critbit hasher keeps deleted objheads on the cooloff list.
Enable/Disable various kinds of debugging.
Use +/- prefix to set/reset individual bits:
Default grace period. We will deliver an object this long after it has expired, provided another thread is attempting to get a new copy.
Default keep period. We will keep a useless object around this long, making it available for conditional backend fetches. That means that the object will be removed from the cache at the end of ttl+grace+keep.
The TTL assigned to objects if neither the backend nor the VCL code assigns one.
Enable/Disable experimental features.
Use +/- prefix to set/reset individual bits:
Enable/Disable various minor features.
Use +/- prefix to enable/disable individual feature:
The default chunksize used by fetcher. This should be bigger than the majority of objects with short TTLs. Internal limits in the storage_file module makes increases above 128kb a dubious idea.
The maximum chunksize we attempt to allocate from storage. Making this too large may cause delays and storage fragmentation.
Default timeout for receiving first byte from backend. We only wait for this many seconds for the first byte before giving up. VCL can override this default value for each backend and backend request. This parameter does not apply to pipe'ed requests.
Size of malloc buffer used for gzip processing. These buffers are used for in-transit data, for instance gunzip'ed data being sent to a client.Making this space to small results in more overhead, writes to sockets etc, making it too big is probably just a waste of memory.
Gzip compression level: 0=debug, 1=fast, 9=best
Gzip memory level 1=slow/least, 9=fast/most compression. Memory impact is 1=1k, 2=2k, ... 9=256k.
HTTP2 header table size. This is the size that will be used for the HPACK dynamic decoding table.
The value of this parameter defines SETTINGS_HEADER_TABLE_SIZE in the initial SETTINGS frame sent to the client when a new HTTP2 session is established.
HTTP2 initial flow control window size.
The value of this parameter defines SETTINGS_INITIAL_WINDOW_SIZE in the initial SETTINGS frame sent to the client when a new HTTP2 session is established.
HTTP2 Maximum number of concurrent streams. This is the number of requests that can be active at the same time for a single HTTP2 connection.
The value of this parameter defines SETTINGS_MAX_CONCURRENT_STREAMS in the initial SETTINGS frame sent to the client when a new HTTP2 session is established.
HTTP2 maximum per frame payload size we are willing to accept.
The value of this parameter defines SETTINGS_MAX_FRAME_SIZE in the initial SETTINGS frame sent to the client when a new HTTP2 session is established.
HTTP2 maximum size of an uncompressed header list. This parameter is not mapped to SETTINGS_MAX_HEADER_LIST_SIZE in the initial SETTINGS frame, the http_req_size parameter is instead.
The http_req_size advises HTTP2 clients of the maximum size for the header list. Exceeding http_req_size results in a reset stream after processing the HPACK block to preserve the connection, but exceeding h2_max_header_list_size results in the HTTP2 connection going away immediately.
If h2_max_header_list_size is lower than http_req_size, it has no effect, except for the special value zero interpreted as 150% of http_req_size.
The upper threshold for how soon an http/2 RST_STREAM frame has to be parsed after a HEADERS frame for it to be treated as suspect and subjected to the rate limits specified by h2_rapid_reset_limit and h2_rapid_reset_period. Changes to this parameter affect the default for new HTTP2 sessions. vmod_h2(3) can be used to adjust it from VCL.
HTTP2 RST Allowance. Specifies the maximum number of allowed stream resets issued by a client over a time period before the connection is closed. Setting this parameter to 0 disables the limit. Changes to this parameter affect the default for new HTTP2 sessions. vmod_h2(3) can be used to adjust it from VCL.
HTTP2 sliding window duration for h2_rapid_reset_limit. Changes to this parameter affect the default for new HTTP2 sessions. vmod_h2(3) can be used to adjust it from VCL.
HTTP2 Receive Window Increments. How big credits we send in WINDOW_UPDATE frames Only affects incoming request bodies (ie: POST, PUT etc.)
HTTP2 Receive Window low water mark. We try to keep the window at least this big Only affects incoming request bodies (ie: POST, PUT etc.)
The name of the storage backend that HTTP/2 receive buffers should be allocated from.
HTTP2 time limit without window credits. How long a stream may wait for the client to credit the window and allow for more DATA frames to be sent.
Number of io vectors to allocate for HTTP1 protocol transmission. A HTTP1 header needs 7 + 2 per HTTP header field. Allocated from workspace_thread. This parameter affects only io vectors used for client delivery. For backend fetches, the maximum number of io vectors (up to IOV_MAX) is allocated from available workspace_thread memory.
Clients that do not support gzip will have their Accept-Encoding header removed. For more information on how gzip is implemented please see the chapter on gzip in the Varnish reference.
When gzip support is disabled the variables beresp.do_gzip and beresp.do_gunzip have no effect in VCL.
Maximum number of HTTP header lines we allow in {req|resp|bereq|beresp}.http (obj.http is autosized to the exact number of headers). Cheap, ~20 bytes, in terms of workspace memory. Note that the first line occupies five header lines.
Enable support for HTTP Range headers.
Maximum length of any HTTP client request header we will allow. The limit is inclusive its continuation lines.
Maximum number of bytes of HTTP client request we will deal with. This is a limit on all bytes up to the double blank line which ends the HTTP request. The memory for the request is allocated from the client workspace (param: workspace_client) and this parameter limits how much of that the request is allowed to take up.
For HTTP2 clients, it is advertised as MAX_HEADER_LIST_SIZE in the initial SETTINGS frame.
Maximum length of any HTTP backend response header we will allow. The limit is inclusive its continuation lines.
Maximum number of bytes of HTTP backend response we will deal with. This is a limit on all bytes up to the double blank line which ends the HTTP response. The memory for the response is allocated from the backend workspace (param: workspace_backend) and this parameter limits how much of that the response is allowed to take up.
Send timeout for individual pieces of data on client connections. May get extended if 'send_timeout' applies.
When this timeout is hit, the session is closed.
See the man page for setsockopt(2) or socket(7) under SO_SNDTIMEO for more information.
Listen queue depth.
Grace period before object moves on LRU list. Objects are only moved to the front of the LRU list if they have not been moved there already inside this timeout period. This reduces the amount of lock operations necessary for LRU list access.
Maximum depth of esi:include processing.
Upper limit on how many times a request can restart.
Upper limit on how many times a backend fetch can retry.
Threshold of loaded VCL programs. (VCL labels are not counted.) Parameter max_vcl_handling determines behaviour.
Behaviour when attempting to exceed max_vcl loaded VCL.
Maximum number of objects we attempt to nuke in order to make space for a object body.
Size of the panic message buffer. The panic buffer is allocated in the working directory as memory shared between the management and worker process, so sufficient working directory space should be accounted for if this value is adjusted. Panic messages are truncated to the configured size.
The recursion depth-limit for the internal match logic in a pcre2_match().
(See: pcre2_set_depth_limit() in pcre2 docs.)
This puts an upper limit on the amount of stack used by PCRE2 for certain classes of regular expressions.
We have set the default value low in order to prevent crashes, at the cost of possible regexp matching failures.
Matching failures will show up in the log as VCL_Error messages.
Use the pcre2 JIT compiler if available.
The limit for the number of calls to the internal match logic in pcre2_match().
(See: pcre2_set_match_limit() in pcre2 docs.)
This parameter limits how much CPU time regular expression matching can soak up.
Interval between pings from parent to child. Zero will disable pinging entirely, which makes it possible to attach a debugger to the child.
Maximum number of sessions dedicated to pipe transactions.
Deadline for PIPE sessions. Regardless of activity in either direction after this many seconds, the session is closed.
Idle timeout for PIPE sessions. If nothing have been received in either direction for this many seconds, the session is closed.
Parameters for per worker pool request memory pool.
The three numbers are:
Parameters for per worker pool session memory pool.
The three numbers are:
Parameters for backend object fetch memory pool.
The three numbers are:
Prefer IPv6 address when connecting to backends which have both IPv4 and IPv6 addresses.
How many parked request we start for each completed request on the object. NB: Even with the implicit delay of delivery, this parameter controls an exponential increase in number of worker threads.
Total timeout for ordinary HTTP1 responses. Does not apply to some internally generated errors and pipe mode.
When 'idle_send_timeout' is hit while sending an HTTP1 response, the timeout is extended unless the total time already taken for sending the response in its entirety exceeds this many seconds.
When this timeout is hit, the session is closed
Objects created with (ttl+grace+keep) shorter than this are always put in transient storage.
Install a signal handler which tries to dump debug information on segmentation faults, bus errors and abort signals.
Alternative timeout for the initial worker process startup. If cli_timeout is longer than startup_timeout, it is used instead.
Log all CLI traffic to syslog(LOG_INFO).
NB: This parameter depends on a feature which is not available on all platforms.
Enable TCP Fast Open extension.
NB: This parameter depends on a feature which is not available on all platforms.
The number of seconds between TCP keep-alive probes. Ignored for Unix domain sockets.
NB: This parameter depends on a feature which is not available on all platforms.
The maximum number of TCP keep-alive probes to send before giving up and killing the connection if no response is obtained from the other end. Ignored for Unix domain sockets.
NB: This parameter depends on a feature which is not available on all platforms.
The number of seconds a connection needs to be idle before TCP begins sending out keep-alive probes. Ignored for Unix domain sockets.
Wait at least this long after creating a thread.
Some (buggy) systems may need a short (sub-second) delay between creating threads. Set this to a few milliseconds if you see the 'threads_failed' counter grow too much.
Setting this too high results in insufficient worker threads.
Wait this long after destroying a thread.
This controls the decay of thread pools when idle(-ish).
Wait at least this long after a failed thread creation before trying to create another thread.
Failure to create a worker thread is often a sign that the end is near, because the process is running out of some resource. This delay tries to not rush the end on needlessly.
If thread creation failures are a problem, check that thread_pool_max is not too high.
It may also help to increase thread_pool_timeout and thread_pool_min, to reduce the rate at which treads are destroyed and later recreated.
The maximum number of worker threads in each pool.
Do not set this higher than you have to, since excess worker threads soak up RAM and CPU and generally just get in the way of getting work done.
The minimum number of worker threads in each pool.
Increasing this may help ramp up faster from low load situations or when threads have expired.
Technical minimum is 5 threads, but this parameter is strongly recommended to be at least 10
The number of worker threads reserved for vital tasks in each pool.
Tasks may require other tasks to complete (for example, client requests may require backend requests, http2 sessions require streams, which require requests). This reserve is to ensure that lower priority tasks do not prevent higher priority tasks from running even under high load.
The effective value is at least 5 (the number of internal priority classes), irrespective of this parameter.
Worker thread stack size. This will likely be rounded up to a multiple of 4k (or whatever the page_size might be) by the kernel.
The required stack size is primarily driven by the depth of the call-tree. The most common relevant determining factors in varnish core code are GZIP (un)compression, ESI processing and regular expression matches. VMODs may also require significant amounts of additional stack. The nesting depth of VCL subs is another factor, although typically not predominant.
The stack size is per thread, so the maximum total memory required for worker thread stacks is in the order of size = thread_pools x thread_pool_max x thread_pool_stack.
Thus, in particular for setups with many threads, keeping the stack size at a minimum helps reduce the amount of memory required by Varnish.
On the other hand, thread_pool_stack must be large enough under all circumstances, otherwise varnish will crash due to a stack overflow. Usually, a stack overflow manifests itself as a segmentation fault (aka segfault / SIGSEGV) with the faulting address being near the stack pointer (sp).
Unless stack usage can be reduced, thread_pool_stack must be increased when a stack overflow occurs. Setting it in 150%-200% increments is recommended until stack overflows cease to occur.
Thread idle threshold.
Threads in excess of thread_pool_min, which have been idle for at least this long, will be destroyed.
Thread queue stuck watchdog.
If no queued work have been released for this long, the worker process panics itself.
Number of worker thread pools.
Increasing the number of worker pools decreases lock contention. Each worker pool also has a thread accepting new connections, so for very high rates of incoming new connections on systems with many cores, increasing the worker pools may be required.
Too many pools waste CPU and RAM resources, and more than one pool for each CPU is most likely detrimental to performance.
Can be increased on the fly, but decreases require a restart to take effect, unless the drop_pools experimental debug flag is set.
Permitted request queue length per thread-pool.
This sets the number of requests we will queue, waiting for an available thread. Above this limit sessions will be dropped instead of queued.
Worker threads accumulate statistics, and dump these into the global stats counters if the lock is free when they finish a job (request/fetch etc.) This parameters defines the maximum number of jobs a worker thread may handle, before it is forced to dump its accumulated stats into the global counters.
Idle timeout for client connections.
A connection is considered idle until we have received the full request headers.
This parameter is particularly relevant for HTTP1 keepalive connections which are closed unless the next request is received before this timeout is reached.
How long the worker thread lingers on an idle session before handing it over to the waiter. When sessions are reused, as much as half of all reuses happen within the first 100 msec of the previous request completing. Setting this too high results in worker threads not doing anything for their keep, setting it too low just means that more sessions take a detour around the waiter.
The number of bytes which Varnish buffers for uncacheable backend streaming fetches - in other words, how many bytes Varnish reads from the backend ahead of what has been sent to the client. A zero value means no limit, the object is fetched as fast as possible.
When dealing with slow clients, setting this parameter to non-zero can prevent large uncacheable objects from being stored in full when the intent is to simply stream them to the client. As a result, a slow client transaction holds onto a backend connection until the end of the delivery.
This parameter is the default to the VCL variable beresp.transit_buffer, which can be used to control the transit buffer per backend request.
How many variants need to be evaluated to log a Notice that there might be too many variants.
Deprecated alias for the vcc_feature parameter.
Deprecated alias for the vcc_feature parameter.
Enable/Disable various VCC behaviors.
Use +/- prefix to enable/disable individual behavior:
Deprecated alias for the vcc_feature parameter.
How long a VCL is kept warm after being replaced as the active VCL (granularity approximately 30 seconds).
NB: The actual default value for this parameter depends on the Varnish build environment and options.
Directory (or colon separated list of directories) from which relative VCL filenames (vcl.load and include) are to be found. By default Varnish searches VCL files in both the system configuration and shared data directories to allow packages to drop their VCL files in a standard location where relative includes would work.
NB: The actual default value for this parameter depends on the Varnish build environment and options.
Directory (or colon separated list of directories) where VMODs are to be found.
Bytes of (req-/backend-)workspace dedicated to buffering VSL records. When this parameter is adjusted, most likely workspace_client and workspace_backend will have to be adjusted by the same amount.
Setting this too high costs memory, setting it too low will cause more VSL flushes and likely increase lock-contention on the VSL mutex.
Mask individual VSL messages from being logged.
Use +/- prefix in front of VSL tag name to unmask/mask individual VSL messages. See vsl(7) for possible values.
Maximum number of bytes in SHM log record.
The amount of space to allocate for the VSL fifo buffer in the VSM memory segment. If you make this too small, varnish{ncsa|log} etc will not be able to keep up. Making it too large just costs memory resources.
How long VSM memory is kept warm after a deallocation (granularity approximately 2 seconds).
Bytes of HTTP protocol workspace for backend HTTP req/resp. If larger than 4k, use a multiple of 4k for VM efficiency.
Bytes of HTTP protocol workspace for clients HTTP req/resp. Use a multiple of 4k for VM efficiency. For HTTP/2 compliance this must be at least 20k, in order to receive fullsize (=16k) frames from the client. That usually happens only in POST/PUT bodies. For other traffic-patterns smaller values work just fine.
Allocation size for session structure and workspace. The workspace is primarily used for TCP connection addresses. If larger than 4k, use a multiple of 4k for VM efficiency.
Bytes of auxiliary workspace per thread. This workspace is used for certain temporary data structures during the operation of a worker thread. One use is for the IO-vectors used during delivery. Setting this parameter too low may increase the number of writev() syscalls, setting it too high just wastes space. ~0.1k + UIO_MAXIOV * sizeof(struct iovec) (typically = ~16k for 64bit) is considered the maximum sensible value under any known circumstances (excluding exotic vmod use).
Varnish and bundled tools will, in most cases, exit with one of the following codes
The varnishd master process may also OR its exit code
The varnishd daemon was developed by Poul-Henning Kamp in cooperation with Verdens Gang AS and Varnish Software.
This manual page was written by Dag-Erling Smørgrav with updates by Stig Sandbeck Mathisen < <ssm@debian.org> >, Nils Goroll and others.
This document is licensed under the same licence as Varnish itself. See LICENCE for details.