question about powerd

Status
Not open for further replies.

digrouz

Dabbler
Joined
Aug 24, 2013
Messages
11
Hello,

I would like to have some advices about powerd daemon. Do you think it affects performances if enabled? How can I check the current cpu clock?


My Server is a HP microserver Gen8 with Intel(R) Pentium(R) CPU G2020T and 16G of RAM.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
I would like to have some advices about powerd daemon. Do you think it affects performances if enabled? How can I check the current cpu clock?
Run "sysctl dev.cpu.0.freq" and you will see it change when powerd is enabled. And yes, there can be a slight performance impact, however with current CPUs the power savings are minimal or even nonexistent.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
First of all, I agree with Dusan. Nonetheless:

I use it on my freeNAS. My FreeNAS is in very light service (i.e., only service movies here and there in the house under most conditions). Here is what I've noticed:

* My power consumption at idle goes from about 35.5 to about 32W. (So I save like, $2.10 per year, according to my current electrical rates, LOL!)
* My power consumption at load is unaffected (obviously---powerd shouldn't try to save power under a demand-load condition)
* My CPU temperature is maybe 1C less on average.
* I have noted not a single performance impact of any kind (but that's because I have a NAS under light service load).

So, it's doing hardly anything, but as I personally have noted no performance impact, I leave it enabled.

There is a post somewhere in forum by cyberjock where he goes into CONSIDERABLE detail, and shows other, *MUCH MORE EFFECTIVE* places where (for example a BIOS setting) you can save a hell of a lot more power than powerd will save.
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Doesn't CPU adjust even with powerd disabled? I just disabled it and appears to remain at proper clock speeds..
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Doesn't CPU adjust even with powerd disabled? I just disabled it and appears to remain at proper clock speeds..
On Cyberjock's and my system, if you disable powerd, then the CPU runs at full voltage, and full frequency, 24/7, regardless of load.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
On Cyberjock's and my system, if you disable powerd, then the CPU runs at full voltage, and full frequency, 24/7, regardless of load.

That is true for my setup, but these newer CPUs will clock down and shut off whole cores if the system is idle. powerd often yields little to no benefit. The performance impact can range from unnoticable on a system for home use to significant in a high-demand business application. Hint: I don't have powerd enabled on my system because it just doesn't matter that much and I'm all about simplicity.
 

cchayre

Dabbler
Joined
Jul 11, 2012
Messages
15
That is true for my setup, but these newer CPUs will clock down and shut off whole cores if the system is idle. powerd often yields little to no benefit. The performance impact can range from unnoticable on a system for home use to significant in a high-demand business application. Hint: I don't have powerd enabled on my system because it just doesn't matter that much and I'm all about simplicity.

Just to make sure I'm reading and interpreting this correct---a sysctl dev.cpu.0.freq will display full frequency, but the CPU will in actuality scale down in low-use/idle situations? Any way to verify this? Just looking to understand a bit more. I'd like to be somewhat power conscious, but am also planning to go always-on (incl HDD) after reading through the nuances in a number of the posts here (including many of yours).
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Well, there are several power issues.

You probably have a hw.acpi.cpu.cx_lowest sysctl, which is another thing (C-states, look it up if you like). This (if properly set) can do what cyberjock is saying---outright turning off of cores at idle cycles, etc. (It shaved 2-3 more watts off of my system to set this sysctl to C2, and I have no noticeable performance impact, so it's a no-brainer).

This is independent (to my knowledge) of powerd (which I also run), which more or less handles how ACTIVE cores are clocked.
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Yeah, you can see if you have this available by looking at the "supported" c-states (line 32 and 35 below, which shows the state, the setting number, and the time to restore to C1 in micro? seconds):
Code:
[root@freenas] /mnt/drkk/UnbackedupStorage/ISOs# sysctl -a | grep cx
device  cxgb
hw.cxgb.nfilters: -1
hw.cxgb.use_16k_clusters: -1
hw.cxgb.force_fw_update: 0
hw.cxgb.multiq: 1
hw.cxgb.msi_allowed: 2
hw.cxgb.tx_reclaim_threshold: 32
hw.cxgb.tx_coalesce_enable_stop: 256
hw.cxgb.tx_coalesce_enable_start: 512
hw.cxgb.tx_coalesce_force: 0
hw.cxgb.txq_mr_size: 1024
hw.acpi.cpu.cx_lowest: C2
dev.cpu.0.cx_supported: C1/1/1 C2/2/108
dev.cpu.0.cx_lowest: C2
dev.cpu.0.cx_usage: 23.66% 76.33% last 1us
dev.cpu.1.cx_supported: C1/1/1 C2/2/108
dev.cpu.1.cx_lowest: C2
dev.cpu.1.cx_usage: 8.69% 91.30% last 4419us[root@freenas] /mnt/drkk/UnbackedupStorage/ISOs# sysctl -a | grep cx
device  cxgb
hw.cxgb.nfilters: -1
hw.cxgb.use_16k_clusters: -1
hw.cxgb.force_fw_update: 0
hw.cxgb.multiq: 1
hw.cxgb.msi_allowed: 2
hw.cxgb.tx_reclaim_threshold: 32
hw.cxgb.tx_coalesce_enable_stop: 256
hw.cxgb.tx_coalesce_enable_start: 512
hw.cxgb.tx_coalesce_force: 0
hw.cxgb.txq_mr_size: 1024
hw.acpi.cpu.cx_lowest: C2
dev.cpu.0.cx_supported: C1/1/1 C2/2/108
dev.cpu.0.cx_lowest: C2
dev.cpu.0.cx_usage: 23.66% 76.33% last 1us
dev.cpu.1.cx_supported: C1/1/1 C2/2/108
dev.cpu.1.cx_lowest: C2
dev.cpu.1.cx_usage: 8.69% 91.30% last 4419us
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
You can see on mine (lines 34, 37), I have 2 cores (Intel G3220), and my first core is active C-state about 24% of the time, and my second core only about 9% of the time. This behavior saved a few watts for me.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Just to make sure I'm reading and interpreting this correct---a sysctl dev.cpu.0.freq will display full frequency, but the CPU will in actuality scale down in low-use/idle situations? Any way to verify this? Just looking to understand a bit more. I'd like to be somewhat power conscious, but am also planning to go always-on (incl HDD) after reading through the nuances in a number of the posts here (including many of yours).

There's 5 things that affect CPU frequency/efficiency/power usage.
1. CPU design. If you are using an AMD, you are totally on your own with everything. I know AMD and Intel do things differently, and going AMD means you probably were cutting corners with cost, which also means you probably cut CPU efficiency features you didn't know you were cutting. If you aren't happy, buy our recommended hardware next time. If you are Intel, your CPU architecture will determine how CPU power usage changes over time.
2. Your BIOS settings. This is important to get right, and for your motherboard to support the features. If they don't support those feature, well, you are already in a bad way with getting efficiency and power usage to acceptable levels. If you bought a quality server board, you can assume this is likely correct. If you aren't choosing stuff like Supermicro quality components, well, you are on your own. And you have my sympathy because you are about to see how you saved a dollar on hardware so you could spend $10 on electricity. Good trade I'd say, eh?
3. Your system settings in FreeNAS. There's tunables and sysctls that can have a drastic impact on CPU loading and what the CPU does when its idle. You have limited control of this via tunables and sysctls. Mostly you just set the settings and the hardware will behave as you have set it. If you don't know what you are doing, your performance and reliability may suffer.
4. PowerD(yep.. here it is). Powerd used to be very important years ago when power savings were mostly in software. But now, with today's technology CPUs are clocking themselves down, shutting off cores, etc. and they are doing it often behind the back of your OS. All the time, the CPU is lying to your OS about what is actually running and what its speed and voltage is. You're pretty much on your own to figure out that some parameters will be true and correct and others are lies.
5. Your actual CPU utilization will affect how far your CPU goes to sleep. If your CPU is being pinged every second or two with load don't expect it to go idle. That's how it is. And it doesn't take more than a fraction of a core to wake it up.

These 5 characteristics, if you stop and think about them, are all related to each other in various ways. Either you accept these relationships for what they are, or you dismiss them. They will behave a certain way based on those relationships, and you are mostly on your own if you didn't go with true quality hardware.

Sorry, but that's about all I can tell you because each system will behave in a unique way based on its circumstances.

Good luck!
 

cchayre

Dabbler
Joined
Jul 11, 2012
Messages
15
Thanks for the feedback. I think I'm in good shape, but will definitely be interested to baseline it sometime with a power-meter or another UPS w/built-in power-meter. My CPU is an i3 4330 and my motherboard is configured to handle C states accordingly. I haven't yet dug into the tunables or sysctls, but will heed your advice if/when i do. System load is next-to-nothing at this point---a whole lot of idling as it serves as a home NAS.

Much appreciated!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
FreeNAS by default does not go below the C1 state.. so I can pretty much guarantee you that your system isn't handling C states as well as you might like. ;)
 

cchayre

Dabbler
Joined
Jul 11, 2012
Messages
15
FreeNAS by default does not go below the C1 state.. so I can pretty much guarantee you that your system isn't handling C states as well as you might like. ;)

I have a feeling I'm going to start chasing down a rabbit hole on this one. Ex. Trying to baseline what my current draw is and see where I should make some tweaks, if any, to "enhance." I already made the mistake of looking into FreeBSD C state tuning. :)

https://wiki.freebsd.org/TuningPowerConsumption
 

Yatti420

Wizard
Joined
Aug 12, 2012
Messages
1,437
Is it really worth the time.. NAS builds have such little draw.. Any GPU connected to a desktop will crush a NAS build..
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I'll tell you that when I went all-in for power savings(minus putting disks to sleep) I saved a whopping.......wait for it....... 10watts over the default settings. This is why I just shake my head when I see these threads. You'll spend hours and hours and the gains are just not really there. You want to save some watts, go replace an incandescent with a fluorescent.
 

Dennis K.

Explorer
Joined
Feb 17, 2014
Messages
70
I invested a few hours into this topic and went from ~33W down to ~25W while idling (with spinning disks). Enabling powerd without any other tweaks saved only about 1.8W. After applying a couple of additional tweaks the portion of powerd was only about 0.4W. Unfortunately I was only able to go to the C2-state. Higher C-States doesn't seem to be supported with my CPU under FreeBSD. I even bootet FreeBSD 10 to test this further. Linux does support all C-states.

My configuration:
  • Supermicro X10SLL-F
  • Intel Core i3-4130
  • 1x Kingston ValueRAM DIMM 8GB, DDR3L-1600, CL11, ECC
  • 3x Western Digital WD Red 4TB, 3.5"
  • Kingston DataTraveler Micro 8GB
  • FSP 250W power supply
By the way, letting the disks go to sleep saved only about 6W for me - not worth the extra strain.
 

scurrier

Patron
Joined
Jan 2, 2014
Messages
297
I don't think anyone ever answered the question outright: Should sysctl dev.cpu.0.freq still show full frequency with powerd OFF even though power is still being saved by the hardware?
 
Status
Not open for further replies.
Top