Welcome to

FPSmeter

Analyze your game servers’ performance in real time with precision and reliability.

Tutorial: Recompiling Your Linux Kernel with 1000Hz Realtime

Updated by FPSMeter from a 2009 tutorial. Adapted for Debian 11/12, Ubuntu 22.04+, AlmaLinux/RHEL 9+.

✨ Objective

Optimize the stability of your HLDS/SRCDS/CS2 game servers by recompiling a Linux kernel in real-time mode (PREEMPT_RT) with a 1000Hz clock frequency.

🧠 Why use a 1000Hz + RealTime kernel on a game server?

Standard Linux kernels use a system clock frequency of 100Hz or 250Hz, which means they trigger system interrupts every 10 ms or 4 ms approximately.
On a game server, every millisecond matters: a delayed CPU response can cause lag, micro-freezes, or variations in tickrates (simulation rate). Switching to a 1000Hz kernel means the OS checks the system every 1 ms, offering much finer precision and responsiveness.

💡 Combined with the RealTime patch, this allows the game server (HLDS, SRCDS, CS2...) to:

  1. Obtain absolute CPU priority
  2. Reduce latency spikes
  3. Improve consistency of framerate and ticks
  4. Increase smoothness felt by players
  5. Eliminate slowdowns due to system multitasking.

This combo (1000Hz + RT) is especially recommended for:

  1. Competitive servers
  2. E-sport or LAN environments
  3. Infrastructures where every ms of CPU latency impacts the game experience

🚧 Prerequisites

You must be root (sudo -i or su -), on a compatible dedicated server or VPS.

Required packages on Debian/Ubuntu:

apt update && apt install -y build-essential libncurses-dev bison flex libssl-dev libelf-dev bc wget curl zstd git

📁 1. Download the kernel sources

Go to https://www.kernel.org and download the latest stable version with PREEMPT_RT support (e.g. Linux 6.8.x or 6.9.x).

wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.9.tar.xz
wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/6.9/patch-6.9-rt1.patch.gz

📂 2. Extract and apply RT patch

tar -xf linux-6.9.tar.xz && cd linux-6.9 && zcat ../patch-6.9-rt1.patch.gz | patch -p1

🔧 3. Kernel configuration

Copy the current configuration if available:

cp -v /boot/config-$(uname -r) .config

Start configuration:

make menuconfig

Settings to change:

  1. General setup > Preemption Model: Fully Preemptible Kernel (Real-Time)
  2. Processor type and features > Timer frequency: 1000 Hz
  3. Enable: High Resolution Timer, Tickless System
  4. Disable: CPU frequency scaling, suspend/hibernate

🛠️ 4. Compilation and installation

make -j$(nproc)
make modules_install
make install

Generate initramfs (if necessary):

update-initramfs -c -k 6.9.0-rt1

Update GRUB:

update-grub

🚗 5. Reboot

reboot

After rebooting, you can run the following command to check that your new kernel is in place:

uname -r

You should see a kernel like: 6.9.0-rt1


ℹ️ FPSMeter Tips

  1. RT kernels are more sensitive to third-party drivers.
  2. Avoid proprietary NVIDIA modules or exotic virtualization without testing.
  3. RT helps stabilize tickrate/fps on CS2/SRCDS/HLDS servers, but won’t perform miracles if the CPU is already overloaded!

🎓 References

  1. https://wiki.linuxfoundation.org/realtime/start
  2. https://wiki.debian.org/HowToRecompileKernel
  3. https://kernel.org
  4. http://wiki.fragaholics.de/index.php/EN:Linux_Kernel_Optimization

- ✍️ Written on: 26/06/2025 à 23h02
- 🔄 Last updated on: 26/06/2025 à 23h02
- 🧠 Author: Slymer
- 💬 Community discussion: View the conversation