From 2afcba1eb72b10cec410759d642688f96f9341e4 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Tue, 19 Aug 2025 15:23:21 +0200 Subject: [PATCH] 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. is the first added column. It represents the number of active streams on a server. is the second added column. This is a recently added value which account private idle connections referencing a server. --- doc/management.txt | 3 +++ src/proxy.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/management.txt b/doc/management.txt index 3766b6f63..19ba7f00c 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -3289,9 +3289,12 @@ show servers conn [] 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 diff --git a/src/proxy.c b/src/proxy.c index 028d2ac14..05a91355d 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -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)