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

Dridi Boukelmoune dridi at varni.sh
Wed Dec 18 20:40:29 UTC 2019


Hello Carlos,

On Wed, Dec 18, 2019 at 4:04 PM Carlos Abalde <carlos.abalde at 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 at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


More information about the varnish-misc mailing list