Deploying a Low Latency Kernel with Ubuntu Server 16.04 LTS
In this brief article I will discuss deploying a low latency kernel for Ubuntu Server 16.04 LTS. This kernel changes the timer frequency from the default 250Hz to 1000Hz. This kernel is also called the “soft real-time kernel” and is forked (and regularly updated) from the generic kernel source tree. This kernel can be useful for all applications that require very low latency response like Asterisk. In this document, I will also describe how to set the lowlatency kernel as the primary kernel, and make sure its update and reboot “proof”. It’s also important to note that this kernel is generally updated days after the generic stock kernel. There’s no need to custom-compile a kernel to achieve higher timer frequency. This approach also assures future kernel updates are quick and painless.
Update the APT Cache
We’re starting with a fresh system, so we should first update the APT cache for good measure.
Install the “linux-lowlatency” package
Use APT to install the “linux-lowlatency” package.
Obtain the “ubuntustudio-default-settings” package from the repository – STEP 1
First, let’s visit https://packages.ubuntu.com/. This step is a little less obvious. The package “ubuntustudio-default-settings” contains a file named “09_lowlatency”. This file is a GRUB configuration file we can use to assure our lowlatency kernel is booted first and assures it will stay that way.
Obtain the “ubuntustudio-default-settings” package from the repository – STEP 2
Search for “ubuntustudio-default-settings” in the search field. Make sure to select “Source package names” and your distribution. Then press “Search”.
Obtain the “ubuntustudio-default-settings” package from the repository – STEP 3
Click on the link named “ubuntustudio-default-settings” to the right of “Binary packages”.
Download the compressed file to your Ubuntu server
We will now download the compressed file to our local system.
Extract files in the downloaded package
Extract the files in the “ubuntustudio-default-settings” file.
Move the 09_lowlatency GRUB configuration in to /etc/grub.d
We will now move the 09_lowlatency GRUB configuration into /etc/grub.d. This file contains configurations to assure the lowlatency kernel packaage will boot first every time and survive upgrades.
Update GRUB configurations
In this step, we update the grub configurations to assure all grub.cfg and related files are consistent after installation of the additional lowlatency configuration.
Reboot the system
Reboot the system and check if the new lowlatency kernel is installed.