Limited offer! Discounts of up to 50% on your servers

✨ BLACK FRIDAY ✨

November 19 to December 2, 2024

Écran d'ordinateur avec graphique dans un jeu de blocs.

How to troubleshoot and reduce lag on a Minecraft server?

Server lag killing the vibe? Let’s pinpoint the cause fast and apply fixes that actually work. Need stability? Check our optimized Minecraft hosting.

Prerequisites

  • Access to your Oxygenserv panel (login and password)
  • Server IP and port: 25565 (Java) or 19132 (Bedrock)
  • File manager or FTP/SFTP access
  • Operator rights in-game or console access
  • Helpful tools: EssentialsX (/tps, /memory), spark or Timings, WorldBorder/Chunky, ClearLagg
  • A recent full backup before changes

Detailed steps

  1. Measure first: live TPS and RAM
    Open the Oxygenserv console and run /tps (or /memory with EssentialsX). Aim for 19–20 TPS and at least 100 MB free memory. If logs show “Can't keep up!“, your tick time is too high. Record numbers for 2–3 minutes while players are online. If TPS dips below 19 or free RAM is near zero, proceed with the next steps.
  2. Find the hogs: entities, chunks, plugins
    Start a quick profile: on Paper/Spigot run /timings on, wait 2–5 minutes, then /timings paste and open the link. Or use spark: /spark profiler --timeout 60 and open the report. Look for heavy sections: entities (mobs/items), redstone, hoppers, or a specific plugin. If one plugin tops CPU usage, update, reconfigure, or replace it.
  3. Lower view and simulation distance
    In the file manager, open server.properties. Change view-distance=10 to view-distance=6 and, if present, set simulation-distance=6 (4–6 depending on player count). Save, then hit the green “Restart” button. On modern versions this barely affects player experience but cuts CPU load a lot.
  4. Switch to Paper and update everything
    In the version selector, pick the Paper JAR instead of Vanilla/CraftBukkit/Spigot. Update Minecraft, plugins, and mods to the latest compatible builds. Paper delivers big optimizations out of the box. Restart and check /tps again. If a plugin breaks, find a maintained alternative.
  5. Tune Spigot/Paper: entity ranges and hoppers
    Edit spigot.yml and adjust these safe values:
    a) entity-activation-range: animals 16, monsters 24, villagers 16.
    b) merge-radius: item 3.0, exp 3.0 (fewer dropped items ticking).
    c) ticks-per: hopper-transfer: 8, hopper-check: 8.
    Save and restart. If farms feel too slow, bump slightly (e.g., hopper-transfer: 6).
  6. Clean up entities and heavy chunks
    Install ClearLagg if needed. Use /lagg clear (items) and /lagg killmobs (mobs) sparingly during spikes; read the result message to confirm. To find hot chunks, run /lagg chunk and teleport there to fix farms or contraptions. Announce wipes to players and exclude sensitive entities in ClearLagg config. If you over-delete, restore from your backup.
  7. Limit world size and pre-generate chunks
    Set a border with WorldBorder: /wb set 5000 spawn then /wb fill to pregen. Or use Chunky: /chunky radius 5000 then /chunky start. Pregeneration prevents CPU spikes when players explore new areas. Run it off-peak; you’ll see progress in console. If you hit timeouts, reduce radius and resume.
  8. Schedule automatic restarts
    In the Oxygenserv panel, open the Scheduler. Create a “Restart” task every 12h (e.g., 05:00 and 17:00) and broadcast a 5‑minute warning (say or a plugin). Restarts clear memory leaks from some plugins/mods. After setup, check logs to confirm it runs. For busy servers, schedule at local night time.
  9. Trim your mods/plugins
    List them with /plugins (or via the plugins folder). Remove unused ones; to disable without deleting, rename to .jar.disable (e.g., EssentialsX.jar.disable). Update the heavy hitters first (based on Timings/spark). Restart and test /tps. If you see “NoClassDefFoundError“, you likely picked the wrong build for your MC version.
  10. Reduce network latency (ping)
    From your PC, test: Windows ping -n 5 SERVER_IP, macOS/Linux ping -c 5 SERVER_IP (no port). Target <100 ms; above 200 ms means you’re too far from the server location. On Oxygenserv, request a location closer to you. Prefer Ethernet over unstable Wi‑Fi. If everyone has high ping, ensure no external firewall is throttling port 25565.
  11. Improve client FPS too
    Suggest OptiFine (or Sodium/Lithium on Fabric). Recommended settings: Graphics “Fast”, Smooth Lighting “OFF”, Render Distance 4–8, Entity Shadows “OFF”, Particles “Minimal”. Press F3 to check FPS; aim for 30+. If the server shows 20 TPS but a player still stutters, that’s a client FPS issue.

Tips & optimization

– Safe starting values for 10–30 players: view-distance=6, simulation-distance=6, entity activation 16/24, hoppers 8/8.
– Pregenerate at least a 5k radius around spawn to stabilize CPU during exploration.
– Avoid ultra-fast redstone clocks; add a tick delay. Massive hopper lines are expensive—use fewer, slower hoppers instead.
– On Paper, run longer Timings (e.g., 15 min) after each change; tweak one setting at a time to see impact.
– RAM: don’t over-allocate. Leave 1–2 GB to the OS on dedicated boxes; on managed hosting, respect your plan and watch /memory.

FAQ

My TPS is 20 but players still lag. Why?

Likely network latency or client FPS. Test ping (ping -n 5/ping -c 5) and check FPS with F3. If ping >200 ms, move the server closer. If FPS <30, use the suggested video settings.

How much RAM do I need?

Rough guide: Vanilla/Paper, 10–20 players: 4–6 GB. With moderate plugins: 6–8 GB. Heavy modpacks (200+ mods): 8–12 GB+. Watch /memory; if free <100 MB often, upgrade.

Will ClearLagg delete important stuff?

By default it can remove dropped items. Exclude what you need (e.g., item frames, armor stands) in its config. Run /lagg check and configure before automating.

Best way to pinpoint server-side lag?

Use /timings on then /timings paste and review top consumers. With spark, run /spark profiler --timeout 120 and read the flamegraph to see heavy plugin methods.

Bedrock vs Java differences?

Ports differ (19132 Bedrock, 25565 Java) and Bedrock also uses server-side simulation distance. The same principles apply: lower view/simulation distance, pregenerate, limit entities.

Now you’ve got a battle plan: measure, optimize, verify. Spend 15 minutes applying these tweaks and your server will feel snappy. Need help? We’ve got your back.

Related articles

Table des matières

Facebook
Twitter
LinkedIn