Live data from Hacker News

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

naveen.ing

31–40 of 61 posts

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

#31

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…

Race to idle probably makes more sense in the context of smartphones where there’s at least some chance that “idle” means the screen might be turned off.

For a desktop, the usage… I mean, it is sort of different really. If I’m writing a Tex file for example, slower compiles mean I’ll get… fewer previews. The screen is still on. More previews is vaguely useful, but probably doesn’t substantially speed up the rate at which I write—the main bottleneck is somewhere between my hat and my hands, I think.

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

#32
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?

It depends on your supplier, because they set the pricing and that information gets displayed on your meter. Octopus (UK) has a dynamically-priced service called Agile where you can query the API as a user; in some cases the API doesn't even need a login for regional pricing. You would have to build some logic on top for most smartplugs through something like HomeAssistant. There are storage batteries which can react to pricing, and some which will also work in concert with current solar power or other renewables.

https://octopus.energy/blog/agile-smart-home-diy/

https://www.zerofy.net/2024/03/26/meter-data.html for some more European info on meters, though mostly focused on accessing your own usage data.

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

#33

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…

Please go learn about modern Ryzen power and performance management, namely Precision Boost Overdrive and Curve Optimizer - and how to undervolt an AM4/AM5 processor.

The stuff the chip and motherboard do, completely built-in, is light-years ahead of what you're doing. Your power-saving techniques (capping max frequency) are more than a decade out of date.

You'll get better performance and power savings to boot.

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

#34
post #26

Earlier quoted context omitted.

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

Thanks for the suggestion. Will check it out.

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

#35

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.

[deleted]

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

#36

Earlier quoted context omitted.

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…

Please go learn about modern Ryzen power and performance management, namely Precision Boost Overdrive and Curve Optimizer - and how to undervolt an AM4/AM5 processor. The stuff the chip and motherboard do, completely built-in, is light-years ahead of what you're doing. Your power-saving techniques (capping max frequency) are more than a decade out of date. You'll get better performance and power savings to boot.

Thanks for the suggestion! I'm actually using dual EPYC server processors in this workstation, not Ryzen. I'm not sure EPYC supports PBO/Curve Optimizer functionality that's available in AM4/AM5 platforms.

That said, I'm definitely interested in learning more about processor-specific optimizations for EPYC. If there are server-focused equivalents to what you've mentioned that would work better than frequency capping, I'd love to explore them!

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

#37

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.

If it were up to me I would go for switching complete performance profiles through something like tuned-adm rather than trying to change just cpu frequencies. There's too many interlinked things that can have an effect on throughput efficiency.

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

#38

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, p…

1400 is definitely the sticker on the side of the PSU. There is some theory behind keeping your PSU at 30-50% for optimal efficiency, but considering the cost of these 1k+ W units You're probably better off right-sizing it.

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

#39
Quick update: Definitely wasn't expecting this to end up on the front page. I was more focused on publishing the dashboard than the power optimizer service I'm running. I'll take all the feedback into account and will open source an improved version of it soon. Appreciate all the comments!

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

#40

Earlier quoted context omitted.

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.

If it were up to me I would go for switching complete performance profiles through something like tuned-adm rather than trying to change just cpu frequencies. There's too many interlinked things that can have an effect on throughput efficiency.

Thanks, I'll check it out.
Post reply on HN