]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: proxy: extend "show servers conn" output
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 19 Aug 2025 13:23:21 +0000 (15:23 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Aug 2025 16:58:11 +0000 (18:58 +0200)
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.

doc/management.txt
src/proxy.c

index 3766b6f63e20a9bc86c96fad680bea1de0f37dea..19ba7f00cceafb47dbebc93d4c25c1cedeb896e7 100644 (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
index 028d2ac149ff32f29209d78d7e5e3f20ecae1062..05a91355df44e21868ce38f9356e26309354cbdf 100644 (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)