[Kamailio-Users] no free tcp receiver
klaus.mailinglists at pernau.at
Tue Dec 2 11:54:18 CET 2008
> Hi all,
> My OpenSER system seems to run out of TCP handlers all the time. It
> looks to me that I need two child processes for each local IP and peer
> combination, because to and back communication do not use the same TCP
Using different TCP connection for sending/receiving is not elegant, but
possible. Nevertheless responses should always be sent via the same TCP
connection as the request.
> I have a lot of TCP clients which would lead to more than 100 child
To handle 1000 TCP connection you do not need 1000 processes. In
Kamailio there is one process which handles all the incoming TCP
messages. As soon as the "TCP receiver" has received enough TCP
fragments to build the whole SIP message, the SIP message is handled
over to one of the "TCP worker" processes. You can identify the
processes using "kamctl ps", e.g.:
# kamctl ps
Process:: ID=0 PID=9280 Type=attendant
Process:: ID=1 PID=9281 Type=SIP receiver udp:188.8.131.52:5060
Process:: ID=2 PID=9282 Type=SIP receiver udp:184.108.40.206:5060
Process:: ID=3 PID=9283 Type=SIP receiver udp:220.127.116.11:5060
Process:: ID=4 PID=9284 Type=SIP receiver udp:18.104.22.168:5060
Process:: ID=5 PID=9285 Type=SIP receiver udp:22.214.171.124:5060
Process:: ID=6 PID=9286 Type=SIP receiver udp:126.96.36.199:5060
Process:: ID=7 PID=9287 Type=SIP receiver udp:188.8.131.52:5060
Process:: ID=8 PID=9288 Type=SIP receiver udp:184.108.40.206:5060
Process:: ID=9 PID=9289 Type=timer
Process:: ID=10 PID=9290 Type=MI FIFO
Process:: ID=11 PID=9291 Type=TCP receiver
Process:: ID=12 PID=9292 Type=TCP receiver
Process:: ID=13 PID=9293 Type=TCP receiver
Process:: ID=14 PID=9294 Type=TCP receiver
Process:: ID=15 PID=9295 Type=TCP main
If a TCP message will be sent, a worker process will lookup for a
existing TCP connection, "put" the TCP connection, send the SIP message
on this TCP connection, and then give the TCP connection back to the "pool".
> Does it make sense to reduce tcp_connection_lifetime?
No. Especially not if TCP is used between clients and the server. Then
the proxy should set the lifetime of the TCP connection to the lifetime
of the registration.
> This would
> increase TCP overhead, but would allow me to have fewer child processes,
No. As said above - with 1 TCP children you can handle lots of TCP
> Any help is welcome. Thanks guys!
btw: do you have any problems at all?
More information about the Users