Live data from Hacker News

Show HN: Terminal dashboard that throttles my PC during peak electricity rates

naveen.ing

21–30 of 61 posts

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#21

It's usually more energy-efficient to finish a task quickly with a higher power draw, also known as race-to-idle.

Good point. I'm often running multiple parallel jobs with varying priorities where uniform throttling actually makes sense. Many LLM inference tasks are long-running but not fully utilizing hardware (often waiting on I/O or running at partial capacity)

The dual Epyc CPUs (128 cores) in my setup have a relatively high idle power draw compared to consumer chips. Even when "idle" they're consuming significant power maintaining all those cores and I/O capabilities. By implementing uniform throttling when utilization is low, the automation actually reduces the baseline power consumption by a decent amount without much performance hit.

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#22

Nice project, but would it not be more rational to have your system running underclocked/undervolted at the optimal perf/watt at all times, with an optional boost to max performance for a time critical task? Running it away from the optimum might save on instant consumption but increase your aggregate consumption.

Thanks! That's an excellent point. You're right that there's likely a sweet spot that would be more efficient overall than aggressive throttling.

The current implementation uniformly sets max frequency for all 128 cores, but I'm working on per-core frequency control that would allow much more granular optimization. I'll definitely measure aggregate consumption with your suggestion versus my current implementation to see the difference.

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#23

If your computer is still doing bursty jobs during that period, it will use less power but still as much energy. Sure, you can reduce the power but if you aren't also reducing what you ask it to do, it'll just use that max amount of allowed power for a longer period of time.

Technology Connections just did a timely video on the very topic of power vs energy.

https://youtu.be/OOK5xkFijPc?si=Uya3fI5oy_JFfSqI

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#24

Had a quick look through the code but I can't find where he actually throttles the PC. Anyone can point me to it? https://github.com/naveenkul/WattWise

Sorry, I only open sourced the dashboard part as mentioned in the bottom of the blogpost. Still working on improving the 'Power optimizer' service so will open source that soon as well.

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#25

If your computer is still doing bursty jobs during that period, it will use less power but still as much energy. Sure, you can reduce the power but if you aren't also reducing what you ask it to do, it'll just use that max amount of allowed power for a longer period of time.

It is well known in the PC hardware enthusiast community that the last few digits of percent of performance come at enormous increases in power consumption as voltages are raised to prevent errors as clock speeds go up.

Manufacturers chase benchmark results by youtubers and magazines. Even a few percent difference in framerate means the difference between everyone telling each other to buy a particular motherboard, processor, or graphics card over another.

Amusingly, you often get better performance by undervolting and lowering the processor's power limits. This keeps temperatures low and thus you don't end up with the PC equivalent of the "toyota supra horsepower chart" meme.

1400W for a desktop PC is...crazy. That's a threadripper processor plus a bleeding edge top of the line GPU, assuming that's not just them reading off the max power draw on the nameplate of the PSU.

If their PC is actually using that much power, they could save far more money, CO2, etc by undervolting both the CPU and GPU.

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#26

Nice project, but would it not be more rational to have your system running underclocked/undervolted at the optimal perf/watt at all times, with an optional boost to max performance for a time critical task? Running it away from the optimum might save on instant consumption but increase your aggregate consumption.

Thanks! That's an excellent point. You're right that there's likely a sweet spot that would be more efficient overall than aggressive throttling. The current implementation uniformly sets max frequency for all 128 cores, but I'm working on per-core frequency control that would allow much more granular optimization. I'll definitely measure aggregate consumption with your suggestion versus my current implementation to…

Another suggestion: when you want to save power, use irq affinity with /proc/irq/$irq/smp_affinity_list to put them all on one core.

This core will get to sleep less than the others.

You can also use the CPU "geometry" (which cores share cache) to set max frequency on its neighboring cores first, before recruiting the other cores

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#27
post #20

Had a quick look through the code but I can't find where he actually throttles the PC. Anyone can point me to it? https://github.com/naveenkul/WattWise

Yeah I don’t see anything that even suggests it throttles the PC. Looks like it’s just a display.

You mean like the title of the submission suggestion of it throttling?

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#28

Earlier quoted context omitted.

All the modern CPUs will boost into high clockspeeds and voltage to get work done quicker but at considerably higher power draws per operation. On that side of the equation its clear that it uses more energy. The problem is the entire CPU package is on longer if you don't do that and this costs power too and so its a trade off between the two. Generally we consider there isn't much difference between them but I don't…

This is some pretty old analysis, but I remember when smartphones came out and people were thinking about throttling their applications to lower power consumption the general advice was to just "race to idle". The consensus thus was that spending more time in lower power states (where you use ~0W) was much more efficient than spending a longer amount of time in the CPU sweetspot, but with all sort of peripherals onli…

However there are two factors that might make "race to idle" more valid on phones than on most other platforms:

Smartphone chips are designed to much stricter thermal and power limits. There is only so much power you can get out of the tiny battery, and only so much heat you can get rid of without making the phone uncomfortably hot. Even in a burst that puts a limit on the wastefulness. Desktop CPUs are very different: If you can get 10% more performance while doubling power draw, people will just buy bigger coolers and bigger power supplies to go along with the CPU. Notebook CPUs are somewhere in the middle: limited, but with much better cooling and much more powerful batteries than phones.

The other thing is the operating system: "race to idle" makes sense in phones because the OS will actually put the CPU into sleep states if there's nothing to do, and puts active effort into not waking the CPU up unnecessarily and cramming work into the time slots when the CPU is active anyways. Desktop operating systems just don't do that to the same degree. You might race to idle, but the rest of the system will then just waste power with background work once it's idle.

Re: Show HN: Terminal dashboard that throttles my PC during peak electricity rates

#30
post #5

Earlier quoted context omitted.

I'm on a time of use rate plan, most expensive from 11am-7pm. However they also have "Critical Peak Events" which increase the rate about 10x to over a $1/kwh that last up to 4 hours. Just saying it would be a bit more complex then just checking the time.

So how do you get that data (status) now (if(is-critical-peak-event){})? Do the smartplugs gather some smartgrid-style data?

I do believe I've seen some plugs that do connect to some data source to do it automatically, but I'd rather not give plugs access to the internet haha. Our provider also gives advanced notice via text or email so its totally possible to connect it up yourself.
Post reply on HN