Sim-eth-es dedicated server cpu usage


#1

Hi

I’ve gotten my game hosted, using the dedicated/headless sim-eth-es server. Is it supposed to run at 100% cpu usage (1 core) ? There are no players connected.

Just wondering what I should expect :slight_smile:


#2

Real question is,would it be acceptable for you to run a game at 100% CPU?
The game will be lagging so either you’re wasting valuable resources with your implementation or you should host on a better performing PC.


#3

Okay, så I ran code as is provided by Paul and it does the same (100% usage on one core). Hmm - has anyone got any experience with this ?


#4

There is a loop that busy-waits and will gobble available CPU in the process. That CPU is still available to other processes but it will be used by that loop if nothing else is using it, basically.

If you care slightly less about the responsiveness of that loop then you can change a setting that lets it relax a little.

…but actually, it should default to 1 and be fine.

I thought maybe it was set to 0. Maybe it’s something else then.


#5

I have a friend hosting the game server, and he was just concerned about the cpu usage/power usage.


#6

You can try adjusting that value and see if it helps… or use jconsole to see which thread is busy. It could be something else.


#7

There is an idlesleep time in both GameLoop and StateCollector, can both be adjusted and what would be the immediate consequences of doing so?


#8

When you increase the idle time of either loop, you risk that some other process on your machine will be gobbling up so much CPU that the sleep doesn’t return in a timely manner. (Actually, for anything over 0 which is a special number in Java sleep() this will kind of be true.) For the state collector, this means that you might start accumulating too much history and have to drop it on the floor before it goes out. Clients will see jumps in action or be jittery. For the game loop, it means that physics may not update “on time”… which is certainly less critical over all.


#9

Okay, så for a virtual server (non-windows) dedicated to only hosting this - it could work with adjusted values. Thanks for clarification!