Project Zomboid

Project Zomboid

JAspie Mar 10, 2022 @ 3:37am
Dedicated Server + Playing on the same PC
My specs before we go any further:
i9-9900K 3.6GHz > OC'd to static 4.9GHz
32GB HyperX 3200MHz
RTX 2080Ti 12GB

So, at the begining of my co-op playthroughs I hosted the server normally.
We quickly found that me as a host started teleporting around inconsistently after no more than 30mins to an hour playtime and the lag/desync on my friends end were too terrible to enjoy.

Having been watching some streams where I've been seeing better sync and no teleportations whilst jogging/running, I thought to myself; "Hm, I'll throw up a dedicated server on my PC, because that seems to distribute pings and resources more fairly to all the clients and there's no weirdness going on."

I set up a dedicated server on my PC (which can clearly handle it) for the 3 of us that are playing together (workload should be smooth as butter, right?). Got it running and we start playing again, immediately noticing a decrease of weird desync problems... at first. But then it happened, desyncs re-appeared, and they got worse and worse. But this time there was an additional weird phenomenon. For some unknown reason the RAM-usage skyrocketed up to 26GB/32GB used, and then just built up until it reached maximum usage and my client crashed. The other 2 I played with reported constant micro-stuttering before this event, and also said that it felt like their RAM-usage just kept going up.

At first I thought the RAM-distribution to the server was at fault, but it was not, as I had tried everything between 4GB up to 16GB. The same result every time. But then it dawned on me.. it's not the server, it's the client?!. As soon as I closed my game, all that RAM that kept piling up in usage, went away.. (?)

There's some sort of memory-leak happening when hosting a dedicated server and playing at the same time. Total usage of RAM should never go above 15GB total from the combined processes, according to .bat and .json settings, but yet it does.

Why is this? Anyone else that have experienced this anomaly? Anyone that has a solution or tips? I gladly welcome any and all input!

Thanks!
< >
Showing 1-15 of 16 comments
Cult of Nobody Mar 10, 2022 @ 4:31am 
Are you running any mods and if so have you tried running a vanilla server?

I can confirm though that I am hosting a server for 5 on a PC nowhere near the specs of yours and we have no issues other than we just tend to run our zombie pop a little high sometimes and cause a little lag.

I've not checked my memory usage while hosting since a few weeks after MP was released. I monitored it all the time for the first few weeks of MP.

Hope you get it figured out.
JAspie Mar 10, 2022 @ 4:58am 
I do run with mods yes. But before we dive into the usual "it may be the mods" debate. I've seen a modlist very similar to mine, with some excempts to a few that differ slightly. Same number of mods. I've tried running without map-mods and such and it still happens. Playing solo the RAM-usage and garbage-dumping works as intended. But for some reason the garbage-collection just keep on piling up until the stutters start and eventually causing client to crash.

The issue lies with Dedicated Server + Client on the same machine. Of that I'm positive.
There's some sort of anomaly that prevents client to free up memory when I run both on my system.

I even upped virtual memory to a staggering amount to no success.
The only other thing I could try is to move the server to a different HDD, but that's an extremely long shot.
Beard Mar 10, 2022 @ 5:44am 
Generally the RAM usage shouldnt go above the maximum, did you perhaps change any of the RAM values in the client and server defaults? The max client one is 3GB and by default the server one is 8GB
AlexSledge Mar 10, 2022 @ 6:03am 
I've seen some oddities as well.

Our dedicated server is always happily passing the 10GB mark rather quickly, and starts causing all the performance problems.. lag/stuttering/warping/etc.

As a test I fired up a locally hosted server (via Host in game) and monitored the server process (visualvm), it barely peaked to 3GB now and then but usually was settled a little bit lower.

This is with all the same mods in place.

So something is going on with the dedicated server that isn't present in locally hosted server from what we've seen.

@Zynergi Have you tried using the Host option in the client to see if it behaves any differently for you?
JAspie Mar 10, 2022 @ 7:00am 
Originally posted by Beard:
Generally the RAM usage shouldnt go above the maximum, did you perhaps change any of the RAM values in the client and server defaults? The max client one is 3GB and by default the server one is 8GB

Everything on default. I even went to the length of uninstalling Dedicated and Client and re-installing them fresh with no change to RAM-allocation. I even deleted the server .ini files and created a new server configuration, no change there either. If I run the client without the Dedicated server running, the RAM-allocation behaves normally and the garbage collection does its job, and vice versa.
But as soon as I run Dedicated Server and the Client together, the client starts to accumulate more and more RAM until it maxes out and makes the client crash.
I'm no expert in coding, but I believe there's some sort of glitch happening when you run both of them and play on the dedicated.


