varnishd·续3

http_gzip_support#
  • Units: bool
  • Default: on

Enable gzip support. When enabled Varnish request compressed objects from the backend and store them compressed. If a client does not support gzip encoding Varnish will uncompress compressed objects on demand. Varnish will also rewrite the Accept-Encoding header of clients indicating support for gzip to: Accept-Encoding: gzip

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.

http_max_hdr#
  • Units: header lines
  • Default: 64
  • Minimum: 32
  • Maximum: 65535

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.

http_range_support#
  • Units: bool
  • Default: on

Enable support for HTTP Range headers.

http_req_hdr_len#
  • Units: bytes
  • Default: 8k
  • Minimum: 40b

Maximum length of any HTTP client request header we will allow. The limit is inclusive its continuation lines.

http_req_overflow_status#
  • Units: HTTP status code or 0 to disable
  • Default: 0
  • Minimum: 400
  • Maximum: 500

HTTP status code to be returned if http_req_size is exceeded. The default value of 0 closes the connection silently without sending a HTTP response. Note that there is no standard HTTP status which exactly matches the implementation of http_req_size. 414 applies to the URL only, while 413 applies to the request body. 400 is probably the least incorrect alternative value to sending no response at all (0). It can also be seen as an internal error on the Varnish side due to configured limits, so 500 is also allowed.

http_req_size#
  • Units: bytes
  • Default: 32k
  • Minimum: 0.25k

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.

http_resp_hdr_len#
  • Units: bytes
  • Default: 8k
  • Minimum: 40b

Maximum length of any HTTP backend response header we will allow. The limit is inclusive its continuation lines.

http_resp_size#
  • Units: bytes
  • Default: 32k
  • Minimum: 0.25k

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.

idle_send_timeout#
  • Units: seconds
  • Default: 60.000
  • Minimum: 0.000
  • Maximum: 3600.000
  • Flags: timeout, delayed

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_depth#
  • Units: connections
  • Default: 1024
  • Minimum: 0
  • Flags: must_restart

Listen queue depth.

lru_interval#
  • Units: seconds
  • Default: 2.000
  • Minimum: 0.000
  • Flags: experimental

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.

max_esi_depth#
  • Units: levels
  • Default: 5
  • Minimum: 0

Maximum depth of esi:include processing.

max_restarts#
  • Units: restarts
  • Default: 4
  • Minimum: 0
  • Flags: delayed

Upper limit on how many times a request can restart.

max_retries#
  • Units: retries
  • Default: 4
  • Minimum: 0
  • Flags: delayed

Upper limit on how many times a backend fetch can retry.

max_vcl#
  • Default: 100
  • Minimum: 0

Threshold of loaded VCL programs. (VCL labels are not counted.) Parameter max_vcl_handling determines behaviour.

max_vcl_handling#
  • Default: 1
  • Minimum: 0
  • Maximum: 2

Behaviour when attempting to exceed max_vcl loaded VCL.

  • 0 - Ignore max_vcl parameter.
  • 1 - Issue warning.
  • 2 - Refuse loading VCLs.
nuke_limit#
  • Units: allocations
  • Default: 50
  • Minimum: 0
  • Flags: experimental

Maximum number of objects we attempt to nuke in order to make space for a object body.

panic_buffer#
  • Units: bytes
  • Default: 64k
  • Minimum: 4k
  • Maximum: 10M
  • Flags: must_restart

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.

pcre2_depth_limit#
  • Default: 20
  • Minimum: 1

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.

pcre2_jit_compilation#
  • Units: bool
  • Default: on

Use the pcre2 JIT compiler if available.

pcre2_match_limit#
  • Default: 10000
  • Minimum: 1

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.

ping_interval#
  • Units: seconds
  • Default: 3
  • Minimum: 0
  • Flags: must_restart

Interval between pings from parent to child. Zero will disable pinging entirely, which makes it possible to attach a debugger to the child.

pipe_sess_max#
  • Units: connections
  • Default: 0
  • Minimum: 0

