Mailing List Archive

r1373 - trunk/varnish-cache/bin/varnishd
Author: des
Date: 2007-05-01 20:21:53 +0200 (Tue, 01 May 2007)
New Revision: 1373

Modified:
trunk/varnish-cache/bin/varnishd/heritage.h
trunk/varnish-cache/bin/varnishd/mgt_child.c
trunk/varnish-cache/bin/varnishd/mgt_param.c
trunk/varnish-cache/bin/varnishd/varnishd.1
Log:
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.


Modified: trunk/varnish-cache/bin/varnishd/heritage.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/heritage.h 2007-05-01 17:55:31 UTC (rev 1372)
+++ trunk/varnish-cache/bin/varnishd/heritage.h 2007-05-01 18:21:53 UTC (rev 1373)
@@ -111,6 +111,9 @@
/* HTTP proto behaviour */
unsigned backend_http11;
unsigned client_http11;
+
+ /* Ping interval */
+ unsigned ping_interval;
};

extern volatile struct params *params;

Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c 2007-05-01 17:55:31 UTC (rev 1372)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2007-05-01 18:21:53 UTC (rev 1373)
@@ -214,13 +214,15 @@
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]));

Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c 2007-05-01 17:55:31 UTC (rev 1372)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2007-05-01 18:21:53 UTC (rev 1373)
@@ -407,6 +407,15 @@

/*--------------------------------------------------------------------*/

+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 @@
"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 }
};


Modified: trunk/varnish-cache/bin/varnishd/varnishd.1
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.1 2007-05-01 17:55:31 UTC (rev 1372)
+++ trunk/varnish-cache/bin/varnishd/varnishd.1 2007-05-01 18:21:53 UTC (rev 1373)
@@ -28,7 +28,7 @@
.\"
.\" $Id$
.\"
-.Dd October 6, 2006
+.Dd May 1, 2007
.Dt VARNISHD 1
.Os
.Sh NAME
@@ -351,7 +351,15 @@
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