Ive recently made a dedicated server for my game (empty scene with the server script). all that is being executed is the initial Network.InitializeServer(…) function and all that gets looped is the GUI.
My question is this:
Im seeing a 40% - 50% CPU usage on both my cores.
Is this normal ? , if so … why ?
Is there a way to lower usage ?
and how mush is it going to increase with incoming connections.
Im starting to assume that 40-50% isnt normal ???
can anyone tell me this for a fact ?
Ok, full 3D scene but no audio sources or draw Calls, not a single poly…
im thinking that this seems like a infLoop but, not in my code, i looked. but surely the Network Server function uses a lite thread with a decent wait so it cant be that, can it ?
Can the OnGUI() function be slowed down ?
To do like 5 Draws a second or something ?
No, i saw earlier posts of jashan were he reported the same problem: The game will just fill up the CPU to get an as high possible framerate. Therefore you need to limit your framerate. There was a very easy trick for this…
Because there was noting taxing in my scene i was getting a frame rate of 800+. This caused the GUI to be drawn 800+ times a second, which gave me a 50% CPU usage. After using a sleep
Hehe, yeah - I really liked the server framerates of 1000+ on my server, too
I think Unity 2.5 introduced a new feature that allows you capping the framerate. I’d assume that the Sleep(…) approach does essentially the same, but it might be nicer to use that new feature.