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

标签 mesos

我正在阅读 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/

相关文章:

logging - 本地更改zookeeper C客户端的日志级别

java - 在集群上运行 Apache Spark 应用程序时是否可以缓存应用程序 jar?

docker - Apache Mesos + Docker + Karaf Cellar 集群

Mesos 1.1.0 构建错误

mesos - 在 Mesos 中杀死一个框架

docker - Mesos-Marathon docker

package - dcos 安装包到本地 Universe

mesos - 作为 Marathon 作业在 Mesos 上运行多个 Kafka 代理

docker - 使用Marathon json创建新的实现

apache-spark - 连接到 Mesos 的 Spark-shell 卡在 sched.cpp