Varnish scoreboard

Description

The varnishscoreboard utility displays Varnish tasks, the scheduled tasks managed by the thread pools workers in the varnishd cache process. It can report ongoing, waiting and queued tasks with some information about them. In addition to tasks, it accounts for the number of idle workers, threads without a task to run.

Example output:

Age    Type     State      Transaction Parent    Address              Description
 1.23w acceptor accept               0         0 127.0.0.1:9132       a0 127.0.0.1:9132 (pool 0)
 0.01s acceptor accept               0         0 0.0.0.0:80           a1 :80 (pool 0)
 1.50s acceptor accept               0         0 :::80                a1 :80 (pool 0)
 0.05s acceptor accept               0         0 0.0.0.0:443          a2 :443 (pool 0)
 1.23w acceptor accept               0         0 :::443               a2 :443 (pool 0)
34.29m session  newreq       852286938         0 27.28.65.173:58158   HTTP/1.1 session
 0.45s client   fetch        866789899 865203926 18.52.75.82:32906    GET foo.example.com /path/to/some/file.html
 5.09m session  newreq       821581714         0 207.121.123.36:49916 HTTP/1.1 session
 0.01s backend  startfetch   865732441 865732440 -                    GET api.internal.net /index.html

If the output instead show this message, check man varnishd or the thread_pool_track and vst_space sections below:

Child not running or not tracking tasks
Check thread_pool_track and vst_space parameters

varnishd parameters

thread_pool_track

varnishscoreboard requires varnishd’s thread tracking to be active (it’s default since Varnish 6.0.14r6). You can check and enable thread tracking with:

# check the current value
varnishadm param.show thread_pool_track

# modify it at runtime (will be reset after a restart)
varnishadm param.set thread_pool_track on

# to make it permanent, use varnishd's -p argument
varnishd ... -p thread_pool_track=on

Thread tracking is extremely light on resources and it almost never makes sense to disable it, but you can:

varnishadm param.set thread_pool_track off

vst_space

Only a limited amount of tasks can be tracked and the amount of memory allocated to tracking is controlled by the vst_space parameter. The default is 10MB and is sufficient for most setups, but you can adjust it between 1MB and 100MB, or disable it altogether at run time:

varnishd ... -p vst_space=50MB
# or
varnishd ... -p vst_space=none

One VST segment is allocated per thread pool at start time, so you can’t use varnishadm param.set to modify it at run time, but you can check the value:

varnishadm param.show vst_space

Synopsis

varnishscoreboard [-h] [-n <dir>] [-t <seconds|off>] [-V]

Options

The following options are available:

-h

Print program usage and exit

-n <dir>

Specify the varnishd working directory (also known as instance name) to get logs from. If -n is not specified, the host name is used.

-t <seconds|off>

Timeout before returning error on initial VSM connection. If set the VSM connection is retried every 0.5 seconds for this many seconds. If zero the connection is attempted only once and will fail immediately if unsuccessful. If set to “off”, the connection will not fail, allowing the utility to start and wait indefinitely for the Varnish instance to appear. Defaults to 5 seconds.

-V

Print version information and exit.

--optstring

Print the optstring parameter to getopt(3) to help writing wrapper scripts.

Notes

Starting from Varnish release 6.0.7r1 (2020-12-21) the parameter names scoreboard_active and scoreboard_enable are deprecated aliases of vst_space and thread_pool_track respectively. scoreboard_active maps on to vst_space 10M and off to vst_space none.


®Varnish Software, Wallingatan 12, 111 60 Stockholm, Organization nr. 556805-6203