Article

Table of Contents
Theme:
Was this article helpful?

1  out of  1 found this helpful

Try Vultr Today with

$50 Free on Us!

Want to contribute?

You could earn up to $300 by adding new articles!

How to Optimize Your Vultr Minecraft Server

Last Updated: Thu, Dec 3, 2020
Minecraft

Introduction

This tutorial helps you to optimize your Vultr Minecraft server to avoid the slightest lag and to have the best possible performance as measured in Ticks Per Second (TPS).

What Is TPS?

A Vultr Minecraft server advances the game aspects such as object movement, health, crop growth, mob movement, and more, every 0.05 seconds—a clock rate of 20 ticks per second.

If the Minecraft server cannot update all the items on each tick, the server may lag. A TPS rating below 20 indicates that the server must skip tasks to keep up, which creates a rubber-band effect, sometimes reverting in-game actions a few seconds back. You may experience this as a block breaking, and the item drops later, or the sun moving counterclockwise.

TPS ratings of 19.95 or above are acceptable, and ratings below 18.5 are poor. Anything less than 16 is unplayable.

Server Selection

To improve your Minecraft server experience, use Spigot or PaperSpigot. Bukkit is quite old and less optimized than Spigot.

Pre-generate The Map

Map pre-generation is a critical factor in improving your server's TPS rating. When a player connects to your Vultr Minecraft server, it has to generate the map while the player moves, which requires CPU resources. When a player passes over a part of the map already generated, the server requires fewer resources. It's essential to pre-generate the map before opening your server to the general public.

WorldBorder is a plugin that allows you to pre-generate your map. It is available in most versions of Minecraft.

  1. Define a limit for the generation of your world.

    /wb [worldname] setcorners <x1> <z1> <x2> <z2>
    
  2. To generate the map, use the command:

    /wb fill
    
  3. Wait for the server to generate the map. It may take quite a while, depending on the size of the map and the server's power.

Edit Your Configuration Files

Most of the rest of the optimization for the server involves editing your server files. The default settings aren't optimized for servers with 10 to 30 players.

Server.properties File

view-distance

This setting is critical for good performance because it forcibly reduces the maximum rendering distance for players. Open world servers (such as Survival) should strive to use 6+, but others on shared hosts, low specifications, or large numbers of players might consider 4-5 if the chunk generator causes a lag.

  • Default value: 10
  • Optimized value: Between 5 and 8

network-compression-threshold

If you set a lower value, the server has to use more resources to compress the packets. If you set a higher value, the server uses more bandwidth but saves resources. If you set the value too high, players with a bad connection are going to lag.

  • Default value: 256
  • Optimized value: 512

👉 Note: If your server is in a network with a proxy and your server has less than 2ms with the proxy, a value of –1 is beneficial.

Bukkit.yml File

spawn-limits

This setting controls the maximum number of mobs that can appear around a single player. These parameters may vary depending on the game mode of your server.

  • Default values:
    • monsters: 70
    • animals: 10
    • water-animals: 15
    • ambient: 15
  • Optimized values:
    • monsters: between 35 and 50
    • animals: 7
    • water-animals: 3
    • ambient: 1

chunk-gc.period-in-ticks

This setting unloads empty chunks faster, which consumes fewer resources.

  • Default value: 600
  • Optimized value: between 350 and 400

ticks-per.monster-spawns

This setting determines the frequency (in ticks) at which the server tries to generate a monster. A small increase in the time between spawning should have no impact on the spawning rates.

  • Default value: 1
  • Optimized value: between 4 and 6

Spigot.yml File

Disclaimer: Some settings may not exist or may have disappeared depending on your version of Spigot or PaperSpigot.

tick-inactive-villagers

Enabling this prevents the server from ticking villagers outside the activation range. Villager tasks in 1.14+ are heavy.

  • Default value: true
  • Optimized value: false

anti-xray.enabled

This method is no longer useful, and it consumes needless resources.

  • Default value: true
  • Optimized value: false

mob-spawn-range

This setting controls the max mob spawn distance (in chunks) from players. After limiting spawns in Bukkit, this will condense mobs to mimic the appearance of normal rates.

  • Default value: 1
  • Optimized value: Get your viewing distance and set a spawning range one below this value. For example, if the viewing distance is 5, set mob-spawn-range to 4.

entity-activation-range

Entities past this range are ticked less often.

  • Default values:
    • monsters: 32
    • animals: 32
    • raids: 48
    • misc: 16
  • Optimized values:
    • monsters: 20
    • animals: 14
    • raids: 48
    • misc: 8

nerf-spawner-mobs

When enabled, mobs from spawners don't have AI (not swim/attack/move). This is significant performance savings on servers with mob farms but also messes with their behavior. A farm limiter plugin might be a better solution.

  • Default value: false
  • Optimized value: true

merge-radius

Merging items means less ground item ticking. Higher values allow more items to be stacked.

  • Default values:
    • item: 2.5
    • exp: 3.0
  • Optimized values:
    • item: 5.0
    • exp: 7.0

Paper.yml File

max-auto-save-chunks-per-tick

This setting slows incremental chunk saving during the world save task. This is incredibly important for 1.13+ servers with how inefficient chunk saving is.

  • Default value: 24
  • Optimized value 10

optimize-explosions

  • Default value: false
  • Optimized value: true

mob-spawner-tick-rate

This setting controls the delay (in ticks) before an active spawner attempts to spawn. Go higher if you have significant tick loss from ticking spawners.

  • Default value: 1
  • Optimized value: between 2 and 4

disable-chest-cat-detection

Disable chests scan for a cat on top of it when opened by a player.

  • Default value: false
  • Optimized value: true

container-update-tick-rate

This setting changes how often (in ticks) inventories refresh while open. If you exceed 4, you can have visual issues.

  • Default value: 1
  • Optimized value: 2

grass-spread-tick-rate

This setting controls the time (in ticks) before the server tries to spread grass in chunks.

  • Default value: 1
  • Optimized value: between 4 and 6

prevent-moving-into-unloaded-chunks

This setting prevents players from entering an unloaded chunk (due to lag), which causes more lag.

  • Default value: false
  • Optimized value: true

use-faster-eigencraft-redstone

  • Default value: false
  • Optimized value: true

👉 Note: If you use a plugin to change the Redstone algorithms, set this value to false.

Java Startup Flags

To optimize the Java runtime, review the latest version of this guide, written by a core Spigot/Paper developer and the creator of the timings program. It applies to 99% of servers.

More Tips

  • Use as few plugins as possible.
  • Favor plugins that perform their tasks asynchronously.
  • Prefer plugins that are recent and have regular updates.
  • Some custom Spigot servers are better than the basic Spigot server but may require a fee.
  • Always have a clean console. If you see errors in the console, correct them as soon as possible

Conclusion

Finding the correct settings to optimize a server takes time and improves TPS performance to reduce server lag. Each server is different, and you may want to learn more about the parameters. See the following documentation:

Want to contribute?

You could earn up to $300 by adding new articles