13

I have cloud storage data centers running Ubuntu 16.04 LTS and NextCloud/OwnCloud that have no need to be available 24/7 and need power management solutions. Servers are Dell PowerEdge 1950 Gen II and Dell PowerEdge 2950 Gen II

Overall Objective

Hibernate cloud storage servers past an idle time for example 20 minutes and have such de-hibernated with WOL to reduce 6272.09 kilos of carbon dioxide per year being 6680kw from our data center alone, metrics achieved throughout a detailed energy audit.

Ineffective solution tried

Landscape

The landscape on-premises/cron jobs only offer scheduled startup and shutdowns, thereby ineffective for our achievable.

Powernap

powernap seems the way to go but the service is not starting on Ubuntu 16.04

XXXXXXX~$ sudo service powernap status
● powernap.service - PowerNap
   Loaded: loaded (/lib/systemd/system/powernap.service; disabled; vendor preset
   Active: inactive (dead)

powernap seems to use depreciated services such as network.service which are no longer available in Ubuntu 16.04

Achievable objectives

Wake on LAN (WOL)

Enabling WOL is straightforward by following the manual setup on this link. or with the use of power wake

Server Hibernation

Until now, I have only managed to hibernate the servers using sudo systemctl hibernate and sudo systemctl hibernate-sleep

  1. powernap - I am filing bug reports to remove depleted dependencies
  2. systemctl - could lead to somewhere
  3. pm-utils - could lead to somewhere too

Hardware Upgrades

I have upgraded the CPUs of the Dell 1950 Gen II dual Xeon E5335 with Xeon X5365 CPUs. The X5365 enable power management and set power management from BIOS. In all honesty, I was not in favor of such upgrade as the X5365 consume 70 watts per CPU more than E5335, but did such in favor of hibernation testing.

Update 1

At this moment in time pm-utils is the only way to go apart from setting wol on the nic. Currently, I am exploring the optimal configuration to create a powerful hook for ac settings for idle time.

Any recommendations, please.

  • 1
    Welcome to Ask Ubuntu. Please, what is your question? Please be more specific. – MadMike Feb 21 '17 at 10:08
  • Hibernate cloud servers past an idle time and have such de-hibernated with WOL. The extra detail is to give a working scenario example. – Fab Feb 21 '17 at 10:10
  • 1
    I couldn't quite grasp what your stumbling block(s) is/are. What have you tried that is not working and/or what specifically do you need help understanding? – Zanna Feb 21 '17 at 10:12
  • 3
    Isn't hibernating unpractical? Depending on your RAM size and disk read/write speed, hibernating and resuming can take up to few minutes. How are requests handled during that time? Will your users want to wait that long? Simply suspending might be a better compromise to save power while staying more agile. And maybe virtualizing your servers and hosting them on one powerful machine or a cluster that allows you to suspend/resume parts while balancing the load on others could also help saving power. Note that I have no experience with large scale server systems though, just guessing. – Byte Commander Feb 21 '17 at 10:48
  • 1
    I concur with Byte Commander. For input from people with actual experience in data centre operation you should probably ask over on Server Fault. – David Foerster Feb 25 '17 at 8:33
0

I put together a little script which you could run in a cronjob every 15 minutes or using systemd timers:

#/bin/bash

NActiveUsers=$(who -q | awk -F'#' '{printf $2}' | awk -F'=' '{printf $2}')
AvgLoad15Min=$(cat /proc/loadavg | awk -F' ' '{print $3}')

ActiveUsersThresh=2
AvgLoadThresh=0.15

if [ "$NActiveUsers" -lt "$ActiveUsersThresh" ]
then
    LoadBelowThresh=$(echo $AvgLoad15Min'<'$AvgLoadThresh | bc -l)
    if [ "$LoadBelowThresh" -eq 1 ]
    then
        systemctl hibernate
    fi
fi

It first gets the number of users which are logged in to the system and the average load during the last 15 minutes. You should be able to find out your idle average system load using cat /proc/loadavg. The third floating point numbers gives the average over the last 15 minutes. This value is helpful to define a threshold set in the variable AvgLoadThresh. This certainly will need tuning. The other thing that you can define is how much users are allowed to be logged in and the system goes to hibernate anyhow. This is set in ActiveUsersThresh. Just to make sure the system is not always hibernating when you are doing maintenance or something.

I guess one could come up with more intelligent checks, so see it as a first simple-minded approach. For example, i don't know which database or webserver is used in your owncloud installation but you could try to stop them gracefully before the hibernate command, so nobody would suddenly loose connection.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.