Skip to content

Commit 5e57fa3

Browse files
committed
chore: update docs for CPU goverance
1 parent 7a344a4 commit 5e57fa3

File tree

2 files changed

+16
-66
lines changed

2 files changed

+16
-66
lines changed

servers/cpu-governance.md

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22

33
Your server has a concept of CPU governance, which controls how the CPU manages its frequency and power consumption. There are several governor modes available, each with different characteristics.
44

5-
## Available CPU Governors
6-
7-
| Governor | Description |
8-
| -------------- | -------------------------------------------------- |
9-
| `performance` | CPU runs at maximum frequency at all times |
10-
| `powersave` | CPU runs at minimum frequency to save power |
11-
| `ondemand` | CPU frequency scales based on current load |
12-
| `conservative` | Similar to ondemand but more gradual scaling |
13-
| `userspace` | Allows manual control of CPU frequency |
14-
| `schedutil` | Uses scheduler information for frequency decisions |
15-
165
## Recommended Configuration
176

187
For game servers, it is **strongly recommended** to set the CPU governor to `performance` to ensure consistent, low-latency performance.
@@ -21,29 +10,12 @@ For game servers, it is **strongly recommended** to set the CPU governor to `per
2110

2211
If you're using Ubuntu or Debian, you can install `cpufrequtils` and configure the governor:
2312

24-
1. Install cpufrequtils:
25-
26-
```bash
13+
```bash
2714
apt update
2815
apt install cpufrequtils
29-
```
30-
31-
2. Edit the configuration file:
32-
33-
```bash
34-
nano /etc/default/cpufrequtils
35-
```
36-
37-
3. Set the governor to performance:
38-
39-
```bash
40-
GOVERNOR="performance"
41-
```
42-
43-
4. Restart the service:
44-
```bash
16+
echo 'GOVERNOR="performance"' | sudo tee /etc/default/cpufrequtils
4517
systemctl restart cpufrequtils
46-
```
18+
```
4719

4820
## Verification
4921

servers/low-latency-kernel.md

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,26 @@ This guide provides instructions for installing the low-latency kernel on Ubuntu
3434

3535
## Installation Steps
3636

37-
1. First, update your package list:
37+
1. Update your package lists and install the low-latency kernel:
3838

3939
```bash
4040
apt update
41-
```
42-
43-
2. Install the low-latency kernel:
44-
45-
```bash
4641
apt install linux-lowlatency
4742
```
4843

49-
3. After installation, reboot your system:
44+
2. Once installation is complete, reboot your system:
5045

5146
```bash
5247
reboot now
5348
```
5449

55-
4. Verify the kernel installation after reboot:
50+
3. After rebooting, verify that the low-latency kernel is active:
51+
5652
```bash
5753
uname -r
5854
```
59-
The output should include "lowlatency" in the kernel name.
55+
56+
The output should show "lowlatency" in the kernel version.
6057

6158
## Kernel Parameter Optimization
6259

@@ -68,51 +65,32 @@ After installing the low-latency kernel, you'll want to optimize several kernel
6865
nano /etc/sysctl.conf
6966
```
7067

71-
Add these lines:
68+
Add or modify the following lines:
7269

7370
```bash
7471
# TCP Low Latency Settings
7572
net.ipv4.tcp_low_latency = 1
7673
net.ipv4.tcp_congestion_control = cubic
7774
```
7875

79-
Then run:
76+
Next, apply the changes by running:
8077

8178
```bash
8279
sysctl -p
8380
```
8481

85-
2. Set CPU Governor to Performance Mode:
86-
87-
```bash
88-
# 1. Install cpufrequtils
89-
sudo apt update
90-
sudo apt install -y cpufrequtils
91-
92-
# 2. Set governor to "performance" for all CPU cores
93-
for cpu in /sys/devices/system/cpu/cpu[0-9]*; do
94-
sudo cpufreq-set -c "${cpu##*/cpu}" -g performance
95-
done
96-
97-
# 3. Make it persistent across reboots
98-
echo 'GOVERNOR="performance"' | sudo tee /etc/default/cpufrequtils
99-
100-
# 4. Enable and start the cpufrequtils service
101-
sudo systemctl enable cpufrequtils
102-
sudo systemctl restart cpufrequtils
103-
```
104-
105-
3. Verify the settings:
82+
2. Verify the settings:
10683

10784
```bash
10885
# Check TCP settings
10986
sysctl net.ipv4.tcp_low_latency
11087
sysctl net.ipv4.tcp_congestion_control
111-
112-
# Check CPU governor
113-
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
11488
```
11589

90+
:::info
91+
For even better low-latency performance, consider setting your [CPU Governor](./cpu-governance.md) to "performance" mode and ensuring this setting persists after reboot.
92+
:::
93+
11694
## Reverting to Standard Kernel
11795

11896
If needed, you can switch back to the standard kernel:

0 commit comments

Comments
 (0)