Performance Optimization

How to optimize your Minecraft server performance on Witchly.host with Paper tuning, view distance, entity limits, and profiling tools.

Performance Optimization

A well-optimized Minecraft server provides a smoother experience for all players. This guide covers practical performance tuning strategies, from basic settings to advanced configuration, to help you get the most out of your Witchly server.

Understanding Server Performance

Minecraft servers run on a game loop that ticks 20 times per second (20 TPS). Each tick, the server processes everything: player actions, mob AI, redstone, chunk loading, and more. When the server cannot keep up with 20 TPS, players experience lag.

TPS targets:

  • 20 TPS — Perfect performance. No lag.
  • 18-19 TPS — Acceptable. Minor hitches may occur.
  • 15-17 TPS — Noticeable lag. Optimization needed.
  • Below 15 TPS — Severe lag. Immediate action required.

Basic Optimizations (server.properties)

These settings have the biggest impact and apply to all server software.

View Distance

Controls how many chunks around each player the server keeps loaded.

view-distance=8

Reducing from the default of 10 to 6-8 significantly reduces CPU and RAM usage. Players can still see distant terrain if you keep simulation-distance lower than view-distance.

Simulation Distance

Controls the range at which entities and blocks are actively ticked (1.18+).

simulation-distance=6

This is the most impactful performance setting. A simulation distance of 4-6 reduces entity processing dramatically while view-distance keeps the visual range larger.

Max Tick Time

Set to -1 to disable the watchdog for heavy modded servers:

max-tick-time=-1

Only disable this on modded servers where long ticks are expected during world generation. On vanilla or plugin servers, keep the default.

Paper Configuration

Paper offers extensive performance tuning beyond server.properties. These files are found in the config/ directory.

paper-global.yml

Chunk loading:

chunk-loading-basic:
  player-max-chunk-generate-rate: 10.0
  player-max-chunk-load-rate: 100.0
  player-max-chunk-send-rate: 75.0

Limiting chunk generation rate prevents the server from being overwhelmed when players are exploring.

paper-world-defaults.yml

Entity activation range — Reduces how far from a player mobs have their AI processed:

entity-activation-range:
  animals: 16
  monsters: 24
  raiders: 48
  misc: 8
  water: 8
  villagers: 24
  flying-monsters: 48

Lower values mean fewer mobs actively using CPU for AI calculations.

Mob spawn limits — Controls maximum mob counts:

spawn-limits:
  monsters: 50
  animals: 8
  water-animals: 3
  water-ambient: 5
  water-underground-creature: 3
  axolotls: 3
  ambient: 1

The default values are higher. Reducing these limits significantly reduces entity-related lag.

Tick rates for inactive entities:

tick-rates:
  container-update: 3
  grass-spread: 4
  mob-spawner: 2
  sensor:
    villager:
      secondarypoisensor: 80
  behavior:
    villager:
      validatenearbypoi: 60

Hopper optimization:

hopper:
  cooldown-when-full: true
  disable-move-event: false
  ignore-occluding-blocks: true

Enabling cooldown-when-full prevents hoppers from constantly checking when they are full, reducing unnecessary tick overhead.

Anti-Xray

Paper includes built-in anti-xray. While it adds slight CPU overhead, it is much more efficient than plugin-based alternatives:

anticheat:
  anti-xray:
    enabled: true
    engine-mode: 2

Engine mode 2 is more effective but uses slightly more bandwidth. Mode 1 is lighter.

Purpur Configuration

If you use Purpur, purpur.yml offers additional tweaks:

settings:
  use-alternate-keepalive: true

This helps prevent players with higher latency from being timed out.

Chunk Pre-Generation

New chunks are expensive to generate. Pre-generating your world eliminates lag spikes when players explore new areas.

Using Chunky

Chunky is the recommended pre-generation plugin.

  1. Install Chunky on your server.
  2. Run these commands from the console:
    chunky radius 5000
    chunky start
    This pre-generates a 5000-block radius around spawn.
  3. Monitor progress with chunky status.
  4. Once complete, remove Chunky if you do not need it running permanently.

Tip: Pre-generate during off-peak hours. It uses significant resources while running.

Profiling with Spark

Spark is the best profiling tool for identifying what is causing lag on your server.

Installation

Download Spark from spark.lucko.me and install it as a plugin (Paper/Spigot) or mod (Fabric/Forge).

Usage

/spark profiler start

Let it run for 5-10 minutes during normal gameplay, then:

/spark profiler stop

Spark generates a web report showing exactly what is consuming server resources. Share this report when asking for help on our Discord.

Checking TPS

/spark tps

Shows current, average, and minimum TPS values.

JVM Garbage Collection Flags

Witchly servers come with optimized JVM flags by default. If you want to customize them, go to the Startup tab in your dashboard.

Recommended flags for Minecraft (Aikar’s flags):

-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200
-XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC
-XX:+AlwaysPreTouch -XX:G1NewSizePercent=30
-XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M
-XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5
-XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15
-XX:G1MixedGCLiveThresholdPercent=90
-XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32
-XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1

These flags optimize Java’s garbage collector for Minecraft’s memory usage patterns, reducing lag spikes caused by GC pauses.

General Tips

  1. Use Paper or Purpur instead of Vanilla or Spigot. They include significant performance patches.
  2. Limit entities. Use plugins like ClearLagg or FarmControl to manage entity counts.
  3. Avoid excessive redstone. Large redstone contraptions are a common cause of TPS drops. Consider using plugins that limit redstone activity.
  4. Keep plugins lean. More plugins means more processing per tick. Remove any plugins you do not actively use.
  5. Update regularly. Server software updates often include performance improvements.
  6. Monitor your server. Use Spark and the /tps command regularly to catch issues early.
  7. Set a world border. Preventing players from exploring infinitely avoids constant chunk generation. Use /worldborder set 20000 to set a reasonable limit.

RAM Recommendations by Server Type

Server TypeRecommended RAMWitchly Plan
Vanilla (1-10 players)3-4GBThe Construct
Paper + plugins (10-30 players)6-8GBThe Reactor
Modded (light, <50 mods)6-8GBThe Reactor
Modded (heavy, 100+ mods)10-16GBThe Mainframe
Large community (50+ players)12-16GBThe Mainframe

Need Help?

If your server is still experiencing performance issues after applying these optimizations, run a Spark profiler report and share it with us on Discord. Our team can help analyze the results and suggest targeted fixes.