Advertisement

Server Frames Per Second

Started by January 16, 2015 04:08 AM
3 comments, last by Butabee 9 years, 10 months ago
If a server only needs to send out data and do all it's processing at an interval of once per second, is there any reason to try to get it to run faster than 1 "frame" per second? I think it would be good to leave some leeway for any needed burst processing, so maybe try to get it running an average of ~5 frames per second.

With the assumption that you have build a reliable communication, you only need to send out data which have changed. So, if your data get only proceed once per second, you need to send them out once per second. With every frame just do


update data
check for modified data
send modified data
wait for next frame

Advertisement
It's a little more complicated in this case. I should have specified before but for a Unity server that handles physics I'm not sure I can do any waiting without it affecting the physics since Unity handles the threading, I wouldn't know where to put any stalls.
If the engine owns the main loop, then "waiting" turns into "do more work on the next 'tick' callback."
enum Bool { True, False, FileNotFound };

So it's pointless to wait it seems, since it just creates more work the next tick.

I mainly just want to process all physics entities within a second while supporting as many as I can. I don't think I need any artificial stalls.

This topic is closed to new replies.

Advertisement