Project Zomboid Server Lag: Causes and How to Fix It
Project Zomboid has three different kinds of lag, and each one has its own fix. Before changing anything or paying for more, work out which one you've got: it shows in how it happens and who it happens to.
First, which kind of lag you have
Freezes for everyone that get worse over time
You all freeze for a moment at the same time, more and more often, and restarting the server fixes it for a while. That's memory: see “Memory” below.
Everything is in slow motion, all the time
Zombies move in jumps, doors are slow to open, and it's been like that since the server started, especially in areas with lots of zombies or animals. That's the CPU: the server has too much to simulate. See “Less to simulate”.
It only happens to one player
One player sees zombies teleporting or snaps back while walking (rubber-banding) and everyone else is fine. That's their connection or their computer: have them try a cable instead of Wi-Fi and close anything that's downloading. High ping is much more noticeable when driving alongside others (42.21 improved this: make sure everyone is on the latest version).
Rather not set it up yourself? Project Zomboid servers from €12 a month, no contract and a full refund within 72 hours. Or create a free Project Zomboid server, no card needed.
Memory
The Zomboid server runs on Java: it reserves almost all of its memory up front and fills it with the loaded world, the mods and whatever is happening in the game. When it gets tight, Java pauses for a moment to clean up, and that's the freeze you all feel at once.
Don't trust the number in the panel: even with nobody on, it shows memory nearly full because Java has already reserved it. Look at the symptoms instead: freezes that keep getting worse, OutOfMemoryError in the console, or restarts nobody asked for.
The cheapest fix is to restart once a day, at a time when nobody is playing: memory starts from scratch and the freezes disappear for hours. Next, remove any mods you don't use (every added map weighs a lot). If it's still the same after that, the server needs more RAM: the Project Zomboid RAM guide explains how much, depending on mods and players.
Less to simulate
The server's CPU gets eaten by zombies, animals (which in Build 42 live and move even with nobody nearby), cars and everything lying around the map. From most to least noticeable:
Animals: if you have big farms or the map is full of wild animals, lowering their numbers in the animal settings of the SandboxVars file is one of the things that helps most. For farms, a few animals are plenty.
Zombies: the Zombies option in the SandboxVars file sets how many there are (in this game, the higher the number, the fewer zombies: 4 is normal and 5 is low). A small group doesn't need a horde of hundreds chasing it.
Corpses and dropped items: every corpse and every item on the ground counts. HoursForCorpseRemoval, in SandboxVars, sets after how many hours corpses disappear. HoursForWorldItemRemoval does the same for the items in WorldItemRemovalList (hats, glasses and similar junk): they're removed when that area loads again, and 0 removes nothing. In Build 41 these were in the server .ini; in Build 42 they're in SandboxVars.
Cars: driving very fast forces the server to load new map non-stop. If four players drive at the same time in different directions, it loads four chunks of map at once. When things are tight, it's better to travel together in one car.
Before changing anything, read the comments in the file itself: for several Zomboid options the low number is the hardest setting, not the easiest. And change one value at a time. Some settings only apply to what gets generated from then on; the sandbox settings guide explains which.
Mods: a few at a time
A single badly made mod, or one meant for another version, can make the whole server lag. If the lag started after adding mods, remove the last ones you added, restart and see if it goes away. On Build 42, check that each mod says it's for 42: Build 41 mods often load but fail silently. The best multiplayer mods are ones we've checked are up to date.
Mods that add hordes, more zombies, animals or whole maps are the heaviest. They're not banned, but they need more memory and some care with the settings above.
On NapNodes
Check the usage
On “Home”, your server's screen, you can watch memory and CPU live against what the server has (the graphs are in “Advanced settings” → “Performance”). Your RAM is yours alone: with no overselling, nobody takes it from you at peak time. Java's memory already adjusts itself to your server's on every start; you don't need to touch anything.
Schedule a daily restart
In “Advanced settings” → “Schedules”, use “Create schedule” with the time you want (6 in the morning, for example). Inside the schedule, “New Task” → “Send Power Action” → “Restart the server”. If you also turn on “Update the game on start”, that restart keeps it up to date (how to update the server).
Change the settings
Make a backup in “Backups” and open “Settings”: every world and server setting is there, grouped by topic and searchable (try “animals”, “corpse” or “zombie”). Change a value and it saves automatically; press “Restart” to apply it.
Remove mods from the panel
Mods live in the panel's “Mods” tab: remove the one you suspect from the list and restart.
If it's the free server
The free server has the RAM of the smallest plan, but less CPU and lower priority than paid servers, because it uses the spare room. With lots of zombies or several players you'll notice it sooner. If it's tight, “Move to a plan”, on its card in “My servers”, turns it into a paid server with the same world.
If it's running short of memory
RAM belongs to your account. In “My servers”, “Buy RAM” adds more, and “Adjust” on the server's card gives it to the server; or in “My plan & invoices”, “More RAM” moves your plan from Fort (6 GB) to Bastion (8 GB), paying only the difference for what's left of the period. Either way the new RAM arrives on restart, with the same world (how to give your server more RAM (in Spanish)).
Frequently asked questions
Why does my Project Zomboid server keep getting slower?
It's almost always memory: the server runs on Java and, over the hours, fills it up until everyone gets freezes. Restarting once a day fixes it; if it comes back quickly, remove mods or give it more RAM. The RAM guide tells you how much you need.
Why are zombies teleporting in Project Zomboid?
If only one player sees it, it's their connection or their computer. If you all see it, the server is short on CPU: fewer zombies, fewer animals and fewer dropped items help.
Does more RAM fix lag in Project Zomboid?
Only memory lag: freezes for everyone that get worse over time. If the server is in slow motion from the moment it starts, it's the CPU, and the fix is lowering what it has to simulate.
Do Build 42 animals cause lag?
They can, because the server simulates them even with nobody nearby. With big farms or lots of wild animals, lowering their numbers in the SandboxVars animal settings is one of the most noticeable fixes.
Shall we set it up for you?
Project Zomboid servers from €12 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Project Zomboid server, no card needed.
Not sure whether your server is online? Check it in a second with the Project Zomboid server status checker: players, version and password, free.
Free tool: Project Zomboid settings editor. Paste your .ini and SandboxVars.lua (or start from scratch), change their 400+ options with a search box, and download them.