From ef2f28b54b8dc57d77065e5f5ec675b82316c554 Mon Sep 17 00:00:00 2001 From: des Date: Tue, 1 May 2007 18:21:53 +0000 Subject: [PATCH] Add and document a ping_interval parameter which controls the interval at which the parent pings the child. Also document pipe_timeout, which was left out of the man page by accident. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1373 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/heritage.h | 3 +++ varnish-cache/bin/varnishd/mgt_child.c | 16 +++++++++------- varnish-cache/bin/varnishd/mgt_param.c | 15 +++++++++++++++ varnish-cache/bin/varnishd/varnishd.1 | 10 +++++++++- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/varnish-cache/bin/varnishd/heritage.h b/varnish-cache/bin/varnishd/heritage.h index 4197b16b..88539511 100644 --- a/varnish-cache/bin/varnishd/heritage.h +++ b/varnish-cache/bin/varnishd/heritage.h @@ -111,6 +111,9 @@ struct params { /* HTTP proto behaviour */ unsigned backend_http11; unsigned client_http11; + + /* Ping interval */ + unsigned ping_interval; }; extern volatile struct params *params; diff --git a/varnish-cache/bin/varnishd/mgt_child.c b/varnish-cache/bin/varnishd/mgt_child.c index 45a84669..4f8cece4 100644 --- a/varnish-cache/bin/varnishd/mgt_child.c +++ b/varnish-cache/bin/varnishd/mgt_child.c @@ -214,13 +214,15 @@ start_child(void) ev_listen = e; AZ(ev_poker); - e = ev_new(); - XXXAN(e); - e->timeout = 3.0; - e->callback = child_poker; - e->name = "child poker"; - AZ(ev_add(mgt_evb, e)); - ev_poker = e; + if (params->ping_interval > 0) { + e = ev_new(); + XXXAN(e); + e->timeout = params->ping_interval; + e->callback = child_poker; + e->name = "child poker"; + AZ(ev_add(mgt_evb, e)); + ev_poker = e; + } mgt_cli_start_child(heritage.fds[0], heritage.fds[3]); AZ(close(heritage.fds[1])); diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index 0287346f..474ab572 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -407,6 +407,15 @@ tweak_client_http11(struct cli *cli, struct parspec *par, const char *arg) /*--------------------------------------------------------------------*/ +static void +tweak_ping_interval(struct cli *cli, struct parspec *par, const char *arg) +{ + (void)par; + tweak_generic_uint(cli, ¶ms->ping_interval, arg, 0, UINT_MAX); +} + +/*--------------------------------------------------------------------*/ + /* * Make sure to end all lines with either a space or newline of the * formatting will go haywire. @@ -566,6 +575,12 @@ static struct parspec parspec[] = { "backend response." EXPERIMENTAL, "off", "bool" }, + { "ping_interval", tweak_ping_interval, + "Interval between pings from parent to child.\n" + "Zero will disable pinging entirely, which makes " + "it possible to attach a debugger to the child.\n" + MUST_RESTART, + "3", "seconds" }, { NULL, NULL, NULL } }; diff --git a/varnish-cache/bin/varnishd/varnishd.1 b/varnish-cache/bin/varnishd/varnishd.1 index 7cabd89f..e78d3821 100644 --- a/varnish-cache/bin/varnishd/varnishd.1 +++ b/varnish-cache/bin/varnishd/varnishd.1 @@ -28,7 +28,7 @@ .\" .\" $Id$ .\" -.Dd October 6, 2006 +.Dd May 1, 2007 .Dt VARNISHD 1 .Os .Sh NAME @@ -351,7 +351,15 @@ If the overflow queue fills up, will start dropping new connections. .Pp The default is 100%. +.It Va ping_interval +The interval at which the parent process will ping the child process +to ascertain that it is still present and functioning. +.Pp +The default is 3 seconds. .It Va pipe_timeout +The time to wait before dropping an idle pipe mode connection. +.Pp +The default is 60 seconds. .It Va sendfile_threshold The size threshold beyond which documents are sent to the client using .Xr sendfile 2 -- 2.39.5