Reducing Power consumption
-
Hello,
I was interested how I can reduce the power consumption of my pfsense enclosure (its a Kettop Mi4300YL with a i5 Processor).
I was reading a lot on the internet and finally I got it managed to reduce the power consumption by aprox. 2 Watt (for a 24/7 enclosure i think its significant)
In my case these settings got me there:In loader.conf.local:
hw.pci.do_power_nodriver=3
kern.hz=100In fine tuning settings:
hw.acpi.cpu.cx_lowest=C3 (in my case its C3)
kern.eventtimer.periodic=1
After that executing:
sysctl dev.cpu | grep cx
before and after the settings there are these results:
before:
dev.cpu.1.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc dev.cpu.1.cx_usage_counters: 2970691995 135765026 692632892 dev.cpu.1.cx_usage: 78.19% 3.57% 18.23% last 4620us dev.cpu.1.cx_lowest: C3 dev.cpu.1.cx_supported: C1/1/1 C2/2/148 C3/3/506 dev.cpu.0.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc dev.cpu.0.cx_usage_counters: 1915376424 195839141 950133329 dev.cpu.0.cx_usage: 62.56% 6.39% 31.03% last 5000us dev.cpu.0.cx_lowest: C3 dev.cpu.0.cx_supported: C1/1/1 C2/2/148 C3/3/506
and after:
dev.cpu.1.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc dev.cpu.1.cx_usage_counters: 521011 13161023 24271555 dev.cpu.1.cx_usage: 1.37% 34.67% 63.95% last 1839us dev.cpu.1.cx_lowest: C3 dev.cpu.1.cx_supported: C1/1/1 C2/2/148 C3/3/506 dev.cpu.0.cx_method: C1/mwait/hwc C2/mwait/hwc C3/mwait/hwc dev.cpu.0.cx_usage_counters: 554475 9000861 25958630 dev.cpu.0.cx_usage: 1.56% 25.34% 73.09% last 1726us dev.cpu.0.cx_lowest: C3 dev.cpu.0.cx_supported: C1/1/1 C2/2/148 C3/3/506
As you can see the time the CPU is sitting on C3 is significant greater then before these tunings.
Maybe you want to do this on your enclosure and maybe it helps reducing the power needed by your hardware too.
BTW: The performance of the firewall is not reduced by these settings.Regards,
fireodo -
@fireodo And just curious what was the power draw before you saved 2W?
And before you get all excited.. How much time did you spend doing this? Lets say 1 hour.. At that rate making just min wage, it will take you like 5 years to recover the 10/hr paying yourself ;) with the $2 a years savings.. At 12.5 cent per kwh, avg cost in the US for electric 2w savings for 24 hours works out for a year about 2 bucks.
While it is commendable.. My time is worth significantly more than 10/hr heheh
https://docs.netgate.com/pfsense/en/latest/config/advanced-misc.html#power-savings
Did you try just clicking say min in that setting?
The powerd utility monitors the system state and sets various power control options accordingly. It offers four modes (maximum, minimum, adaptive and hiadaptive) that can be individually selected while on AC power or batteries. The modes maximum, minimum, adaptive and hiadaptive may be abbreviated max, min, adp, hadp. Maximum mode chooses the highest performance values. Minimum mode selects the lowest performance values to get the most power savings. Adaptive mode attempts to strike a balance by degrading performance when the system appears idle and increasing it when the system is busy. It offers a good balance between a small performance loss for greatly increased power savings. Hiadaptive mode is alike adaptive mode, but tuned for systems where performance and interactivity are more important than power consumption. It raises frequency faster, drops slower and keeps twice lower CPU load.
-
@johnpoz said in Reducing Power consumption:
And before you get all excited..
I dont want anybody get excited - I'm only sharing my findings ...
And just curious what was the power draw before you saved 2W?
About 14W
And before you get all excited.. How much time did you spend doing this? Lets say 1 hour..
I'm on this for a few weeks ...
While it is commendable.. My time is worth significantly more than 10/hr heheh
Okay
https://docs.netgate.com/pfsense/en/latest/config/advanced-misc.html#power-savings
Did you try just clicking say min in that setting?
Yes i was doing that and I also wanted a balance between performance and powersaving. I'm using the powerd adaptive setting.
-
@fireodo said in Reducing Power consumption:
About 14W
In idle mode or under high load?I have a very similar box, with an i5-4200U. I'm running Linux on it and pfSense is virtualized besides a web server. It takes about 7W, without working load. Under load the power consumption goes up to 20W, but this is very rare.
@johnpoz said in Reducing Power consumption:
At 12.5 cent per kwh, avg cost in the US
Nice. We have to pay 23 Euro cent.
-
-
@johnpoz said in Reducing Power consumption:
@fireodo And just curious what was the power draw before you saved 2W?
And before you get all excited.. How much time did you spend doing this? Lets say 1 hour.. At that rate making just min wage, it will take you like 5 years to recover...
Meanwhile, back in the normal world, I like to keep power-usage to a minimum for the 'always-on' element of my network, both to maximise the UPS 'up' time and minimise the heat in an enclosed network cupboard. Others may rely on remote solar/battery power for their specific needs.
Clearly I am glad you have sufficient money that electrical savings are beneath you but it's not all about muscling through with your wallet.
️
-
@fireodo said in Reducing Power consumption:
I'm on this for a few weeks ...
So basically you will never recoup time
wastedspent ;)wanted a balance between performance and powersaving
So the pretty much the Adaptive or Hiadaptive mode ;)
Don't get me wrong, I am a big proponent of power savings.. But you have some system let say doing 20W.. There are way better targets for your time.. And cost saving.. Bet you switching out a 1 light bulb for a led would save you way more than the 2 bucks a year your talking..
-
@fireodo said in Reducing Power consumption:
I was interested how I can reduce the power consumption of my pfsense enclosure (its a Kettop Mi4300YL with a i5 Processor).
For me the 2 biggest power savings were disabling HT / SMT and enabling Intel Speed Shift (ie not using PowerD). Beyond that, using hardware offloads where possible, rather than running stuff through the CPU cores.
Going forward I intend to look at disabling unused interfaces. Just running interfaces at the speed required rather than letting them default to maximum makes a noticeable difference.
You may also stumble into some oddities that make a difference, even if the reason is unexplained. For example, changing net.isr.dispatch to deferred (I have a PPPoE WAN) dropped the overall power used; I have no idea why.
️
-
@johnpoz said in Reducing Power consumption:
Bet you switching out a 1 light bulb for a led would save you way more than the 2 bucks a year your talking..
To be fair, if you're chasing those savings, you've probably already done the heavy lifting of already swapping out electric heaters for LED lighting, installed solar, gone for energy efficient dishwashers, washing machines, fridges, etc. Or, saving 2W out of 14W means that when you get power cuts you've gained yourself an extra 10 or 20 minutes running off a UPS. The benefits don't have to be pure monitory.