← 返回命令列表

Linux command

varnishstat 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Display live statistics

varnishstat

Print statistics once and exit

varnishstat -1

Output as JSON

varnishstat -j

Output as XML

varnishstat -x

Show specific fields

varnishstat -f [MAIN.cache_hit,MAIN.cache_miss]

List available fields

varnishstat -l

Connect to specific instance

varnishstat -n [instance_name]

说明

varnishstat displays real-time statistics from a running Varnish cache server. It shows cache hit/miss rates, connection counts, backend health, and numerous performance counters. In curses mode, statistics update continuously with the selected counter's description at the bottom. One-shot mode (-1) prints all counters once for scripting. JSON and XML outputs enable integration with monitoring systems. Key metrics include client requests, cache hit ratio, backend connections, and memory usage. Monitoring these helps identify performance bottlenecks and capacity issues.

参数

-1
Print statistics once and exit.
-j
Output as JSON format.
-x
Output as XML format.
-f _field_
Filter to specific fields (glob pattern).
-I _glob_
Include fields matching glob.
-X _glob_
Exclude fields matching glob.
-l
List available field names.
-n _name_
Connect to specified varnishd instance.
-t _seconds_
Timeout for acquiring shared memory lock.

FAQ

What is the varnishstat command used for?

varnishstat displays real-time statistics from a running Varnish cache server. It shows cache hit/miss rates, connection counts, backend health, and numerous performance counters. In curses mode, statistics update continuously with the selected counter's description at the bottom. One-shot mode (-1) prints all counters once for scripting. JSON and XML outputs enable integration with monitoring systems. Key metrics include client requests, cache hit ratio, backend connections, and memory usage. Monitoring these helps identify performance bottlenecks and capacity issues.

How do I run a basic varnishstat example?

Run `varnishstat` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -1 do in varnishstat?

Print statistics once and exit.