We are using stick table with Websocket. Although haproxy stats page shows
correct session rate, current session info but all counters are zero in
stick table.
backend websocket
balance leastconn
stick-table type string len 12 size 32m expire 7d peers mypeers store
server_id,conn_cnt,conn_cur,sess_cnt,http_req_cnt,bytes_in_cnt,bytes_out_cnt
stick on hdr(host)
default-server on-marked-down shutdown-sessions
## websocket protocol validation
acl hdr_connection_upgrade hdr(Connection) -i upgrade
acl hdr_upgrade_websocket hdr(Upgrade) -i websocket
acl hdr_websocket_key hdr_cnt(Sec-WebSocket-Key) eq 1
acl hdr_websocket_version hdr_cnt(Sec-WebSocket-Version) eq 1
http-request deny if ! hdr_connection_upgrade ! hdr_upgrade_websocket !
hdr_websocket_key ! hdr_websocket_version
## websocket health checking
option httpchk GET / HTTP/1.1\r\nHost: abc.com\r\nSec-WebSocket-Version:
13\r\nSec-WebSocket-Key: haproxytest6Lwghaproxyhh\r\nConnection:
Upgrade\r\nUpgrade: websocket http-check expect status 101
## Servers
server one x.x.x.x:y check
server two x.x.x.x:y check
...
...
Stick Table
# table: websocket, type: string, size:33554432, used:2
0x1363374: key=159256323654 use=0 exp=604357344 server_id=2 conn_cnt=0
conn_cur=0 sess_cnt=0 http_req_cnt=0 bytes_in_cnt=0 bytes_out_cnt=0
0x137eeb4: key=215334743731 use=0 exp=604523738 server_id=3 conn_cnt=0
conn_cur=0 sess_cnt=0 http_req_cnt=0 bytes_in_cnt=0 bytes_out_cnt=0
Jai