Maximum number of sessions dedicated to pipe transactions.

pipe_task_deadline#
  • Units: seconds
  • Default: 0.000
  • Minimum: 0.000
  • Flags: timeout

Deadline for PIPE sessions. Regardless of activity in either direction after this many seconds, the session is closed.

pipe_timeout#
  • Units: seconds
  • Default: 60.000
  • Minimum: 0.000
  • Flags: timeout

Idle timeout for PIPE sessions. If nothing have been received in either direction for this many seconds, the session is closed.

pool_req#
  • Default: 10,100,10

Parameters for per worker pool request memory pool.

The three numbers are:

min_pool minimum size of free pool.

max_pool maximum size of free pool.

max_age max age of free element.

pool_sess#
  • Default: 10,100,10

Parameters for per worker pool session memory pool.

The three numbers are:

min_pool minimum size of free pool.

max_pool maximum size of free pool.

max_age max age of free element.

pool_vbo#
  • Default: 10,100,10

Parameters for backend object fetch memory pool.

The three numbers are:

min_pool minimum size of free pool.

max_pool maximum size of free pool.

max_age max age of free element.

prefer_ipv6#
  • Units: bool
  • Default: off

Prefer IPv6 address when connecting to backends which have both IPv4 and IPv6 addresses.

rush_exponent#
  • Units: requests per request
  • Default: 3
  • Minimum: 1
  • Flags: experimental

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. A value of 1 will instead serialize requests resumption and is only useful for testing purposes.

send_timeout#
  • Units: seconds
  • Default: 600.000
  • Minimum: 0.000
  • Flags: timeout, delayed

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

shortlived#
  • Units: seconds
  • Default: 10.000
  • Minimum: 0.000

Objects created with (ttl+grace+keep) shorter than this are always put in transient storage.

sigsegv_handler#
  • Units: bool
  • Default: on
  • Flags: must_restart

Install a signal handler which tries to dump debug information on segmentation faults, bus errors and abort signals.

startup_timeout#
  • Units: seconds
  • Default: 0.000
  • Minimum: 0.000
  • Flags: timeout

Alternative timeout for the initial worker process startup. If cli_timeout is longer than startup_timeout, it is used instead.

syslog_cli_traffic#
  • Units: bool
  • Default: on

Log all CLI traffic to syslog(LOG_INFO).

tcp_fastopen#

NB: This parameter depends on a feature which is not available on all platforms.

  • Units: bool
  • Default: off

Enable TCP Fast Open extension.

tcp_keepalive_intvl#

NB: This parameter depends on a feature which is not available on all platforms.

  • Units: seconds
  • Default: platform dependent
  • Minimum: 1
  • Maximum: 100

The number of seconds between TCP keep-alive probes. Ignored for Unix domain sockets.

tcp_keepalive_probes#

NB: This parameter depends on a feature which is not available on all platforms.

  • Units: probes
  • Default: platform dependent
  • Minimum: 1
  • Maximum: 100

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.

tcp_keepalive_time#

NB: This parameter depends on a feature which is not available on all platforms.

  • Units: seconds
  • Default: platform dependent
  • Minimum: 1
  • Maximum: 7200

The number of seconds a connection needs to be idle before TCP begins sending out keep-alive probes. Ignored for Unix domain sockets.

thread_pool_add_delay#
  • Units: seconds
  • Default: 0.000
  • Minimum: 0.000
  • Flags: experimental

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.

thread_pool_destroy_delay#
  • Units: seconds
  • Default: 1.000
  • Minimum: 0.010
  • Flags: delayed, experimental

Wait this long after destroying a thread.

This controls the decay of thread pools when idle(-ish).

thread_pool_fail_delay#
  • Units: seconds
  • Default: 0.200
  • Minimum: 0.010
  • Flags: experimental

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.

thread_pool_max#
  • Units: threads
  • Default: 5000
  • Minimum: thread_pool_min
  • Flags: delayed

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.