Reference

shutdown session

Terminology change

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

Terminate a client’s stream.

Description Jump to heading

When a client connects to the load balancer, the load balancer maintains a stream with that client until their connection with the backend server has finished. You can see active streams with the show sess command. Use shutdown session to stop a specific stream. Streams were formerly called sessions.

Examples Jump to heading

Use show sess to display a list of active streams:

nix
echo "show sess" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show sess" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
0x55f09d21c9e0: proto=tcpv4 src=192.168.50.1:50613 fe=fe_main be=websocket srv=s1 ts=00 age=39s calls=5 rate=0 cpu=0 lat=0 rq[f=8848000h,i=0,an=00h,rx=59m20s,wx=,ax=] rp[f=88048000h,i=0,an=00h,rx=59m20s,wx=,ax=] s0=[8,200008h,fd=19,ex=] s1=[8,200118h,fd=21,ex=] exp=59m20s
0x55f09d22a0f0: proto=unix_stream src=unix:1 fe=GLOBAL be=<NONE> srv=<none> ts=404 age=0s calls=1 rate=1 cpu=0 lat=0 rq[f=c4c223h,i=0,an=00h,rx=,wx=,ax=] rp[f=80008002h,i=0,an=00h,rx=,wx=,ax=] s0=[8,280008h,fd=18,ex=] s1=[8,204018h,fd=-1,ex=] exp=10m
output
text
0x55f09d21c9e0: proto=tcpv4 src=192.168.50.1:50613 fe=fe_main be=websocket srv=s1 ts=00 age=39s calls=5 rate=0 cpu=0 lat=0 rq[f=8848000h,i=0,an=00h,rx=59m20s,wx=,ax=] rp[f=88048000h,i=0,an=00h,rx=59m20s,wx=,ax=] s0=[8,200008h,fd=19,ex=] s1=[8,200118h,fd=21,ex=] exp=59m20s
0x55f09d22a0f0: proto=unix_stream src=unix:1 fe=GLOBAL be=<NONE> srv=<none> ts=404 age=0s calls=1 rate=1 cpu=0 lat=0 rq[f=c4c223h,i=0,an=00h,rx=,wx=,ax=] rp[f=80008002h,i=0,an=00h,rx=,wx=,ax=] s0=[8,280008h,fd=18,ex=] s1=[8,204018h,fd=-1,ex=] exp=10m

The first field is the stream’s unique identifier, which you can pass to shutdown session to terminate the stream:

nix
echo "shutdown session 0x55f09d21c9e0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "shutdown session 0x55f09d21c9e0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999

See also Jump to heading

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