gpt4 book ai didi

mesos - 如何理解 Mesos 中的 CPU 分配?

转载 作者:行者123 更新时间:2023-12-04 01:00:02 25 4
gpt4 key购买 nike

我正在阅读 Building Applications on Mesos ,并遇到以下语句:

cpus
This resource expresses how many CPU cores are available. Tasks may use fractional parts of a CPU—this is possible because Mesos slaves use CPU shares, rather than reserving specific CPUs. This means that, if you have 1.5 cpus reserved, your processes will be allowed to use a total of 1.5 seconds of CPU time each second. That could mean that, within a single executor, two processes each get 750 milliseconds of CPU time per second, or one process gets 1 second of CPU time and another gets 500 milliseconds of CPU time each in a given second. The benefit of using CPU shares is that if some task would be able to utilize more than its share, and no other task would use an otherwise idle CPU, the first task can potentially use more than its share. As a result, the cpus reserved provides a guaranteed minimum of CPU time available to the task—if additional capacity is available, it will be allowed to use more.



我无法理解“ if you have 1.5 cpus reserved, your processes will be allowed to use a total of 1.5 seconds of CPU time each second.”。怎么用 1.5CPU时间每秒?

最佳答案

通过使用多个 CPU/核心 :-)。

请注意,这些限制的实际行为/执行将高度依赖于实际使用的容器化器/隔离器。
不幸的是,我找不到任何好的/最近的文档(但我知道有人在努力改进这个 :-) ),但你可以看看这篇博文:
Blog Post about CPU resources

更新
CPU 利用率也有硬上限:请参阅
--[no]-cgroups_enable_cfs configuration parameter
或此 Jira .

关于mesos - 如何理解 Mesos 中的 CPU 分配?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34449632/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com