Mailing List Archive

Varnishd and Supervisord
Hello all,

I'm not sure if this is the right mailing list or not, but I am trying
to get Varnish working with Supervisord
(http://plope.org/software/supervisor2/). The point of supervisord is
to make sure varnish is always running and restart it even in the case
of a crash.

The problem I am facing is that in order to work with Supervisord,
Varnish has to not daemonize. However, with the -d option, the main
child thread doesn't start until the start command is given via the
telnet interface. Therefore, if varnish crashes and is restarted, the
child process will need manual intervention. Is there any way to get the
child to start automatically even in debugging mode?

-- james
Varnishd and Supervisord [ In reply to ]
In message <46279A07.4080806 at nyi.net>, James writes:
>Hello all,
>
>I'm not sure if this is the right mailing list or not, but I am trying
>to get Varnish working with Supervisord
>(http://plope.org/software/supervisor2/). The point of supervisord is
>to make sure varnish is always running and restart it even in the case
>of a crash.

This is sort of pointless, because Varnish already has its own
supervisor facility: The management process will restart
the worker process if it dies.

>The problem I am facing is that in order to work with Supervisord,
>Varnish has to not daemonize. However, with the -d option, the main
>child thread doesn't start until the start command is given via the
>telnet interface. Therefore, if varnish crashes and is restarted, the
>child process will need manual intervention. Is there any way to get the
>child to start automatically even in debugging mode?

I havn't tried this, but you could try to run it as:

echo "start" | varnishd -d -d

You will want to use the double -d option for something like
this.




--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
Varnishd and Supervisord [ In reply to ]
On Thu, Apr 19, 2007 at 06:02:15PM +0000, Poul-Henning Kamp wrote:
> In message <46279A07.4080806 at nyi.net>, James writes:
>> I'm not sure if this is the right mailing list or not, but I am
>> trying to get Varnish working with Supervisord
>> (http://plope.org/software/supervisor2/). The point of supervisord
>> is to make sure varnish is always running and restart it even in
>> the case of a crash.
> This is sort of pointless, because Varnish already has its own
> supervisor facility: The management process will restart the worker
> process if it dies.

How do you set up Varnish to automatically restart if it dies? We
recently had a crash where the varnish process didn't restart by
itself, so I'm very interested if there's sonething we can do to make
sure it keeps running.

Anyway - I found the final entries in the varnishncsa-log to be kind
of interesting...

--8<--
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 4378 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 16500 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 8077 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 3989 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 9087 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 9709 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 3278 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 3894 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 20217 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 8145 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 4638 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 8611 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 6313 "-" "-"
195.1.193.62 - - [10/Apr/2007:15:24:39 +0200] "" 200 23572 "-" "-"
--8<--

--
Trond Michelsen
Varnishd and Supervisord [ In reply to ]
In message <20070420105517.GF15752 at crusaders.no>, Trond Michelsen writes:
>On Thu, Apr 19, 2007 at 06:02:15PM +0000, Poul-Henning Kamp wrote:

>> This is sort of pointless, because Varnish already has its own
>> supervisor facility: The management process will restart the worker
>> process if it dies.
>
>How do you set up Varnish to automatically restart if it dies?

It should be the default, but the parameter auto_restart can
be used to disable it.

>We recently had a crash where the varnish process didn't restart by
>itself, so I'm very interested if there's sonething we can do to make
>sure it keeps running.
>
>Anyway - I found the final entries in the varnishncsa-log to be kind
>of interesting...

When you have a crash, run "varnishlog -d" to get a snapshot of
the "real" log, that would be much more helpful for debugging.

--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
Varnishd and Supervisord [ In reply to ]
Poul-Henning Kamp wrote:
> This is sort of pointless, because Varnish already has its own
> supervisor facility: The management process will restart
> the worker process if it dies.

Well, I was more worried about the management process dying for no good
reason. I would imagine that it would be stable, but It would be nice to
get supervisord running with varnish for some other reasons as well.

> I havn't tried this, but you could try to run it as:
>
> echo "start" | varnishd -d -d
>
> You will want to use the double -d option for something like
> this

Sadly, that didn't work.

-- james
Varnishd and Supervisord [ In reply to ]
James <james at nyi.net> writes:
> Well, I was more worried about the management process dying for no
> good reason. I would imagine that it would be stable, but It would be
> nice to get supervisord running with varnish for some other reasons as
> well.

Please open a ticket requesting supervisord interoperability, and we
will consider it for 1.1 / 2.0.

DES
--
Dag-Erling Sm?rgrav
Senior Software Developer
Linpro AS - www.linpro.no