Back to Blog
DevOps & Linux 2025-09-22 15 min read

Linux Kernel Tuning for High-Performance VoIP Servers

Sunil Kumar Nayak
VoIP & Software Engineer

Throughput vs. Latency

Most Linux distributions (Ubuntu, Debian, CentOS) come out of the box tuned for file servers or web servers: they want to move as much data as possible (Throughput). They buffer data to do this.

VoIP hates buffering. In VoIP, a packet that arrives 200ms late is worse than a lost packet. We need to tune the kernel for Real-Time (Latency) performance.

1. Disable Power Saving (C-States)

Modern CPUs love to sleep to save power. When a packet arrives, the CPU has to "wake up", which takes microseconds. For millions of packets, this adds up to jitter.

Edit /etc/default/grub and add:

intel_idle.max_cstate=1 processor.max_cstate=1

This forces the CPU to stay awake and ready to process RTP packets instantly.

2. Interrupt Affinity (SMP Affinity)

By default, one CPU core usually handles all network interrupts. At high loads, this one core hits 100% while others sit idle.

Linux Kernel Tuning Dashboard

Use irqbalance or manually script the SMP affinity to distribute the network card's queues across multiple cores. This is critical for scaling past 2,000 concurrent calls.

3. UDP Buffer Sizes

RTP uses UDP. The default Linux UDP buffers are tiny. Increase them to avoid packet loss at the socket layer.

net.ipv4.udp_mem = 65536 131072 262144
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384

Conclusion

Tuning Linux for VoIP is an art of removing bottlenecks and disabling "helpful" features like power saving that introduce latency.


References