如何实现 CPU 的特定比例(例如 80%)并对其进行平衡

发布于 2024-08-27 15:52:21 字数 221 浏览 3 评论 0原文

我想知道是否可以不以 100% 的 cpu 运行应用程序,而是以特定数量的 cpu 运行应用程序。 我看到了这个的不同用法,

  • 我们可以更好地平衡并发应用程序(我们可能希望平衡应用程序 50% 以拥有公平的应用程序/代理/...)
  • 我还想知道如果 cpu 不这样做,功耗是否会更好全速运行,但处于较低水平(比如 80%)

你有什么想法 谢谢 欢迎举例:)

I was wondering if it would be possible to run app not at 100% of the cpu but at a specific amount of the cpus.
I see different usage of this ,

  • we can better balance concurrent application ( we may want to have balance app 50% to have fair apps/agent/... )
  • i was also wondering if the power consumption would not be better if the cpus doesnt run at full throttle but at some lower level( say 80% )

What are your thoughts
Thx
examples are welcomed :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一曲琵琶半遮面シ 2024-09-03 15:52:21

如果 CPU 已经自行节流,那么如果不全速运行 CPU,功耗可能会变得更糟。现在许多CPU都支持根据负载降频,以至于如果允许它们进入睡眠状态,它们几乎不耗电。快速入睡的最佳策略是尽快完成所有必要的工作。如果您人为地节流到 80%,那么您的 CPU 唤醒时间会更长,这会消耗您以较低时钟速度运行所节省的电量。另一方面,如果您知道 CPU 无论如何都会一直忙碌,那么它永远不会进入睡眠状态。

The power consumption can be made worse by not running the CPUs at full throttle, if they otherwise already throttle themselves. Many CPUs nowadays support downclocking based on load, to the point that they use almost no power if they're allowed to sleep. The best strategy for getting to sleep quickly is to get whatever work is necessary done as quickly as possible. If you artificially throttle to 80%, then your CPU is awake longer, which will eat the power savings you get from running at a lower clock speed. On the other hand, if you know the CPU will be busy all the time no matter what, then it'll never get put to sleep anyway.

半﹌身腐败 2024-09-03 15:52:21

这项工作属于操作系统,而不是应用程序。

某些操作系统支持分段或控制组、区域或容器。无论他们如何称呼它们,它们都允许对应用程序对资源的使用进行限制。

This job belongs to the operating system, not the application.

Some operating systems support segmentation or control groups, or zones or containers. Whatever they call them, they allow placing limits on an application's use of resources.

独行侠 2024-09-03 15:52:21

您可以轻松地做到这一点。进入 BIOS 并将频率降低到所需的百分比,此时,您也许还可以降低 CPU 的 V核心 电压。
Core Parking* 似乎已经存在于 Windows 7 和 Windows Server 2008 R2 中。引用:

“核心停放是一项新功能,它根据当前电源策略及其最近的利用率动态选择一组应保持空闲且不运行任何线程的处理器。调度程序在决定使用哪个处理器时将尝试遵守此选择处理器运行线程,允许停放的核心进入深度空闲状态,在这种状态下它们消耗很少的电量。”

(如果您想要一个能够降低处理核心峰值温度的调度程序, Linux 也已经这样做了

*似乎也有一项专利:节能线程调度和处理器的动态使用

You can readily do this. Go to your BIOS and lower the frequency to the desired percent and while you are there, you may be able to lower the Vcore voltage of your CPU as well.
Core Parking* seems to be already there in Windows 7 and Windows Server 2008 R2. To quote:

"Core parking is a new feature that dynamically selects a set of processors that should stay idle and not run any threads based on the current power policy and their recent utilization. The scheduler will attempt to honor this selection when it decides on which processors to run threads, allowing the parked cores to enter deep idle states where they consume very little power."

(If, one wants a scheduler that achieves lower peak temperatures for processing cores, it has been done as well, for Linux. )

*It seems like there is a patent as well: Power-aware thread scheduling and dynamic use of processors

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文