There are two kinds of server administrator. One responds to lag by restarting, removing a plugin they suspect, and lowering a setting they read about. The other opens a profiler and reads which line of which plugin is consuming the tick.
The difference between them is about an hour of learning, once, and it is the largest single improvement available to anyone running a server.
What a profiler is measuring
A game server does its work in ticks — twenty a second for Minecraft, more for Source games. Each tick has a budget. Exceed it and the server falls behind, which players experience as everything moving slowly.
A profiler samples what the server is doing during those ticks and attributes the time. The output is a tree: this percentage in entity ticking, of which this much in one particular mob type, of which this much inside a specific plugin's listener.
That last level is the point. "The server is lagging" becomes "38% of the tick is one plugin's chunk listener", and the second sentence has an obvious next step.
The three shapes you will see
Almost every profile falls into one of three patterns, and recognising them is most of the skill.
One plugin dominating. A single entry taking a large share. This is the easy case and the least common. Usually it is a plugin doing work on every tick that it could do on a timer.
Entities. Mobs, item frames, hoppers, dropped items. Diffuse across many small entries that add up. The fix is not a plugin at all — it is activation ranges and entity limits, which live in the server configuration rather than in anything you installed.
Chunk loading and generation. Spikes correlated with players exploring. This one is solved before it happens, by pregenerating, and no amount of tuning helps once a player is standing at the edge of generated terrain.
What the percentages are not
A plugin at 15% of the tick is not necessarily a problem. If your tick is using 8ms of its 50ms budget, 15% of that is nothing and removing the plugin buys you 1.2ms you did not need.
Percentages are shares of what the server is doing, not shares of its capacity. Read them alongside the actual tick time, and only act when the tick time is genuinely under pressure. Optimising a healthy server is how people break things they did not need to touch.
Profile the problem, not the quiet moment
A profile taken while the server is fine describes a server that is fine. It is useless for diagnosing a stutter that happens at peak.
So: start the profiler before the busy period, run it across the event, and read it afterwards. If the problem is intermittent and you cannot predict it, run longer samples and accept a coarser picture.
This is also why a profile is worth taking while things are healthy, once, as a reference. Knowing what normal looks like is what makes an abnormal profile readable: the same reason knowing what a quiet log looks like matters more than knowing what an error looks like.
The thing profiles cannot see
Anything outside the game process. If the server is slow because the host is oversubscribed, because the disk is saturated, or because another container on the same box is busy, the profile will show the tick being slow without showing why.
The tell is a profile where nothing dominates and everything is slightly slow. That is contention, not code, and it belongs with what the machine is actually doing rather than with anything you can fix inside the game.
After the profile
Change one thing. Profile again. Compare.
That loop is what separates measurement from ritual. A server owner who changes six settings and declares victory has learned nothing and will be back in a month, which is the same failure as restarting on a shrinking interval and calling it maintenance.
The hour it takes
Install the profiler, run it while the server is healthy, and read the output once without needing anything from it. That is the whole investment.
The next time somebody says the server feels laggy, you will have an answer in ten minutes instead of a week of guessing, and more usefully, you will sometimes be able to say that the server is fine and the problem is somewhere else, which is an answer nobody can reach by changing settings.
- Tags
- performancetroubleshootingoperations
- Share
Published · 3 min read