OK. Thank you for detailed answer.
Let me discuss it internally and see what is best way to deal with it. If possible I will try to write up a patch for per socket tcp buffer sizes and submit it to you guys for inclusion in kamailio trunk.
Thank you.
On Tue, May 2, 2017 at 3:19 PM, Daniel-Constantin Mierla miconda@gmail.com wrote:
Hello,
On 02.05.17 13:02, M S wrote:
Hi,
I have a kamailio v4.4.5 deployment that serves TCP clients for SIP and XCAP requests (without SIP presence). The kamailio's core TCP parameters allow us to set TCP read and write buffer sizes which are set globally for all TCP connections.
However, i noticed that in general SIP over TCP request is much smaller (<8KB for audio + video SIP INVITE request) then XCAP requests (say to support up to 500 contacts we need TCP buffers =~ 64KB).
So, if I set global TCP buffer size according to XCAP service needs (e.g. 64KB), they waste too much RAM for SIP connections (assuming max SIP packet is 8KB, there is 56KB buffer space wasted per connection).
On the other hand, if i set global TCP buffer sizes to SIP service needs (e.g. 8KB) then it is insufficient for XCAP (only 70-80 contacts would fix in XCAP list).
Therefore, i am looking for a way to allow TCP buffer size settings per connection OR per module basis. Is it possible? If so then how?
at this moment is not possible to set the buffer size per connection. The connection structure is created before knowing what is going to be received on it.
Also, not per module, because the module is agnostic of the transport layer.
An enhancement might be to specify it per socket, so when listening on port 5060, then use a specific buffer size and when listening on another port like 8060, use a different buffer size. But this requires C coding.
On the other hand, the latest kernels use the physical memory only when writing. So if one allocates 2GB and uses only 10MB, only 10MB are used from the physical memory, the rest is just virtual memory.
Cheers, Daniel
-- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - May 22-24 (USA) - www.asipto.com Kamailio World Conference - May 8-10, 2017 - www.kamailioworld.com
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users