Portal Home > Knowledgebase > Minecraft > Connection and Lag Issues > How to Resolve Minecraft Server Lag

How to Resolve Minecraft Server Lag

You may experience chat, block and other delays on a Minecraft server. There are various causes, ranging from high CPU and memory usage to network issues. To simplify troubleshooting, first check the CPU usage in Command Center right when you experience performance issues. Next, refer to the appropriate sections below.

CPU Usage is About 100% or Higher

Based on our experience, too high CPU usage is the main cause of lag. To maintain best performance, try to keep your CPU usage below 100%. There are many different reasons for increased CPU usage. Mods, plugins, and world entities are the most common culprits.

If you’re wondering whether you can get access to more and “better” CPU resources, the short answer is “no.” As the Minecraft server is dependent on single-core performance, we only use the latest 3+ GHz Intel Xeon processors and don’t impose any hard limit on your usage. We also monitor our machines around the clock to ensure that you can always use at least one core. Since we already give you the best, the best way to identify the cause of CPU usage issues is to troubleshoot in-game.

Mods are Consuming CPU

If you’re running a modded server, some mods can cause increased CPU usage and result in performance issues. Think back for a bit. Did you start experiencing lag after you started using certain items on your server? For example in Minecraft 1.6.4, Twilight Forest and certain Mekanism items, can be very CPU intensive. However, these are general experiences, and may not be relevant to your situation.

Fortunately, if you’re running Minecraft 1.6.4 or later, you can use Opis to identify the sources of your CPU usage: How to Use Opis to Diagnose Lag

For those who are on older versions of Minecraft, open a support ticket, and we’ll run an external profiler to determine the mod(s) that are causing the lag. Unlike Opis, which has the ability to tell you the exact problematic blocks, our profiler can only give results at a high level.

Entities are Consuming CPU

Another common issue is too many world entities. One of your players might have blown something up, resulting in tons of unplaced blocks. Another might have spawned hundreds or thousands of monsters. Each one of these items or mobs will use up CPU and memory resources, and when there are many, will cause a noticeable impact on performance.

CraftBukkit, Spigot, and Cauldron were issued DMCA takedown notices. Because of this, CraftBukkit and Cauldron are no longer publically available. Spigot was largely rewritten for Minecraft 1.8+, but still suffers in a legal gray area. If you are running a Forge based server, you can use ForgeEssentials or the Forge version of WorldEdit for similar features.

To remove entities, make sure you’re running a server that can support CraftBukkit plugins, like CraftBukkit, Spigot, or Cauldron. Next, install Essentials or WorldEdit and run one of the appropriate commands:

  • WorldEdit: /clear items -1
  • Essentials: /remove all

Your Server is Running into its Memory Limit

Java’s memory cleanup process, garbage collection, uses up CPU resources. In some cases, you may run into the memory limit of your server. You may experience extended high CPU usage at 100%, crashes with OutOfMemoryErrors or spikes of latency. There is currently no way to tell in Command Center whether your garbage collector is using up CPU resources.

If you suspect this, open a support ticket, and we can check for you from our end.

View Distance is Too Large

If you have a popular server with players scattered across your map, reducing your view distance may help improve performance. From the Minecraft Wiki the server view distance:

Sets the amount of world data the server sends the client, measured in chunks in each direction of the player. It determines the server-side viewing distance. The “Far” viewing distance is 9 chunks, sending 441 total chunks (the amount of chunks that the server will load can be seen in the debug screen).

10 is the default/recommended. Tip: if you have major lag, reduce this value.

Reducing it may lower the CPU usage when you have many players on. It may also help players who have slower Internet connections.

  1. Log into Command Center.
  2. From your server list, find the server you would like to modify and click the Manage button on the right.
  3. From the server you selected, click the Files tab above the console.
  4. Locate and open server.properties.
  5. Find the line with view-distance.
  6. Reduce it from 10 to 4 or 5.
  7. Save the file and restart your server.

Bukkit Plugins Consume CPU

To check plugin resource usage, use the Bukkit /timings command, and scrutinize the output.

  1. Make sure you’re running CraftBukkit.
  2. Change plugin-profiling in bukkit.yml from false to true.
  3. Restart.

When you start experiencing lag, run: timings merged. The command produces a timings[n].txt file in the timings folder. Open it and look at how many seconds it took to process each plugin. If you need an easy to use timings file interpreter, try this timings tool. The ones that take the longest should be the most of concern. You can try temporarily disabling them and seeing if the lag improves.

Tekkit Classic Lag

Certain mods in Tekkit are known to cause performance issues. The following commands let you determine the most resource intensive mods in Tekkit Classic. When you experience lag, run:

  1. modtiming start [seconds], where seconds is the duration to sample for. For example, modtiming start 10, will sample for 10 seconds.
  2. Next, type: modtiming show
  3. The most resource intensive mods will appear at the top.

Try stopping the usage of the mods and seeing if performance improves.

CPU Usage is Below 100%

Network Issues

Transient network connection issues or if you’re physically far away from your server can make your Minecraft server appear less responsive. Before continuing with the directions below, we recommend trying to use a wired connection and making sure that the users on your network aren’t downloading large files or consuming a lot of bandwidth.

You and your players can test the connection quality from your computer to your server by testing in game and running the ping and trace route commands.

In game:

  1. Connect to your server with your Minecraft client.
  2. Log into Command Center.
  3. From your server list, find the server you would like to modify and click the Manage button on the right.
  4. On the console, type "say test" and press enter.
  5. Check if test appears right away in your game window. A delay indicates network latency.

To provide further diagnostic information, run the ping and traceroute commands and send us the results.

Reduce View Distance

Sometimes reducing the server view-distance can help players who have slower connections:

  1. Log into Command Center.
  2. From your server list, find the server you would like to modify and click the Manage button on the right.
  3. From the server you selected, click the Files tab above the console.
  4. Locate and open server.properties
  5. Find the line with view-distance
  6. Reduce it from 10 to 4 or 5.
  7. Save the file and restart your server.

Client Side Frame Rate

Your server may appear to lag, but in reality it’s your client. To check your frames per second (FPS), press F3 within Minecraft. It’ll display your current FPS. Anything above 20-30 FPS should provide adequate gameplay. If it’s below 20-30 FPS, try adjusting your video settings in game. Try using the following settings:

  • Graphics: Fast
  • Render Distance: Short or Normal
  • Smooth Lighting: Off
  • Performance: Max FPS
  • Advanced OpenGL: On

You can also attempt to use mods like OptiFine and FpsPlus to increase your framerate and improve your client side rendering performance. However, mods like these rewrite the default Minecraft rendering engine and game logic that the game and other mods depend on. You could experience weird errors, visual glitches, or crashes. Most people trade stability for some increase in performance.

Other Resources

Finally, there are other more obscure causes of lag. The SK Minecraft Wiki has a detailed list. This list includes causes and instructions to solve them.

Please contact support if you continue to experience any issues.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
How to Use Ping, Traceroute, and MTR (Views: 11145)
Resolving MCPC-Plus and Spigot crashes whenever a second player joins (Views: 3223)
How to Fix "Connection Lost, Failed to login: Bad login" (Views: 27670)
How to Enable Online/Offline Mode on a Minecraft Server (Views: 61787)
How to Use Opis to Diagnose Lag (Views: 30106)

Powered by WHMCompleteSolution