/etc/sysctl.conf optimisations

Status
Not open for further replies.

screwloose

Member
Feb 5, 2017
49
9
8
40
Hi Community


I was wondering if anyone has had to make and "optimisations" to their sysctl.conf files for big installations? I recently ran in to a problem with UDP input buffers being full and causing issues with voice quality on a box with 1k+ regs and 80+ active calls at a time.

I couldn’t find a clear guide or info about what i should be changing but after a lot of googling i change a whole bunch of things and the issues seems to have gone away.

So just wondering if anyone else has had these sorts of issues?

Thanks
Andrew
 

Adrian Fretwell

Well-Known Member
Aug 13, 2017
1,416
376
83
Hi Andrew,
I would be interested to know what changes you have made. I am no expert and the network ring buffer setup can get quite complex. Making changes can often make things worse. The obvious change is to make more memory generally available to the buffers with:
net.core.rmem_max

There is a general recommendation to increase this to at least 25mB (26214400), but I am not convinced that we should just blindly do this without good reason. Making the receive buffer 25Mb and then running ten receiver applications will consume 250Mb of physical memory which can end up being wasteful. Too much UDP buffer space can also result in slower recovery from packet loss and/or sequence errors

If buffers are getting full, there may be a good reason, like the server is not processing the requests quickly enough, in which case, under constant load, you will eventually fill the buffer no matter how big it is. You may need to investigate your CPU scheduling or other potential bottlenecks that can hold up the CPU like disk I/O for example.

Without going into a lesson in networking, the two critical elements that affect VoIP the most are bandwidth and latency (CPU latency is linked to network latency, in your own server and in every network router and switch along the way), if you know what your normal average receive udp packet rate (we are interested in bytes per second not bits) is, then you can calculate what your maximum CPU latency can be with:

Latency = Buffer size / UDP Byte rate

So, if you know what your maximum UDP rate is likely to be and you have an idea about your CPU speed or scheduling for a given process (latency), then you can calculate the UDP buffer size by turning the equation around:

Buffer size = Latency * UDP Byte rate

The above is just to illustrate the concept, if you are going to do this, get some professional advice, there are other factors to cosider especially if you have UDP recievers running with different CPU priorities.

It is important that we don't consume extra network bandwith with UDP re-transmissions caused by buffer overflow if the overflow can be prevented. - This can be a vicious circle.

Sorry, I have waffled on a bit here, I hope it makes sense - I've not had my morning coffee yet!

This thread may be helpful, I put up a link to the FreeSWITCH performance, testing and configuration pages:
https://www.pbxforums.com/threads/performance-tuning-fusionpbx.3547/#post-12169
 
Status
Not open for further replies.