// 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());
1条答案
按热度按时间bgtovc5b1#
正如代码注解所说,有可能比系统实际分配更多的CPU。框架接受需要适应资源约束的提议,但随后从机为执行者添加一些非零资源。所以同样的情况也会发生在mem身上。
webui显示从
master/metrics
端点和值是从执行器计算出来的,而不仅仅是任务。