Availability is limited, plan your project ahead.

SERVER PERFORMANCE

Why Is Your Minecraft Server Lagging? Check Maps and Plugins with spark

BlockyFlow guide cover: SERVER PERFORMANCE
BlockyFlow / Minecraft guides

Players report lag at spawn, so the map becomes the first suspect. Before removing decorations or changing hosting, gather measurements. The problem may involve server processing, a player's connection or the smoothness of their game. Each case needs a different investigation.

On a BoxPvP server, examine mine resets and combat involving larger groups. On SMP or LifeSteal, compare a quiet visit to spawn with world exploration. You can use the spark profiler to investigate your Java server's performance.

TPS, MSPT, ping and FPS measure different things

TPS measures the rate at which the server processes ticks, while MSPT measures the time needed to process them. At the standard target of 20 TPS, each tick has a 50 ms time budget. Falling TPS and long ticks can help identify gameplay processing problems. The spark guide to TPS and MSPT explains these metrics.

Ping describes connection latency, while FPS describes how smoothly the game renders on the player's device. If only one person has trouble, ask them to compare these values in different parts of the map. If several players notice delayed world responses at once, check server performance during that same period.

Collect a profile while the problem is happening

Paper includes spark from version 1.21 onwards. Other setups may require a compatible plugin installation. Paper's documentation also stresses that the issue must be occurring while the profile is collected. See Paper's profiling guide.

Start a profile lasting a few minutes:

/spark profiler start --timeout 300

During the recording, reproduce the situation causing lag. If your BoxPvP map slows down when a mine resets, include a reset in the recording period. To finish early, use:

/spark profiler stop

You can also check the profiler status with /spark profiler info and TPS with /spark tps. The spark command documentation covers these commands.

Record the player count, time, world and activities. This makes later measurements easier to compare with the original profile.

How do you read the profiling results?

Open the report link and inspect the call tree for the main server thread. Expand branches that account for a large share of time. Check what is beneath them: world processing, entities or plugin tasks.

A high percentage beside a general method name does not identify a specific culprit on its own. Expand its children before deciding to remove a plugin or map feature. The spark viewer guide explains how to explore the tree.

Change one thing and compare measurements

If the report points to a particular operation, test a change on a server copy. For example, adjust a setting in the plugin being investigated and repeat the same scenario. Record the results and the effect on gameplay.

Avoid judging optimisation solely by the map's file size or the number of decorative blocks. For a lobby, PvP arena or survival world, investigate what the server does during gameplay. Measurements help you focus on the actual issue instead of removing builds that were not causing delays.