Power saving for idle Linux servers

Who cares?

If you run an idle Tribes 2 Linux dedicated server in your basement, this could decrease your idle power consumption.

It might work on Windows and with bot servers but I haven't tested on either. Bot servers will likely need better player count checks.

I want it, what do?

Add the script to your mod/scripts/autoexec/ folder or exec it as part of your startup scripts. The script has no effect unless the game launched in dedicated server mode. It will increase your minimum ping to 32ms when no players are connected.

Background

An i7-7700K powers https://twitch.tv/t2vault - this consumes around 120 watts.

After starting a Tribes 2 dedicated server, the power draw increases to 220W: an extra 100 watts! The dedicated server takes up 8% of this aging 4c/8t processor.

I realised that the server's sleep per iteration is only 1ms. With the Linux task scheduler and a mostly idle core, this is actually 1ms, so the dedicated server does a lot of nothing very fast.

Obviously, I don't want to give players a bad experience but I also don't want to double my power bill if I don't have to.

A happy middle ground seems to be setting that sleep to 32ms or higher and resetting it to 1ms when the server has active players. A 32ms sleep was enough to push my process into the 0.5 to 0.7% consumption zone without severely affecting ping. I actually run it at 50ms which hides it's consumption in the noise of the vault stream.

All copies of Tribes 2 are executed through the current version of Wine, 8.8.

Comments

  • There's an even more extreme approach to this that can bring consumption down basically to full idle by waiting until there are incoming packets to process, which in practice would actually look like a ping reduction since it'd respond almost immediately... would still need to wake at intervals for things like map cycling or run any scheduled tasks, of course, but otherwise there's not technically any need for the server to do anything until it has to respond to someone. I wouldn't necessarily recommend attempting it with mempatches or if you ever need to input anything in the console window though.

  • Tried this in a very similar-spec server and sadly there's no differentiation between ai and human players.... so with an ai server it's non functional but does execute.

  • Setting the HostGamePlayerCount from 0 to the static bot count enabled the functionality of the script. May this script save Admins of the far flung Wilderzone millions of Tribal Credits, with my thanks to all involved in its creation.

Sign In or Register to comment.