]> err.no Git - varnish/commitdiff
Add and document a ping_interval parameter which controls the interval at
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 1 May 2007 18:21:53 +0000 (18:21 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 1 May 2007 18:21:53 +0000 (18:21 +0000)
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
varnish-cache/bin/varnishd/mgt_child.c
varnish-cache/bin/varnishd/mgt_param.c
varnish-cache/bin/varnishd/varnishd.1

index 4197b16bafc07013652ac91b6d4de09457a1bf50..8853951186ca029d00e787854e6964b0e2d464d8 100644 (file)
@@ -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;
index 45a84669497953f5692f4e71c40e3b3f737976f5..4f8cece44f10d6133abefaf6f454c087b0c07503 100644 (file)
@@ -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]));
index 0287346f2e46aac2b08c4c80d856ef32e088cd62..474ab572dbeba79b04e3e6222bcd3274735542fd 100644 (file)
@@ -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, &params->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 }
 };
 
index 7cabd89fa10e48bf112cb63ccc1f935e89d21a8b..e78d38218a2514abdbc2013a85207cffdf2427de 100644 (file)
@@ -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