为什么 mesos 报告分配的 CPU 多于实际内核?

Why does mesos report more allocated CPUs than actual cores?

我正在使用一些具有 32 个内核的服务器(包括超线程)。但是,当我查看节点框架的详细信息时,我看到有几个报告分配的 CPU 超过 32 个。这是为什么?

编辑 1:

查看其中一个节点,/proc/cpuinfo 列出了正确的 CPU 数量。唯一注册到该节点的框架是 Marathon,这是我看到 CPU 过度分配的地方(通过 Mesos UI)。 Mesos 确实报告我有 32 个 CPU。

因为 code comment says 分配的 CPU 可能比系统实际分配的多。框架正在接受需要适应资源限制的提议,但随后奴隶为执行者添加了一些非零资源。 MEM 也会发生同样的情况。

// Default cpu resource given to a command executor.
constexpr double DEFAULT_EXECUTOR_CPUS = 0.1;
// Default memory resource given to a command executor.
constexpr Bytes DEFAULT_EXECUTOR_MEM = Megabytes(32);
...
// Add an allowance for the command executor. This does lead to a
// small overcommit of resources.
// TODO(vinod): If a task is using revocable resources, mark the
// corresponding executor resource (e.g., cpus) to be also
// revocable. Currently, it is OK because the containerizer is
// given task + executor resources on task launch resulting in
// the container being correctly marked as revocable.
executor.mutable_resources()->MergeFrom(
    Resources::parse(
      "cpus:" + stringify(DEFAULT_EXECUTOR_CPUS) + ";" +
      "mem:" + stringify(DEFAULT_EXECUTOR_MEM.megabytes())).get());

WebUI 显示取自 master/metrics 端点的值和从执行器计算的值,而不仅仅是任务。