After carrying out some load tests using the Websocket module, I noticed that sometimes the websocket:closed event is not triggered.
This problem seems to be particularly noticeable when the load is high and simultaneous. Example: 1000 records simultaneously.
In the tests carried out, I realized that the number of times the event is not triggered is small, in the order of [1-10]/1000.
I check that when I do a ws.dump I don't have any active connections, and I confirm that they are all effectively cleaned (netstat -ano | grep 8061).
However, the event is not triggered for some connections.
I can see this in the logs, and also when i display the content of an hash table, i'm dropping key inside websocket:closed event.
Troubleshooting
The troubleshooting was simplistic, i.e. I ran the same test n times, and validated that the event was triggered for all connections, the number of ws connections listed by Kamailio, and the open connections.
Reproduction
To reproduce, we can use any mechanism that emulates the use of the Websocket module.
For example, I used the sipexer tool to create wss connections with Kamailio, forcing simultaneous registrations.
Description
After carrying out some load tests using the
Websocket
module, I noticed that sometimes thewebsocket:closed
event is not triggered.This problem seems to be particularly noticeable when the load is high and simultaneous. Example: 1000 records simultaneously.
In the tests carried out, I realized that the number of times the event is not triggered is small, in the order of [1-10]/1000.
I check that when I do a
ws.dump
I don't have any active connections, and I confirm that they are all effectively cleaned (netstat -ano | grep 8061
). However, the event is not triggered for some connections. I can see this in the logs, and also when i display the content of an hash table, i'm dropping key insidewebsocket:closed
event.Troubleshooting
The troubleshooting was simplistic, i.e. I ran the same test n times, and validated that the event was triggered for all connections, the number of
ws
connections listed byKamailio
, and the open connections.Reproduction
To reproduce, we can use any mechanism that emulates the use of the
Websocket
module.For example, I used the
sipexer
tool to createwss
connections withKamailio
, forcing simultaneous registrations.Example command:
sipexer -cb -mt register -ex 60 -au <user> -ap <pass> -fuser example -fd mydomain -wso https://10.0.0.12:10000 -ruri sip:kamailio -su wss://kamailio:8061
Kamailio TLS listener:
listen=tls:10.0.0.12:8061 advertise PUBLIC_IP
Websocket module:
Debugging Data
Log Messages
Nothing relevant.
SIP Traffic
Nothing relevant here, the SIP Flow is OK.
Additional Information