🚀 UltraServers Relaunch We're thrilled to announce the relaunch of our service with a brand-new, streamlined panel designed to enhance your gaming experience. Join our Discord for more information about the 90% off your first month, and 70% recurring lifetime discount. Don’t miss out, discounts are only valid until December 14th, 2024.
Optimize your Minecraft Server
This guide provides some options for optimizing your Minecraft server for the best performance. Since it is an advanced guide, we assume you have basic knowledge of Minecraft and the UltraServers panel.
Minecraft’s highly customizable features allow you to get game options that are suited to your liking. This guide will give you some options of things you can do to try to ensure smoother gameplay for you and all the players on your server.
Map Pre-Generation
- Due to different chunk generation improvements made over the years, servers with poor, single-threaded, or constrained CPUs are the only ones that can benefit from map pre-generation. Pre-generation is frequently employed to produce chunks for world-map plugins like Pl3xMap or Dynmap. If you still want to pre-generate the world, use a plugin like Chunky.
Configure server.properties
view-distance
: This is the distance in chunks sent to players, similar to no-tick-view-distance from Paper. A good starting value is7
.- Higher view distances can create unnecessary lag on your server and your client.
Client Side FPS
- A low frame rate on your server doesn’t always mean the server is lagging. Sometimes, your computer can struggle to keep up with all the generations or mods running in your game. If you have a consistently low frame rate on your PC, you will likely need to adjust your game settings, update your drivers, or upgrade the graphics card, RAM, or CPU.
- You can run optimization Mods such as Optifine or use an optimization mod from an external launcher (Prism, ATLauncher). Modpacks such as Fabulously Optimized can help your game run much smoother by adding some frame rate and shader optimization options.
Server Side Lag
- MSTP: You may find out how long the server takes to compute recent ticks using Paper’s
/mspt
command. Server-side lag is measured in ticks. If your ticks drop below 20 OR become really high, such as 50, you may be experiencing lag. This is where diagnostic tools and plugins should help you determine the problem (see below).
Timings Reports
- If the MSTP values are higher than expected (over 50), your server might lag. You can use Spark to see detailed information. Spark is a plugin that allows you to profile your server’s CPU and memory usage. Check out Create a Spark/Timings Report for detailed instructions on how to use the plugin.
Connection Lag
- If you’re experiencing connection lag, it’s probably because your ping is high. Ping is a fancy term for the time data travels between your game and the server. The longer it takes, the higher your ping. And if your ping is too high, you might get kicked out of the server or even crash the game.
- You want your ping to be as low as possible to avoid this. That means less latency and smoother gameplay. But sometimes, your ping can be affected by things like how far away the server is from you, the speed of your internet, or even your firewall settings.
- Try moving your server closer to you and your players to get the best ping possible. That way, you can minimize lag and avoid any annoying connection issues. This can be done by choosing the server location closest to you, and you can do ping tests to different locations here.
Configure spigot.yml
hopper-transfer
: Time in ticks that hoppers will wait to move an item. Increasing this will help improve performance if there are a lot of hoppers on your server, but it will break hopper-based clocks and possibly item sorting systems if set too high. A Good starting value is8
.hopper-check
: Ticks between hopper checks for an item in the inventory or above them. If your server has a lot of hoppers, raising this value will improve performance, but it will disrupt water stream- and hopper-based item sorting systems and clocks. A good starting value is8
.merge-radius
: This decides the distance between the items and exp orbs to be merged, reducing the number of items ticking on the ground.
Good starting values:
item: 3.5
exp: 4.0
Paper World Config Settings
anti-xray
: Enable this to hide ores from x-rayers. For detailed configuration of this feature, check out this guide. Enabling this will decrease performance however it is much more efficient than any anti-xray plugin. In most cases, the performance impact will be negligible.- Good starting value:
true
nether-ceiling-void-damage-height
: If this option is greater than0
, players above the set y level will be damaged as if they were in the void. This will prevent players from using the nether roof.- Good starting value:
127
alt-item-despawn-rate
: This list lets you set an alternative time (in ticks) to despawn certain dropped items faster or slower than the default. This option can be used instead of item clearing plugins and merge-radius to improve performance.
Good starting values:
enabled: true
items:
cobblestone: 300
netherrack: 300
sand: 300
red_sand: 300
gravel: 300
dirt: 300
grass: 300
pumpkin: 300
melon_slice: 300
kelp: 300
bamboo: 300
sugar_cane: 300
twisting_vines: 300
weeping_vines: 300
oak_leaves: 300
spruce_leaves: 300
birch_leaves: 300
jungle_leaves: 300
acacia_leaves: 300
dark_oak_leaves: 300
mangrove_leaves: 300
cactus: 300
diorite: 300
granite: 300
andesite: 300
scaffolding: 600
Do your Own Research
- It is essential to note that just because a plugin has many downloads does not mean it is safe to use. It is best to research plugins before adding them to your server. UltraServers is not responsible for any lost data or server corruption due to unsafe plugin use.
- For example, Plugins that remove ground items are useless because
merge radius
andalt-item-despawn-rate
can replace them. They often spend more energy searching and eliminating things than not deleting anything at all. - For instructions on how to install a plugin, check out Install a Plugin.
Plugin Conflicts
- It is good to keep your plugins’ usage clean. Any plugins that throw errors or seem to affect your server incorrectly should be removed immediately.
- You don’t need to run duplicate plugins. For example, running a plugin like Luckperms and MyPermissions at the same time can cause clashes that will cause one or both of them not to run correctly. So you should choose one permission plugin, not both.
Removing Tick/Lag Machines
- Redstone is an excellent way to build just about any machine you can imagine. But, if you go overboard and make too many machines, you’ll start having problems. Your TPS will go down, and everyone will begin experiencing some lag. To fix this, you should limit the number of machines you build and consider installing
anti-redstone-lag
plugins. - Also, try to build only a few automated farms, mob grinders, or anything else that uses a lot of complex Redstone. And, whenever possible, ensure you can turn off your machines and farms so they’re not running all the time and eating up all your resources.
Minecraft RAM Utilization
When running a Minecraft server, particularly one using Java, you might notice that a high percentage of your RAM is being used. However, it’s essential to understand that unused RAM in Minecraft is essentially wasted RAM. Here’s why:
Java uses memory as needed but keeps it for later use. When Java launches a program, it reserves a chunk of your computer’s RAM. As the program requires more memory, Java expands its usage to the maximum allowed. The critical point is that once Java has taken RAM, it generally doesn’t return it to the operating system, even if it’s not actively using it. Instead, it keeps that RAM on hand for future needs.
In this sense, it functions as intended if your Minecraft server uses 99% of your allotted RAM and isn’t experiencing any issues like lag or crashes. Minecraft (and Java in general) is designed to use up the RAM it’s given to improve performance. Unused RAM is just potential that’s not being utilized.
If you require further assistance, you can open a support ticket here.
Feedback and suggestions can be submitted here, or further discussed on our Discord server.