Reference

show sess

Terminology change

  • As of HAProxy 2.9 and HAProxy Enterprise 2.9r1, sessions are replaced with streams.

Display all clients that have ongoing active streams (formerly called sessions) connected to the load balancer.

Description Jump to heading

Display all clients that have ongoing active streams connected to the load balancer. This information is useful for the HAProxy Technologies development and support teams. The output may change from version to version.

When a client connects to the load balancer, the load balancer maintains the stream with the client until their connection with the backend server has finished. To use the show sess command, the level parameter on the stats socket line must be operator or admin. It displays all active streams that are currently connected to the load balancer.

Examples Jump to heading

All streams Jump to heading

Dumping multiple streams can produce an excessive amount of output and consume an excessive amount of time and CPU resources. It is recommended that you dump the minimum required stream information.

In the example below, there are two active streams. The first is a TCP connection and the second is a UNIX socket stream (the Runtime API connection itself):

nix
# Show all by default:
echo "show sess" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
# Show all by specifying all parameter (version 2.9r1 only):
echo "show sess all" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
# Show all by default:
echo "show sess" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
# Show all by specifying all parameter (version 2.9r1 only):
echo "show sess all" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
0x7fa44c02a470: proto=tcpv4 src=192.168.50.1:62423 fe=fe_main be=websocket srv=server1 ts=00 age=16s calls=5 rate=0 cpu=0 lat=0 rq[f=8848000h,i=0,an=00h,rx=59m55s,wx=,ax=] rp[f=88048202h,i=0,an=00h,rx=59m55s,wx=,ax=] s0=[8,200008h,fd=19,ex=] s1=[8,200118h,fd=20,ex=] exp=59m50s
0x55e4db986ba0: proto=unix_stream src=unix:1 fe=GLOBAL be=<NONE> srv=<none> ts=00 age=0s calls=2 rate=2 cpu=0 lat=0 rq[f=c4c220h,i=0,an=00h,rx=,wx=,ax=] rp[f=80008002h,i=0,an=00h,rx=,wx=,ax=] s0=[8,280008h,fd=23,ex=] s1=[8,204018h,fd=-1,ex=] exp=10m
output
text
0x7fa44c02a470: proto=tcpv4 src=192.168.50.1:62423 fe=fe_main be=websocket srv=server1 ts=00 age=16s calls=5 rate=0 cpu=0 lat=0 rq[f=8848000h,i=0,an=00h,rx=59m55s,wx=,ax=] rp[f=88048202h,i=0,an=00h,rx=59m55s,wx=,ax=] s0=[8,200008h,fd=19,ex=] s1=[8,200118h,fd=20,ex=] exp=59m50s
0x55e4db986ba0: proto=unix_stream src=unix:1 fe=GLOBAL be=<NONE> srv=<none> ts=00 age=0s calls=2 rate=2 cpu=0 lat=0 rq[f=c4c220h,i=0,an=00h,rx=,wx=,ax=] rp[f=80008002h,i=0,an=00h,rx=,wx=,ax=] s0=[8,280008h,fd=23,ex=] s1=[8,204018h,fd=-1,ex=] exp=10m

Single stream Jump to heading

Display details for a single stream by specifying the stream identifier:

nix
# show sess <ID>
echo "show sess 0x7f42a0048050" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
# show sess <ID>
echo "show sess 0x7f42a0048050" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
0x7f42a0048050: [14/Jun/2023:17:15:04.943049] id=4478 proto=unix_stream source=unix:1
flags=0x8, conn_retries=0, conn_exp=<NEVER> conn_et=0x000 srv_conn=(nil), pend_pos=(nil) waiting=0 epoch=0x21
frontend=GLOBAL (id=0 mode=tcp), listener=? (id=1) addr=unix:1
output
text
0x7f42a0048050: [14/Jun/2023:17:15:04.943049] id=4478 proto=unix_stream source=unix:1
flags=0x8, conn_retries=0, conn_exp=<NEVER> conn_et=0x000 srv_conn=(nil), pend_pos=(nil) waiting=0 epoch=0x21
frontend=GLOBAL (id=0 mode=tcp), listener=? (id=1) addr=unix:1

Streams by age Jump to heading

Available in

  • HAProxy 2.9
  • HAProxy Enterprise 2.9r1

Display only streams older than <age> (in seconds by default):

nix
# show sess <age>
echo "show sess 2" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
# show sess <age>
echo "show sess 2" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
0x7f42a0048050: [14/Jun/2023:17:15:04.943049] id=4478 proto=unix_stream source=unix:1
flags=0x8, conn_retries=0, conn_exp=<NEVER> conn_et=0x000 srv_conn=(nil), pend_pos=(nil) waiting=0 epoch=0x21
frontend=GLOBAL (id=0 mode=tcp), listener=? (id=1) addr=unix:1
output
text
0x7f42a0048050: [14/Jun/2023:17:15:04.943049] id=4478 proto=unix_stream source=unix:1
flags=0x8, conn_retries=0, conn_exp=<NEVER> conn_et=0x000 srv_conn=(nil), pend_pos=(nil) waiting=0 epoch=0x21
frontend=GLOBAL (id=0 mode=tcp), listener=? (id=1) addr=unix:1

Suspicious streams Jump to heading

Available in

  • HAProxy 2.9
  • HAProxy Enterprise 2.9r1

Specify the susp parameter to report streams that are considered suspicious by developers. The criteria for this consideration may change from version to version.

nix
echo "show sess susp" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show sess susp" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
0x7f42a0048050: [14/Jun/2023:17:15:04.943049] id=4478 proto=unix_stream source=unix:1
flags=0x8, conn_retries=0, conn_exp=<NEVER> conn_et=0x000 srv_conn=(nil), pend_pos=(nil) waiting=0 epoch=0x21
frontend=GLOBAL (id=0 mode=tcp), listener=? (id=1) addr=unix:1
output
text
0x7f42a0048050: [14/Jun/2023:17:15:04.943049] id=4478 proto=unix_stream source=unix:1
flags=0x8, conn_retries=0, conn_exp=<NEVER> conn_et=0x000 srv_conn=(nil), pend_pos=(nil) waiting=0 epoch=0x21
frontend=GLOBAL (id=0 mode=tcp), listener=? (id=1) addr=unix:1

See also Jump to heading

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