Back to articles
AI & Cloud

Optimizing Linux VPS with Liquorix Kernel: Reducing Absolute Latency for Real-Time Web and VoIP

A detailed guide on optimizing Linux VPS using the Liquorix kernel to reduce absolute latency and improve performance for real-time applications like web and VoIP.

DPTCloud Engineering4 min read
Optimizing Linux VPS with Liquorix Kernel: Reducing Absolute Latency for Real-Time Web and VoIP

Optimizing Linux VPS with Liquorix Kernel

To achieve maximum performance for real-time applications such as web, VoIP, and latency-sensitive network services, optimizing the operating system is essential. Among specialized Linux kernels, Liquorix stands out as a performance-optimized solution for VPS environments, specifically designed to reduce absolute latency. This guide walks through installing and configuring the Liquorix kernel on a Linux VPS to enhance performance for real-time applications.

Why Choose the Liquorix Kernel?

Liquorix is a Linux kernel built from the official Ubuntu kernel, with specific optimizations focused on performance and reduced latency. Key improvements include:

  • Adjusted CPU and memory control parameters to minimize interrupt latency.
  • Optimized memory caching and process management for higher throughput.
  • Integration with preempt-rt to support real-time operations.
  • Best suited for latency-sensitive applications such as VoIP, streaming, and real-time APIs.

Preparation and Installation of Liquorix Kernel

To install the Liquorix kernel, you need a VPS running Ubuntu 20.04 or 22.04. Begin by updating the system:

sudo apt update && sudo apt upgrade -y

Add the Liquorix repository:

echo "deb http://liquorix.net/debian $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/liquorix.list
wget -qO - https://liquorix.net/liquorix.key | sudo apt-key add -

Install the kernel and headers:

sudo apt update
sudo apt install linux-image-liquorix-amd64 linux-headers-liquorix-amd64 -y

After installation, reboot the system to load the new kernel:

sudo reboot

Configuration and Performance Testing

After reboot, verify the current kernel:

uname -r

To measure latency, use tools like latencytop or rt-tests:

sudo apt install latencytop -y
latencytop

Run a latency test:

sudo apt install rt-tests -y
./latencytop

To measure actual network latency and response, use ping and iperf3:

ping -c 10 google.com
iperf3 -c 

Reducing Absolute Latency

To reduce absolute latency, apply the following changes in /etc/sysctl.conf:

vm.swappiness = 10
vm.dirty_ratio = 10
vm.dirty_background_ratio = 5
net.core.netdev_max_backlog = 5000
net.core.somaxconn = 65535

Apply the changes:

sudo sysctl -p

Also, configure cpufreq to keep the CPU at high clock speed:

sudo apt install cpufrequtils -y
sudo cpufreq-set -g performance

Troubleshooting and Verification

If the kernel fails to boot, enter recovery mode and select the default kernel. Check logs:

dmesg | grep -i "error"

If memory-related issues occur, run free -h and adjust vm.swappiness accordingly.

References

Related infrastructure & engineering guides: High-RAM Cloud VPS for Self-Hosted LLMs & API Gateways

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478