Skip to content

Commit 2afcba1

Browse files
committed
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.
1 parent fac1de9 commit 2afcba1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

doc/management.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3289,9 +3289,12 @@ show servers conn [<backend>]
32893289
port Server's port (or zero if none)
32903290
- Unused field, serves as a visual delimiter
32913291
purge_delay Interval between connection purges, in milliseconds
3292+
served Number of connections currently in use
32923293
used_cur Number of connections currently in use
3294+
note that this excludes conns attached to a session
32933295
used_max Highest value of used_cur since the process started
32943296
need_est Floating estimate of total needed connections
3297+
idle_sess Number of idle connections flagged as private
32953298
unsafe_nb Number of idle connections considered as "unsafe"
32963299
safe_nb Number of idle connections considered as "safe"
32973300
idle_lim Configured maximum number of idle connections

src/proxy.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3038,11 +3038,13 @@ static int dump_servers_state(struct appctx *appctx)
30383038
int thr;
30393039

30403040
chunk_printf(&trash,
3041-
"%s/%s %d/%d %s %u - %u %u %u %u %u %u %d %u",
3041+
"%s/%s %d/%d %s %u - %u %u %u %u %u %u %u %u %d %u",
30423042
HA_ANON_CLI(px->id), HA_ANON_CLI(srv->id),
30433043
px->uuid, srv->puid, hash_ipanon(appctx->cli_ctx.anon_key, srv_addr, 0),
30443044
srv->svc_port, srv->pool_purge_delay,
3045+
srv->served,
30453046
srv->curr_used_conns, srv->max_used_conns, srv->est_need_conns,
3047+
srv->curr_sess_idle_conns,
30463048
srv->curr_idle_nb, srv->curr_safe_nb, (int)srv->max_idle_conns, srv->curr_idle_conns);
30473049

30483050
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)
30723074
chunk_printf(&trash, "%d\n# %s\n", SRV_STATE_FILE_VERSION, SRV_STATE_FILE_FIELD_NAMES);
30733075
else
30743076
chunk_printf(&trash,
3075-
"# 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",
3077+
"# 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",
30763078
global.nbthread);
30773079

30783080
if (applet_putchk(appctx, &trash) == -1)

0 commit comments

Comments
 (0)