50+% CPU usage at idle (no players connected)?

Hi

I’m playing around with making dedicated server a possibility in my game and is via that playing around with Unity’s Multiplay service.

However, I have noticed a very odd thing. My server runs at idle 50+% CPU usage. So, just the server running no players connected. The game doesn’t really have more than an Enviro Sky going if no players are in.
When running it on my own machine, it runs at less than 1% in idle stage.

Fair enough my CPU is a lot better than the 2 CORE ones on Multiplay (which I can’t upgrade apparently which is also wierd), but still, 50% idle seems like a bug of some sort.

The spikes is when I’m joining 1 player and doing some stuff to stress the system - the flat line above 50% is just the server running alone.

Is this normal or?

Hello!

More often than not, massive baseline CPU usage like this can actually end up being due to framerates. Try setting a sensible targetFrameRate based on the needs of your server, and see if that helps with the CPU usage.

On local machines, it is less of an issue usually, as you’re often bound by the graphical engine in the game. As everything in Game Server Hosting is running headless, you can end up with 1000+ FPS which chews up the CPU pretty quickly.

Cheers,
Josh

Brilliant! Makes so much sense, didn’t think about that! I’ll give it a try :slight_smile:

Wanted to try it out now, but for some reason I can’t see any CPU usage in the dashboard now. It’s like it’s not being updated at all. And it was like that before I changed any code, so seems to be an issue with the Multiplay/Game Hosting Portal?

Ok CPU and Memory usage now working again on Multiplay dashboard and it WAS the targetFramerate that was the problem. Really for dedicated builds, Unity should default to 30 or 60 per default, instead of just letting it run wild.

Anyway, thanks for the input fixed it - now it idles around 3-4% :slight_smile:
9457673--1328336--upload_2023-11-8_9-22-24.png

1 Like