From e9b792f6f0e0077318582c582f90c2cdaf7168f9 Mon Sep 17 00:00:00 2001 From: petter Date: Thu, 20 Nov 2008 11:01:26 +0000 Subject: [PATCH] Added documentaiton on the timeouts git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3411 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/mgt_param.c | 12 ++++++----- varnish-cache/bin/varnishd/varnishd.1 | 25 +++++++++++++++++++++++ varnish-cache/man/vcl.7so | 28 ++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index d952e774..0e7d76c1 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -773,11 +773,11 @@ static const struct parspec parspec[] = { "off", "bool" }, { "connect_timeout", tweak_timeout_double, &master.connect_timeout,0, UINT_MAX, - "Default connection timeout for backend connections. " + "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. " - "This does not apply to pipe. ", + "VCL can override this default value for each backend and " + "backend request." 0, "0.4", "s" }, { "first_byte_timeout", tweak_timeout_double, @@ -785,7 +785,8 @@ static const struct parspec parspec[] = { "Default timeout for receiving first byte from backend. " "We only wait for this many seconds for the first " "byte before giving up. A value of 0 means it will never time out. " - "VCL can override this default value for each backend request.", + "VCL can override this default value for each backend and " + "backend request. This parameter does not apply to pipe.", 0, "60", "s" }, { "between_bytes_timeout", tweak_timeout_double, @@ -793,7 +794,8 @@ static const struct parspec parspec[] = { "Default timeout between bytes when receiving data from backend. " "We only wait for this many seconds between bytes " "before giving up. A value of 0 means it will never time out. " - "VCL can override this default value for each backend request.", + "VCL can override this default value for each backend request and " + "backend request. This parameter does not apply to pipe.", 0, "60", "s" }, { "accept_fd_holdoff", tweak_timeout, diff --git a/varnish-cache/bin/varnishd/varnishd.1 b/varnish-cache/bin/varnishd/varnishd.1 index 7b314b12..a5de5e72 100644 --- a/varnish-cache/bin/varnishd/varnishd.1 +++ b/varnish-cache/bin/varnishd/varnishd.1 @@ -405,6 +405,15 @@ triggered the retrieval. .Pp The default is .Dv off . +.It Va between_bytes_timeout +Default timeout between bytes when receiving data from backend. +We only wait for this many seconds between bytes before giving up. +A value of 0 means it will never time out. +VCL can override this default value for each backend and backend request. +This parameter does not apply to pipe. +.Pp +The default is +.Dv 60 seconds .It Va client_http11 Whether to force the use of HTTP/1.1 when responding to client requests, or just use the same protocol version as that used by the @@ -412,6 +421,13 @@ backend server which delivered the requested document. .Pp The default is .Dv off . +.It Va connect_timeout +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. +.Pp +The default is +.Dv 0.4 seconds .It Va default_ttl The default time-to-live assigned to objects if neither the backend nor the configuration assign one. @@ -427,6 +443,15 @@ The default chunk size used when retrieving documents for which the backend server does not specify a content length. .Pp The default is 128 kilobytes. +.It Va first_byte_timeout +Default timeout for receiving first byte from backend. +We only wait for this many seconds for the first byte before giving up. +A value of 0 means it will never time out. +VCL can override this default value for each backend and backend request. +This parameter does not apply to pipe. +.Pp +The default is +.Dv 60 seconds .It Va group The name of an unprivileged group to which the child process should switch before it starts accepting connections. diff --git a/varnish-cache/man/vcl.7so b/varnish-cache/man/vcl.7so index 03c2acb3..a01c9f26 100644 --- a/varnish-cache/man/vcl.7so +++ b/varnish-cache/man/vcl.7so @@ -92,6 +92,26 @@ if (req.http.host ~ "^(www\.)?example.com$") { set req.backend = www; } .Ed +.Pp +The timeout parameters can be overridden in the backend declaration. +The timeout parameters are +.Fa .connect_timeout +for the time to wait for a backend connection, +.Fa .first_byte_timeout +for the time to wait for the first byte from the backend and +.Fa .between_bytes_timeout +for time to wait between each received byte. +.Pp +These can be set in the declaration like this: +.Bd -literal -offset 4n +backend www { + .host = "www.example.com"; + .port = "http"; + .connect_timeout = 1s; + .first_byte_timeout = 5s; + .between_bytes_timeout = 2s; +} +.Ed .Ss Directors Directors choose from different backends based on health status and a per-director algorithm. @@ -516,6 +536,14 @@ The HTTP protocol version used to talk to the server. .It Va bereq.http. Ns Ar header The corresponding HTTP .Ar header . +.It Va bereq.connect_timeout +The time in seconds to wait for a backend connection. +.It Va bereq.first_byte_timeout +The time in seconds to wait for the first byte from the backend. +Not available in pipe mode. +.It Va bereq.between_bytes_timeout +The time in seconds to wait between each received byte from the backend. +Not available in pipe mode. .El .Pp The following variables are available after the requested object has -- 2.39.5