[SUGGESTION] Standby mode for craftbukkit? To reduce cpu/electricity consumption.

Discussion in 'Bukkit Discussion' started by sleepysonic, Oct 27, 2011.


Would you like a standby mode for craftbukkit?

  1. Yes

    35 vote(s)
  2. No

    4 vote(s)
Thread Status:
Not open for further replies.
  1. Offline


  2. Offline


    First off, sorry for the long post. I know it's been 2 months since the last post, and people sometimes get testy about that, but I think it makes more sense to post here than start a redundant thread.

    I'm setting up a small bukkit server for the first time, and am interested in this topic. I just want to share what my experience has been with doing this in case it helps anyone, and also mention an unexpected problem that maybe could be addressed somehow.

    I've set the server up on a motherboard whose "suspend to RAM" standby mode (ACPI S3) I know works reliably. This is very desirable for a small Minecraft server - you get 24/7 availability but don't waste power when it's idle most of the time. It's *much* more effective than speedstep or other lesser forms of power management. Suspend to RAM drops power down to just a few watts (single digits) and makes the system silent and indistinguishable from being all the way off.
    OS is WinXP, I haven't tried this on Linux.

    Making it work:
    S3 standby (not just S1) must be enabled in the BIOS. Some boards don't have this feature, and on some it doesn't work reliably. Windows needs to recognize the feature and give you the option to "standby" on the shutdown menu. You can then test invoking it manually, to verify that it actually works.

    In the control panel, device manager, go into the properties for the network adapter which incoming Minecraft connections will be received from. The settings for that adapter must be set so that it can wake up the system from standby. "Allow this device to bring the computer out of standby" should be enabled. Another option is also there which I believe restricts it to only respond to Wake-On-LAN "magic packets". I left that off. If you turn that option on, then Minecraft alone won't wake it up.
    With this setup, it means that any incoming network connection could wake up the system. You may find it wakes up for no good reason sometimes. This is an unfortunate side effect but at least in my case, I found that this didn't happen enough to be a problem. I believe it was caused by other Windows machines making idle chit-chat. Eventually they forgot about the Minecraft machine and it stopped happening.
    I did switch to an add-in Intel 82559 card but I don't know if that was a factor in stopping the bad-wakeups.

    You can use http://www.yougetsignal.com/tools/open-ports/ to test port forwarding and verify a remote connection will wake up your server.

    Side note: I found that when the client is browsing multiplayer servers in Minecraft, it doesn't actually connect to the server until you scroll it into view on the list. Once you scroll down to it, *then* the server wakes up. You'll get a red X, but after you refresh a few seconds later, the server will then show it's ready. This might confuse users but if you're just running the server for a few friends or family, it's easy to explain that to them.

    At the moment it wakes up, you'll get some "can't keep up!!" warning messages in bukkit. I don't know if having it wake up to a time-lapse of several hours will cause anything weird to happen, but I haven't seen anything.

    Windows XP will only invoke automatic standby if the CPU utilization stays below 10% for the entire length of the standby delay you specify in the control panel's power options. If anything causes CPU to jump above 10%, it will reset the timer.
    I found that the java quick starter process (jqs.exe) was causing it to hit 10% every few seconds. Once I disabled that in the Java options, the CPU spikes stopped occuring and the standby delay started working.

    If your delay is set too long, there's a greater chance that some process may sporadically hit 10% CPU before the timer expires, so it will never enter standby. If you run into that problem, you'll have to figure out which process is doing it (watch the task manager) or try lowering the delay time.

    On my machine, I found that even with Bukkit running the CPU was only at about 4% most of the time, so it can enter standby with Bukkit idling. Bukkit CPU usage will go much higher if it needs to load terrain, and maybe for other reasons.

    The Problem:
    Low idle CPU usage means the server can go into standby while people are logged in.
    I was logged into the server, digging cobblestone under my house. Unfortunately, since I wasn't running around, this left Bukkit with very little to do. As a result, the server powered down into standby mode while I was logged in and playing.
    This is a problem - it's not unusual for players to be stationary while digging for long periods of time. It won't happen if you have many users, but then if you have many users you also don't have as much use for standby mode anyway.

    I suppose this could be solved by some mechanism that would occasionally spike the CPU usage if
    1) users are logged in And
    2) CPU usage has been "too low" for beyond some period of time

    This could maybe be some setting in the bukkit configuration. Busy servers won't have any use for it.
  3. Offline

    Lost Man

    I have no problem on that front. I am using the tekkit server and it has a built in "feature" that it prevents your computer from going to sleep when the server is running but MCsignondoor does not prevent sleep.
    So when I used the plugin the server would close and thus allow the computer to sleep. I am on day 0 of actually running the server but all the setup looks good so far. I am using a more reliable means of waking the computer but I guess yours is a lot easyer. I have the person run a putty script that tells my WRT router to send a wake-on-lan packet. then the user tries to sign on twice then they are in.
  4. Offline


    Hello, I guess this is what I was looking for but the MCsod plugin doesn't seem to work in 1.4.6 for me, although some people seem to be making it work. I just have a few questions, does having a server in standby reduce bandwidth usage ? And is there a way, without accessing the bios, to put the computer to sleep while MCsod is working ?
Thread Status:
Not open for further replies.

Share This Page