Reference
show activity
Available since
- HAProxy 1.9
- HAProxy Enterprise 1.9r1
Report counters related to internal process events.
Description Jump to heading
Report counters related to internal process events of interest to developers and experienced troubleshooters.
Output consists of one line per metric accompanied by per-thread counters. Counters are 32 bit and wrap during the process’s lifetime. Counters may be reset with the clear counters
command.
As of version 2.7r1
, on multi-threaded deployments, the first column indicates the total (or average, depending on the nature of the metric) for all threads. The list of all threads’ values is represented between square brackets in the thread order.
Optionally, specify an argument:
- Specify a thread number to dump only that thread.
- Specify
0
to report the aggregated value (column 1). - Specify
-1
to display all columns (the default).
Examples Jump to heading
Show all counters.
nix
echo "show activity" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show activity" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtext
thread_id: 2 (1..2)date_now: 1681763277.330557uptime_now: 17139.720847ctxsw: 34033 [ 34021 12 ]tasksw: 34030 [ 34020 10 ]empty_rq: 289 [ 1 288 ]long_rq: 0 [ 0 0 ]loops: 17316 [ 17020 296 ]wake_tasks: 0 [ 0 0 ]wake_signal: 0 [ 0 0 ]poll_io: 3407 [ 3404 3 ]poll_exp: 0 [ 0 0 ]poll_drop_fd: 0 [ 0 0 ]poll_skip_fd: 0 [ 0 0 ]conn_dead: 0 [ 0 0 ]stream_calls: 17025 [ 17024 1 ]pool_fail: 0 [ 0 0 ]buf_wait: 0 [ 0 0 ]cpust_ms_tot: 0 [ 0 0 ]cpust_ms_1s: 0 [ 0 0 ]cpust_ms_15s: 0 [ 0 0 ]avg_loop_us: 75 [ 143 7 ]accepted: 2 [ 0 2 ]accq_pushed: 2 [ 1 1 ]accq_full: 0 [ 0 0 ]accq_ring: 0 [ 0 0 ]fd_takeover: 0 [ 0 0 ]
outputtext
thread_id: 2 (1..2)date_now: 1681763277.330557uptime_now: 17139.720847ctxsw: 34033 [ 34021 12 ]tasksw: 34030 [ 34020 10 ]empty_rq: 289 [ 1 288 ]long_rq: 0 [ 0 0 ]loops: 17316 [ 17020 296 ]wake_tasks: 0 [ 0 0 ]wake_signal: 0 [ 0 0 ]poll_io: 3407 [ 3404 3 ]poll_exp: 0 [ 0 0 ]poll_drop_fd: 0 [ 0 0 ]poll_skip_fd: 0 [ 0 0 ]conn_dead: 0 [ 0 0 ]stream_calls: 17025 [ 17024 1 ]pool_fail: 0 [ 0 0 ]buf_wait: 0 [ 0 0 ]cpust_ms_tot: 0 [ 0 0 ]cpust_ms_1s: 0 [ 0 0 ]cpust_ms_15s: 0 [ 0 0 ]avg_loop_us: 75 [ 143 7 ]accepted: 2 [ 0 2 ]accq_pushed: 2 [ 1 1 ]accq_full: 0 [ 0 0 ]accq_ring: 0 [ 0 0 ]fd_takeover: 0 [ 0 0 ]
uptime_now
was added as of version 2.7r1
.
Show counters for thread 2 only.
nix
echo "show activity 2" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show activity 2" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtext
thread_id: 1 (1..2)date_now: 1681765240.812967uptime_now: 19103.203257ctxsw: 22tasksw: 18empty_rq: 321long_rq: 0loops: 332wake_tasks: 0wake_signal: 0poll_io: 7poll_exp: 0poll_drop_fd: 0poll_skip_fd: 0conn_dead: 0stream_calls: 4pool_fail: 0buf_wait: 0cpust_ms_tot: 0cpust_ms_1s: 0cpust_ms_15s: 0avg_loop_us: 8accepted: 5accq_pushed: 2accq_full: 0accq_ring: 0fd_takeover: 0
outputtext
thread_id: 1 (1..2)date_now: 1681765240.812967uptime_now: 19103.203257ctxsw: 22tasksw: 18empty_rq: 321long_rq: 0loops: 332wake_tasks: 0wake_signal: 0poll_io: 7poll_exp: 0poll_drop_fd: 0poll_skip_fd: 0conn_dead: 0stream_calls: 4pool_fail: 0buf_wait: 0cpust_ms_tot: 0cpust_ms_1s: 0cpust_ms_15s: 0avg_loop_us: 8accepted: 5accq_pushed: 2accq_full: 0accq_ring: 0fd_takeover: 0
See also Jump to heading
Do you have any suggestions on how we can improve the content of this page?