Jump to content

Server Optimization / What Performance Can I Expect?


zyros

Recommended Posts

Hey everyone,

So I got my server set up, figured out the escoteric arcana that is the soft reset process, went public, and have managed to (mostly) keep this boat afloat.

Now I'm starting to wonder about server optimization - but the first obstacle I'm encountering is that I have NO idea what kind of performance I should even be expecting from this jalopy.  When I talk to other players / server admins about what kind of performance is possible with this game given my current setup, I get widely varied answers.  Nobody really seems to have a clue.

So I'm starting this thread with two objectives in mind:

1) I'd like it if other admins who have managed to get a server successfully running for a week or so to post their setup / performance here so that we can zero-in on some answers?

2) I wish to ask if anyone knows of any methods to optimize performance and/or can anyone think of any obvious mistakes that would adversely affect lag?


Here's what I am running -

Cores: 6
Memory: 16 GB (85% of which is allocated to project-zomboid-dedi-server.sh)
OS: Linux Debian 7
Cost: ~$100/month
Location: US, Chicago
VPS hosted by NuclearFallOut.


Here's the performance I'm getting -

0-10 players: Lag is good.  You can tell it's not single player, but there is (largely) no glitchy behavior.  Zed's rarely phase; when they do, it's only for a split second, and normal gameplay resumes immediately after.

10-15 players: Lag is noticable.  Second or two of delay when talking in global chat.  Zombies phase left and right to the point of no longer presenting a risk to players.

15+ players: Lag is unplayable.  2-3 seconds of delay when talking in global chat.  Zombies phase so much most players can run right through a horde and be unaware that they are even there.  Even trying to follow another player is pretty difficult to do.  It's pure farm-simulator and Minecraft builder with this many people on, because zed's are pretty much non-existant.



So!  Anyone have any suggestions / feel like posting their own setup?

Link to comment
Share on other sites

Same behaviour for me. Does your PZ-server-process allocate more RAM than you assigned? My server eats up my whole RAM, regardless how much I give to it.

 

My specs:

Intel Core i5-3450 (4x3,10GHz)

16GB RAM (I assigned 10GB for PZ)

2TB HDD

1GBit connection

 

It´s a root-server, so no hardware-sharing of any sort.

Link to comment
Share on other sites

You're on a VPS. That makes estimations pretty difficult, since CPU matters.

My server eats up my whole RAM, regardless how much I give to it.

This sounds like a networking-related memory leak, since the JVM heap can't grow beyond the -xmx parameter the allocations have to happen in native code. Do you have any details on this? Could you start a ticket on the issue tracker with any additional info you can get, such as how quickly the memory usage goes up, and whether any particular kind of activity on the server affects it.

Link to comment
Share on other sites

Tweaks will definitely happen, seeing as you're playing an earlyish multiplayer version of a work-in-progress game.

 

That said, it'd certainly be nice if server admins, especially the long-time ones, could post their hardware and connection specs, along with number of players they've been able to support.

Link to comment
Share on other sites

i posted my first "guess" on performance bottlenecks in the Bug Tracker,

 

though im really a hardware guy and do not really know if you can do any improvements for the Java-Environment.

 

 

Im running a Bare Metal Server 

16 GB RAM  (from which only 8G go to the PZ-Server-Process)

i7 Core (4x 3.4 GHZ)

1 GBit dedicated Connection

OS: Ubuntu 12.04

 

It works pretty good with 15 or below, and works okay with up to 24.

But i can really make the Server Process suffer a lot with that many users.

As soon as i zoom around the map with increased Admin Speed when more than 20 People are connected,

a lot of "Black-Cell-Loading" occurs. Zombies freeze down into Super-Slowmo.

 

While monitoring the Server-Console during that time, you can really see that the server process got good Work Loading/Unloading Cells. I guess thats the main reason we see this "Black-Cell-Loading", all this while the CPU is chilling with 3 completely un-used Cores.

So i dont think its  a Hardware issue, specially since i got no shitty V-Server.

 

Changing the available RAM from 4Gig up to 8 Gig did not really solve the issue or improve the behaviour in any noticeable way.

 

Thats why i come to suggest to put the Zombie-AI-Processing into a seperate Process/Thread. When lots of Cell Loading/Unloading is happening on the Server, you can really see the Zombies Moonwalking on a spot and "waiting" to be processed. And vice versa - when zombies are currently processed you can see Black-Cell-Loading occur. Specially the "Zombie_wait" looks a lot like the Lag Prison Architect used to have when your prisons got big, what they solved with putting AI Processing into a seperate Process aswell

 

 

If you need any more info, feel free to ask me im happy to help!

Link to comment
Share on other sites

Not sure if you misunderstood me (sorry, no native english speaker here),

 

but i was referring to Server Performance / Lag. And a shot in the Blue where i /feel/ the problem may be.

 

 

For single-player one process doing everything may be completely okay - its only one Character everything is calculated for / interacts with. But with Multiplayer some things have to happen independent from each other, just by the nature of how CPU's process things.

And if the CPU is busy moving zombies then it wont start loading cells just cause _another_ player just requested it, instead it will take the request, put it on the stack and process it when it got time for it.

Link to comment
Share on other sites

I'm saying that the program is already multithreaded and should be making use of more than one core, yes. It already should be. Loading/saving chunks is done by one thread, rendering another (rendering, of course, doesn't apply to the server -- there are something on the order of 25 threads for the client) .etc
 

Have you tried setting core affinity for your respective operating system?

ngLA9eA.png
The spike is from starting the ProjectZomboidServer.bat and letting it load to the point that it's accessible from the port. You can see all 4 cores utilized, but there's no  way I can get enough people to check if this continues for individual players.

Link to comment
Share on other sites

On linux its using MultiThreading aswell, yes, but theres always unused (50-70%) CPU Power there to be taken.

 

Talking Linux: You got up to 400% CPU Usage. 100% per Core. 

the peak cpu usage i've seen the server process take was 130%.

 

Since its all happening in java, it could good be that i have to tell java to use cores more aggressively - if so please tell me how to do that.

 

From the OS-Side i already did that with renicing the process - and that did help improve performance slightly.

I could try bind the process to specific cores and see if that changes anything.

 

 

But it seems my input is heading in the right direction, if you designed the Program in that way.

 

You know how your Code works, i dont - i can only say what it /looks like/ for me.

 

And it simply looks like everytime Heavy Cell Loading is taking place (according to the Server Console) the Zombie Processing is slower.

Link to comment
Share on other sites

Loading/saving should already be on its own thread . . . at least for the main game. Whether it is for the server would take some investigating.

Any new infos on this?

 

I´m currently gathering some information about java parameter optimization and will test some stuff. Any tips in this direction?

 

EDIT:

BTW, if you are running Linux what java are you running? I´m running this:

OpenJDK 64bit Server VM (build 24.51-b03, mixed mode)

Maybe there is the culprit for the sometimes strange performance?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...