如何实现 CPU 的特定比例(例如 80%)并对其进行平衡
我想知道是否可以不以 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果 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.
这项工作属于操作系统,而不是应用程序。
某些操作系统支持分段或控制组、区域或容器。无论他们如何称呼它们,它们都允许对应用程序对资源的使用进行限制。
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.
您可以轻松地做到这一点。进入 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:
(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