Mailing List Archive

How to discover manager & worker PIDs given a Varnish Cache instance name?
Hi,

Simple question related with Varnish Cache and monitoring. Let's assume a single server running one or more Varnish Cache instances. Given the name of one instance (i.e. '-n' argument), is there any reasonable way (e.g. via varnishadm) to discover the PIDs of the associated manager and worker processes?

The goal is to find those PIDs in order to fetch detailed memory usage stats (virtual, resident, shared, etc.) of the associated Varnish Cache instance and then feed the monitoring agent with that info.

Thanks,

--
Carlos Abalde
Re: How to discover manager & worker PIDs given a Varnish Cache instance name? [ In reply to ]
Hello Carlos,

On Wed, Dec 18, 2019 at 4:04 PM Carlos Abalde <carlos.abalde@gmail.com> wrote:
>
> Hi,
>
> Simple question related with Varnish Cache and monitoring. Let's assume a single server running one or more Varnish Cache instances. Given the name of one instance (i.e. '-n' argument), is there any reasonable way (e.g. via varnishadm) to discover the PIDs of the associated manager and worker processes?
>
> The goal is to find those PIDs in order to fetch detailed memory usage stats (virtual, resident, shared, etc.) of the associated Varnish Cache instance and then feed the monitoring agent with that info.

You can try this:

> $ cat test.vtc
> varnishtest "dude, where's my pid?"
>
> varnish v1 -vcl {backend be { .host = "${bad_backend}"; }} -start
>
> shell {
> # manager
> cat ${v1_name}/_.pid
> echo
> # child
> awk '$1 == "#" {print $2}' ${v1_name}/_.vsm_child/_.index
> }
>
> $ varnishtest -v test.vtc | grep shell_out
> **** top shell_out|2038076
> **** top shell_out|2038088

Not the best interface for the child, I must admit :)

Dridi

> Thanks,
>
> --
> Carlos Abalde
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc@varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: How to discover manager & worker PIDs given a Varnish Cache instance name? [ In reply to ]
Hi Dridi,

It's ugly as hell, but it works. Sadly not an option for 4.1.

Thanks a lot,

--
Carlos Abalde

> On 18 Dec 2019, at 21:40, Dridi Boukelmoune <dridi@varni.sh> wrote:
>
> Hello Carlos,
>
> On Wed, Dec 18, 2019 at 4:04 PM Carlos Abalde <carlos.abalde@gmail.com> wrote:
>>
>> Hi,
>>
>> Simple question related with Varnish Cache and monitoring. Let's assume a single server running one or more Varnish Cache instances. Given the name of one instance (i.e. '-n' argument), is there any reasonable way (e.g. via varnishadm) to discover the PIDs of the associated manager and worker processes?
>>
>> The goal is to find those PIDs in order to fetch detailed memory usage stats (virtual, resident, shared, etc.) of the associated Varnish Cache instance and then feed the monitoring agent with that info.
>
> You can try this:
>
>> $ cat test.vtc
>> varnishtest "dude, where's my pid?"
>>
>> varnish v1 -vcl {backend be { .host = "${bad_backend}"; }} -start
>>
>> shell {
>> # manager
>> cat ${v1_name}/_.pid
>> echo
>> # child
>> awk '$1 == "#" {print $2}' ${v1_name}/_.vsm_child/_.index
>> }
>>
>> $ varnishtest -v test.vtc | grep shell_out
>> **** top shell_out|2038076
>> **** top shell_out|2038088
>
> Not the best interface for the child, I must admit :)
>
> Dridi
>
>> Thanks,
>>
>> --
>> Carlos Abalde
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc@varnish-cache.org
>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc