mpstat -P ALL 5 1 and CPU steal (st) in top, because most game servers run their main loop on one core. Then give the game’s systemd service Nice=-5, set vm.swappiness=10, raise LimitNOFILE, and run backups with nice and ionice. On dedicated servers, also pin cores and use the performance governor.
Before you start
- Connect with SSH as a user with
sudo. Root users can leave outsudo. - Change one thing at a time and measure again. Tuning can’t make up for too little RAM or CPU, and the game’s own settings (view distance, tick rate, plugins, mods) usually matter more than the operating system.
- Install
sysstatformpstatandpidstat:sudo apt install sysstatorsudo dnf install sysstat.
How to find what is slowing your game server down
1
Check per-core load
%usr while the others idle, the game’s main thread is the limit. More cores won’t help; a faster core or lighter game settings will.2
Check steal time
In
top, look at st on the %Cpu(s) line, or %steal in mpstat. Steal is time your virtual CPU was ready but the host ran something else. Consistently high steal while your server is busy causes lag you can’t fix inside the VPS.3
Check memory and swap
si/so columns mean the game is being swapped out, which causes long freezes. See check memory usage.4
Check disk waits
wa above a few percent during lag spikes points to the disk, often world saves or backups. See check disk I/O.5
Check the network path
Lag that only some players see is usually the route between them and the server. See diagnose network latency.
How to give the game server priority
Use a systemd drop-in so the settings survive updates to the unit file. Replacemygame with your service name.
Don’t go lower than about
-10 and never use -20 for a game: it can starve SSH and system services when the game misbehaves.
How to stop the game server being swapped out
vm.swappiness (range 0 to 200, default 60) tells the kernel how readily to swap memory out compared with dropping file cache. A lower value keeps program memory in RAM longer.
-Xmx).
How to keep backups and updates from causing lag
Run heavy jobs at the lowest CPU and disk priority, and schedule them when few players are online:nice -n 19 gives the job the lowest CPU priority and ionice -c3 the idle disk class. Put the command in cron at a quiet hour.
How to pin game servers to CPU cores (dedicated servers)
When several game servers share one machine, pinning each to its own cores stops them competing for the same core.mygame run only on cores 2 and 3. Leave core 0 free for the system. Check the core numbers with nproc or lscpu. On a small VPS, pinning rarely helps, because your vCPUs are already shared by everything on the server.
How to set the CPU governor (dedicated servers)
The CPU frequency governor decides how fast the cores run.performance asks for the highest frequency at all times.
/sys/devices/system/cpu/cpufreq doesn’t exist, which is normal on a VPS, the host controls the CPU frequency and there is nothing to change. With the intel_pstate driver, the file shows the driver’s own algorithm (performance or powersave) rather than a classic governor.
What about TCP tuning and BBR?
Most game servers send game traffic over UDP. TCP congestion control such as BBR affects TCP connections (web panels, downloads, some games’ file transfers), not UDP game traffic. Change network sysctls only when your game’s documentation asks for a specific value.How to check it worked
NI should show your nice value and PSR the core the process last ran on (inside your CPUAffinity list). Then compare the same in-game measure as before, for example tick time or TPS, at a similar player count.
Frequently asked questions
Will more CPU cores make my game server faster?
Only if the game uses them. Many game servers do most work on one main thread, so single-core speed matters more.mpstat -P ALL shows whether one core is maxed out.
Should I disable swap completely?
No. Without swap, a memory spike lets the out-of-memory killer stop your game server. Keep a small swap file and lowervm.swappiness instead.
Is a negative nice value safe?
Moderate values such as-5 are. Very low values can starve SSH and system services if the game gets stuck in a loop, making the server hard to reach.
Does the game panel do this for me?
This guide is for game servers you run yourself on a VPS or dedicated server, for example with LinuxGSM or Pterodactyl.Related guides
VPS and dedicated server guides
Every server guide in one place.
Host game servers with LinuxGSM
Install and manage game servers.
Run a Minecraft server
Java memory and service setup.
Limit CPU and memory
Keep other programs in check.
Diagnose network latency
Find where lag comes from.
Find what is using CPU
Spot busy processes.
Checked against the systemd.exec(5) manual and the Linux kernel documentation for vm sysctls and CPU frequency scaling on 4 November 2026;
mpstat, vmstat, ps and nice/ionice commands tested on Ubuntu 24.04 LTS. The systemd and sysctl changes were not applied in our test environment. Commands can differ on other distributions or releases.Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026