Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Master Untangler
    Join Date
    Nov 2009
    Posts
    106

    Default Cut your power consumption (maybe)

    You might be interested in this if:
    • Your Untangle box has a "high power" processor, and
    • The load on that box periodically varies from "hammered" to nothing, and
    • You're interested in saving $10 - $40 in electricity in a year (along with the heat load)


    This is not for you if:
    • Your Untangle box is under heavy usage 24/7, or
    • It's an Atom (or similar), or
    • You don't care about how much power anything uses.


    Summary: Linux supports processor clock frequency load dependency (Intel calls this SpeedStep or EIST). The Untangle installation does not enable it. I've tested it on three different platforms with both 32- and 64-bit distributions and found no ill effects. The amount of power that can be saved varies quite a bit from hardware to hardware, but (assuming that the load varies sufficiently to warrant this mod) you can expect at least 5W and as much as 20-30W saving at the power mains.

    Examples:

    E7300, 64-bit. Idle power without Processor Clock Modulation 54W. With PCM, 46W at the mains input.

    Q8400, 64-bit. Without PCM 69W. With 52W.

    Power consumption under full load is not affected. But if the box is under full load only 50% of the time it's running, this can add up over the course of a year. Anecdotally, the box in my home spends 97% of its time at the lowest clock rate.

    Here is a fairly thorough tutorial on the steps involved. I suggest that you give this a read to see what's involved. As it turns out, the changes you have to make to your system are VERY easy and involve edits to only two files. All the other instructions you see in the tutorial are ways to make the changes to a live box without rebooting. Since you can read all that for yourself, I'm not going to rehash it.

    So sifting it all down, here's what you actually need to do to make this work. This example is for any of the popular Intel processors. Read the tutorial for details on AMD processors.

    First order of business is to verify that SpeedStep (or whatever it is called on your system) is available and enabled in BIOS settings.

    Login as root.
    Edit /etc/modules with nano:
    You will see only one non-comment entry there: "loop"
    Insert the following above the line with "loop"
    acpi-cpufreq
    cpufreq_ondemand
    cpufreq_stats
    freq_table


    Note that cpufreq_stats is optional. All this does is record the time (in 10's of msec) spent at each of the processor's frequency states. If you're not interested in knowing that, simply omit this line. The stats are kept on a virtual file, so these records do not entail writes to your disk or SSD.

    Open /etc/rc.local with nano. Above the line that says "exit 0", add the following line(s), one for each of your processors. That includes Hyperthreaded processors, so if you are using an i7-3770, you'll have 8 lines, cpu0 through cpu7.

    echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    ....
    echo ondemand > /sys/devices/system/cpu/cpu[last]/cpufreq/scaling_governor


    All other settings are created/enabled by default and you don't have to think about them. This is why it's far easier to make the changes and reboot to have them take effect.

    Now reboot.

    If you've done it right, when you hover over the "CPU Load" window above the rack, you will see the nominal processor frequency followed by the current frequency. If the box is idle, the latter will be a much smaller number than the former, and you will be saving a few watts.

    Finally, note that both of the files that you edited will likely be overwritten by an update, particularly any update that involves a new kernel. Needless to say, it would be useful if Untangle's developers would incorporate this into the automated configuration.

  2. #2
    Master Untangler TirsoJRP's Avatar
    Join Date
    Oct 2010
    Posts
    421

    Default

    Will test it tomorrow.

  3. #3
    Untangle Ninja sky-knight's Avatar
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Posts
    25,071

    Default

    I "think" and I put that in quotes because I need to go verify it. But I "think" this improvement is stock in Debian Squeeze. So rather than hack your OS, if you're wanting these gains in a supported way it'll just be part of the prize for surviving the OS upgrade whenever we get it.
    Rob Sandling, BS:SWE, MCP
    NexgenAppliances.com
    Phone: 866-794-8879 x201
    Email: support@nexgenappliances.com

  4. #4
    Untangle Ninja jcoehoorn's Avatar
    Join Date
    Mar 2010
    Location
    York, NE
    Posts
    1,786

    Default

    I remember something about this from when I first set up our database server here about 2 years ago. There were two counter-intuitive things we were advised to do with the CPU.

    The first was to disable hyperthreading. Hyperthreading forces you to split your CPU cache between the two virtual cores, and database workloads can often do better on fewer processor that each have more cache. Of course, this is one of those "you need to measure it on your system" things. This was a new system for us, but the vendor supplying that app that this server would support recommended it based on testing they had done with other clients. The good news is that it likely doesn't apply at all to UT.

    The other thing we looked at was SpeedStep. It turns out that under certain kinds of server loads, speedstep is often not very good at ramping back up to full speed: you get a server that always runs near the bottom of it's allowed range. Again, this was with pure database server workloads, but this time it is worth checking out for UT.

    I looked for the original article and couldn't find it, but I did find this:
    http://www.brentozar.com/archive/201...s-not-so-fast/
    Last edited by jcoehoorn; 10-22-2012 at 12:29 PM.
    Five time Microsoft ASP.Net MVP managing a Lenovo RD330 / E5-2420 / 16GB with Untangle 15.1.0 to protect 500Mbits for ~450 residential college students and associated staff and faculty

  5. #5
    Untanglit
    Join Date
    Dec 2008
    Posts
    27

    Default

    Quote Originally Posted by sky-knight View Post
    I "think" and I put that in quotes because I need to go verify it. But I "think" this improvement is stock in Debian Squeeze. So rather than hack your OS, if you're wanting these gains in a supported way it'll just be part of the prize for surviving the OS upgrade whenever we get it.
    Have you confirmed? SpeedStep would be nice since most installations have variable loads and off-peak hours.

  6. #6
    Untangle Ninja sky-knight's Avatar
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Posts
    25,071

    Default

    I know the features as outlined are present in Debian Lenny, but unconfigured. The OP illustrates a method to configure the CPU Scaling and enable it.

    It seems odd to me to think the new OS, with support for GPT partitioning, a new boot loader that works off UIDs and not dev flags, and other modern OS improvements wouldn't also implement CPU scaling in some way.

    However, I do NOT recommend CPU scaling with Untangle. It's directly responsible for a good portion of the performance issues associated with Untangle when virtualized.

    Basically, there's a delay between the load request and the load being available. The same troubles can be loosely associated with hyperthreading. In normal circumstances the delay is unnoticeable, but for Untangle that delay can mean dropped packets. A nanosecond waiting for the CPU to ramp up is enough to throw off a SSL handshake.

    Call me an apologist, purist, <insert derogatory appellation here> but I'll stick with what the Untangle devs come up with. That isn't to say the community won't come up with good ideas, but Untangle devs do a bang up job researching performance tuning. Recent releases reflect this in many beneficial ways. I'll leave it to them to turn these toys on or off. So if you want to play here, please do so. But please don't put it into production without an understanding of what you're doing.
    Rob Sandling, BS:SWE, MCP
    NexgenAppliances.com
    Phone: 866-794-8879 x201
    Email: support@nexgenappliances.com

  7. #7
    Untanglit
    Join Date
    Dec 2008
    Posts
    27

    Default

    Quote Originally Posted by sky-knight View Post
    I know the features as outlined are present in Debian Lenny, but unconfigured. The OP illustrates a method to configure the CPU Scaling and enable it.

    It seems odd to me to think the new OS, with support for GPT partitioning, a new boot loader that works off UIDs and not dev flags, and other modern OS improvements wouldn't also implement CPU scaling in some way.

    However, I do NOT recommend CPU scaling with Untangle. It's directly responsible for a good portion of the performance issues associated with Untangle when virtualized.

    Basically, there's a delay between the load request and the load being available. The same troubles can be loosely associated with hyperthreading. In normal circumstances the delay is unnoticeable, but for Untangle that delay can mean dropped packets. A nanosecond waiting for the CPU to ramp up is enough to throw off a SSL handshake.

    Call me an apologist, purist, <insert derogatory appellation here> but I'll stick with what the Untangle devs come up with. That isn't to say the community won't come up with good ideas, but Untangle devs do a bang up job researching performance tuning. Recent releases reflect this in many beneficial ways. I'll leave it to them to turn these toys on or off. So if you want to play here, please do so. But please don't put it into production without an understanding of what you're doing.
    How would a nanosecond throw off a SSL handshake when its use is in the millisecond domain? (Really, just trying to learn.)

  8. #8
    Untangle Ninja sky-knight's Avatar
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Posts
    25,071

    Default

    Untangle by its nature has a tendency to slow network communications. The additional ms of delay introduced by speed step could be just enough to cause a timeout, that will at best lead to connection sluggishness and at worst lead to connection failures.

    This sort of stuff is crazy intermittent, and a nightmare to troubleshoot. If you're in for the rough ride and just want to know, go for it. For me, I'll just concentrate on my customers' needs and trust Untangle to do that level of performance testing. As I said before I believe these features are active by default in Squeeze. So we'll find out soon enough if they help or hurt, or are a complete wash.
    Rob Sandling, BS:SWE, MCP
    NexgenAppliances.com
    Phone: 866-794-8879 x201
    Email: support@nexgenappliances.com

  9. #9
    Master Untangler
    Join Date
    Sep 2011
    Location
    Brisbane AU
    Posts
    118

    Default

    This discussion is based on an assumption that making these changes will conserve energy. Has this theory been tested and a benefit demonstrated? If not, we are discussing conjecture.

  10. #10
    Untangle Ninja sky-knight's Avatar
    Join Date
    Apr 2008
    Location
    Phoenix, AZ
    Posts
    25,071

    Default

    Quote Originally Posted by keith_h View Post
    This discussion is based on an assumption that making these changes will conserve energy. Has this theory been tested and a benefit demonstrated? If not, we are discussing conjecture.
    Nailed it in one.
    Rob Sandling, BS:SWE, MCP
    NexgenAppliances.com
    Phone: 866-794-8879 x201
    Email: support@nexgenappliances.com

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO 3.6.0 PL2