Originally posted by AlexSledge:
I've seen some oddities as well.

Our dedicated server is always happily passing the 10GB mark rather quickly, and starts causing all the performance problems.. lag/stuttering/warping/etc.

As a test I fired up a locally hosted server (via Host in game) and monitored the server process (visualvm), it barely peaked to 3GB now and then but usually was settled a little bit lower.

This is with all the same mods in place.

So something is going on with the dedicated server that isn't present in locally hosted server from what we've seen.

@Zynergi Have you tried using the Host option in the client to see if it behaves any differently for you?

Hosting works without any hiccups, except for the odd teleportation when running after a while. RAM-allocation and garbage collection behaves as intended. I figured running a dedicated server to play co-op on through my system would make things not desync annoyingly only seemed to make it all worse somehow. A bit frustrating when you want to explore and the glitch prevents you doing so.
Beard Mar 10, 2022 @ 10:48am 
Can I ask how you installed the dedicated client? Was it through Steam or SteamCMD?
JAspie Mar 10, 2022 @ 2:27pm 
Originally posted by Beard:
Can I ask how you installed the dedicated client? Was it through Steam or SteamCMD?

I installed the dedicated using the steam download.
Is the steamCMD refommended and more stable?
Intulect Mar 10, 2022 @ 3:25pm 
16GB is hands down not enough to run modded with a client running, each person requires roughly 300-500mb ON VANILLA, this being said, it can be upwards of 1.5gb per player with mods, not to mention, client almost requires 8gb+ dedicated to it to keep running smoothly
Intulect Mar 10, 2022 @ 3:28pm 
My suggestion would be to run the client with console and check for errors aswell, if you notice any form of constant client logs that dont match on server (Memory leak would be visable on client side)
Intulect Mar 10, 2022 @ 3:30pm 
Misread specs just saw its 32gb system not 16gb- if you dedicate 16gb each client and server it should run smooth theoretically (Client maybe slightly lower ofcourse to save some for system and other processes, like 8-10gb)
Last edited by Intulect; Mar 10, 2022 @ 3:31pm
Spanton Mar 10, 2022 @ 3:54pm 
Originally posted by Intulectual:
16GB is hands down not enough to run modded with a client running, each person requires roughly 300-500mb ON VANILLA, this being said, it can be upwards of 1.5gb per player with mods, not to mention, client almost requires 8gb+ dedicated to it to keep running smoothly

I run an old i5 with a geforce 660 card and 16 gigs of ram total (I give the server 6) and I can run a dedicated with 85 mods for myself and 2 others no problems while playing on that same pc...

...just an fyi as it may not be the ram....is someone on wifi?
Last edited by Spanton; Mar 10, 2022 @ 4:06pm
JAspie Mar 10, 2022 @ 4:19pm 
Originally posted by Spanton:
I run an old i5 with a geforce 660 card and 16 gigs of ram total (I give the server 6) and I can run a dedicated with 85 mods for myself and 2 others no problems while playing on that same pc...

...just an fyi as it may not be the ram....is someone on wifi?

None of us are on WiFi. Both me and my girlfriend are cable-connected to the router. We have a 500mbit fiber comnection, and my friend lives not too far from us also on a 250mbit fiber connection.
Beard Mar 11, 2022 @ 1:00am 
From what I know the SteamCMD install is more stable, since how Steam handles the Dedicated server install can be a bit iffy, from what I know.
Here is a good guide for SteamCMD:
https://steamcommunity.com/sharedfiles/filedetails/?id=2683719613
JAspie Mar 11, 2022 @ 2:24am 
Originally posted by Beard:
From what I know the SteamCMD install is more stable, since how Steam handles the Dedicated server install can be a bit iffy, from what I know.
Here is a good guide for SteamCMD:
https://steamcommunity.com/sharedfiles/filedetails/?id=2683719613

I will try SteamCMD and check statistics during gameplay. Thanks for the guide!
JAspie Mar 13, 2022 @ 4:21am 
Update: So I've downloaded SteamCMD and set up a PZ server folder.
Now the question is. How do I change to the beta branch 41.68?
< >
Showing 1-15 of 16 comments
Per page: 1530 50

Date Posted: Mar 10, 2022 @ 3:37am
Posts: 16