Reference

show servers conn

Available since

  • HAProxy 2.2
  • HAProxy Enterprise 2.2r1

Dump the current and idle connections for a backend or backends.

Description Jump to heading

Use the show servers conn command to display the current and idle connections state of the servers belonging to all backends.

Use the show servers conn <backend> to display the current and idle connections state of the servers belonging to the specified backend.

Caution

This command should be used for debugging only; it shouldn’t be regularly used for monitoring. The values will change depending on the number and behavior of the load balancer’s threads. There will be as many columns for idle_per_thread[n] are there are n threads. Note that because of the interactions between the threads and the idle connections, calling this command may increment the idle connection counts, and therefore, produce counts that may not be what you expect.

Examples Jump to heading

The following example displays current and idle sessions for all backends.

nix
echo -e "show servers conn" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo -e "show servers conn" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
# 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[1]
be_api/api1 3/1 127.0.0.1 88 - 5000 0 1 1 0 1 -1 1 1
be_api/api2 3/2 127.0.0.1 88 - 5000 0 1 1 0 1 -1 1 1
be_static/static1 5/1 127.0.0.1 4331 - 5000 0 1 1 0 0 -1 0 0
be_static/static2 5/2 127.0.0.1 4331 - 5000 0 1 1 0 0 -1 0 0
output
text
# 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[1]
be_api/api1 3/1 127.0.0.1 88 - 5000 0 1 1 0 1 -1 1 1
be_api/api2 3/2 127.0.0.1 88 - 5000 0 1 1 0 1 -1 1 1
be_static/static1 5/1 127.0.0.1 4331 - 5000 0 1 1 0 0 -1 0 0
be_static/static2 5/2 127.0.0.1 4331 - 5000 0 1 1 0 0 -1 0 0

The following example displays current and idle sessions for a backend named be_api.

nix
echo -e "show servers conn be_api" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo -e "show servers conn be_api" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
# 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[1]
be_api/api1 3/1 127.0.0.1 88 - 5000 0 1 2 0 2 -1 2 2
be_api/api2 3/2 127.0.0.1 88 - 5000 0 2 2 0 2 -1 2 2
output
text
# 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[1]
be_api/api1 3/1 127.0.0.1 88 - 5000 0 1 2 0 2 -1 2 2
be_api/api2 3/2 127.0.0.1 88 - 5000 0 2 2 0 2 -1 2 2

See also Jump to heading

Do you have any suggestions on how we can improve the content of this page?