MINOR: proxy: extend "show servers conn" output

CLI command "show servers conn" is used as a debugging tool to monitor
the number of connections per server. This patch extends its output by
adding the content of two server counters.

<served> is the first added column. It represents the number of active
streams on a server. <curr_sess_idle_conns> is the second added column.
This is a recently added value which account private idle connections
referencing a server.
This commit is contained in:
Amaury Denoyelle 2025-08-19 15:23:21 +02:00
parent fac1de935a
commit 2afcba1eb7
2 changed files with 7 additions and 2 deletions

View File

@ -3289,9 +3289,12 @@ show servers conn [<backend>]
port Server's port (or zero if none)
- Unused field, serves as a visual delimiter
purge_delay Interval between connection purges, in milliseconds
served Number of connections currently in use
used_cur Number of connections currently in use
note that this excludes conns attached to a session
used_max Highest value of used_cur since the process started
need_est Floating estimate of total needed connections
idle_sess Number of idle connections flagged as private
unsafe_nb Number of idle connections considered as "unsafe"
safe_nb Number of idle connections considered as "safe"
idle_lim Configured maximum number of idle connections

View File

@ -3038,11 +3038,13 @@ static int dump_servers_state(struct appctx *appctx)
int thr;
chunk_printf(&trash,
"%s/%s %d/%d %s %u - %u %u %u %u %u %u %d %u",
"%s/%s %d/%d %s %u - %u %u %u %u %u %u %u %u %d %u",
HA_ANON_CLI(px->id), HA_ANON_CLI(srv->id),
px->uuid, srv->puid, hash_ipanon(appctx->cli_ctx.anon_key, srv_addr, 0),
srv->svc_port, srv->pool_purge_delay,
srv->served,
srv->curr_used_conns, srv->max_used_conns, srv->est_need_conns,
srv->curr_sess_idle_conns,
srv->curr_idle_nb, srv->curr_safe_nb, (int)srv->max_idle_conns, srv->curr_idle_conns);
for (thr = 0; thr < global.nbthread && srv->curr_idle_thr; thr++)
@ -3072,7 +3074,7 @@ static int cli_io_handler_servers_state(struct appctx *appctx)
chunk_printf(&trash, "%d\n# %s\n", SRV_STATE_FILE_VERSION, SRV_STATE_FILE_FIELD_NAMES);
else
chunk_printf(&trash,
"# bkname/svname bkid/svid addr port - purge_delay used_cur used_max need_est unsafe_nb safe_nb idle_lim idle_cur idle_per_thr[%d]\n",
"# bkname/svname bkid/svid addr port - purge_delay served used_cur used_max need_est idle_sess unsafe_nb safe_nb idle_lim idle_cur idle_per_thr[%d]\n",
global.nbthread);
if (applet_putchk(appctx, &trash) == -1)