ivanjobs.github.io - mesos agent /monitor/statistics返回数据业务意义









Search Preview

mesos agent /monitor/statistics返回数据业务意义 | Ivan的博客

ivanjobs.github.io
背景 GET /monitor/statistics 可以返回agent的监控数据,如下:
.io > ivanjobs.github.io

SEO audit: Content analysis

Language Error! No language localisation is found.
Title mesos agent /monitor/statistics返回数据业务意义 | Ivan的博客
Text / HTML ratio 38 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud = Ceph executor const resources Mesos Python mesos resource task Result OpenStack return launch command result revocable memory 笔记 题解
Keywords consistency
Keyword Content Title Description Headings
= 19
Ceph 14
executor 13
const 11
resources 9
Mesos 7
Headings
H1 H2 H3 H4 H5 H6
1 0 4 0 0 0
Images We found 1 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
= 19 0.95 %
Ceph 14 0.70 %
executor 13 0.65 %
const 11 0.55 %
resources 9 0.45 %
Mesos 7 0.35 %
Python 7 0.35 %
mesos 6 0.30 %
resource 5 0.25 %
task 5 0.25 %
Result 4 0.20 %
OpenStack 4 0.20 %
return 4 0.20 %
launch 4 0.20 %
command 4 0.20 %
result 4 0.20 %
revocable 3 0.15 %
memory 3 0.15 %
笔记 3 0.15 %
题解 3 0.15 %

SEO Keywords (Two Word)

Keyword Occurrence Density
the executor 6 0.30 %
command executor 4 0.20 %
const Result 4 0.20 %
to a 3 0.15 %
include the 3 0.15 %
a command 3 0.15 %
the containerizer 3 0.15 %
given to 2 0.10 %
the task's 2 0.10 %
to include 2 0.10 %
return result 2 0.10 %
resources = 2 0.10 %
executor constexpr 2 0.10 %
pid_t pid 2 0.10 %
the container 2 0.10 %
Ceph v1023 2 0.10 %
that the 2 0.10 %
Ceph RGW 2 0.10 %
mesos agent 2 0.10 %
agent monitorstatistics返回数据业务意义 2 0.10 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
a command executor 3 0.15 % No
mesos agent monitorstatistics返回数据业务意义 2 0.10 % No
the task's resources 2 0.10 % No
include the task's 2 0.10 % No
command executor constexpr 2 0.10 % No
to a command 2 0.10 % No
given to a 2 0.10 % No
resource given to 2 0.10 % No
to include the 2 0.10 % No
has nonzero resources 1 0.05 % No
that the containerizer 1 0.05 % No
the containerizer has 1 0.05 % No
containerizer has nonzero 1 0.05 % No
to work with 1 0.05 % No
nonzero resources to 1 0.05 % No
resources to work 1 0.05 % No
executor so that 1 0.05 % No
work with when 1 0.05 % No
with when the 1 0.05 % No
when the executor 1 0.05 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
given to a command 2 0.10 % No
resource given to a 2 0.10 % No
include the task's resources 2 0.10 % No
a command executor constexpr 2 0.10 % No
to a command executor 2 0.10 % No
to include the task's 2 0.10 % No
the containerizer has nonzero 1 0.05 % No
containerizer has nonzero resources 1 0.05 % No
has nonzero resources to 1 0.05 % No
nonzero resources to work 1 0.05 % No
resources to work with 1 0.05 % No
最新文章 dev ops math 1 0.05 % No
to work with when 1 0.05 % No
so that the containerizer 1 0.05 % No
work with when the 1 0.05 % No
with when the executor 1 0.05 % No
when the executor has 1 0.05 % No
the executor has no 1 0.05 % No
executor has no resources 1 0.05 % No
has no resources This 1 0.05 % No

Internal links in - ivanjobs.github.io

开始使用gtest
开始使用gtest | Ivan的博客
寻找正确的语义[比赛总结]
寻找正确的语义[比赛总结] | Ivan的博客
score_thresholder服务开发总结
score_thresholder服务开发总结 | Ivan的博客
Debug CPP Program On Ubuntu
Debug CPP Program On Ubuntu | Ivan的博客
Modern CPP Developer Need To Know
Modern CPP Developer Need To Know | Ivan的博客
汇编语言学习笔记
汇编语言学习笔记 | Ivan的博客
Mesos Quota 和 Reservation
Mesos Quota 和 Reservation | Ivan的博客
libprocess学习笔记
libprocess学习笔记 | Ivan的博客
Consul使用笔记
Consul使用笔记 | Ivan的博客
SSH重新学习
SSH重新学习 | Ivan的博客
Protocol buffers 代码入门
Protocol buffers 代码入门 | Ivan的博客
Mesos Slave 如何上报资源?
Mesos Slave 如何上报资源? | Ivan的博客
Object Locator (Ceph) 探究笔记
Object Locator (Ceph) 探究笔记 | Ivan的博客
librados接口使用
librados接口使用 | Ivan的博客
Ceph RGW Pools 浅析
Ceph RGW Pools 浅析 | Ivan的博客
在单机上搭建多Ceph集群
在单机上搭建多Ceph集群 | Ivan的博客
Dockerfile中RUN/CMD/ENTRYPOINT的区分
Dockerfile中RUN/CMD/ENTRYPOINT的区分 | Ivan的博客
strace使用入门
strace使用入门 | Ivan的博客
Haystack论文学习笔记
Haystack论文学习笔记 | Ivan的博客
Mesos关联配置
Mesos关联配置 | Ivan的博客
ZooKeeper概览
ZooKeeper概览 | Ivan的博客
Ceph故障解析-filestore_merge_threshold
Ceph故障解析-filestore_merge_threshold | Ivan的博客
基于laravel+mysql的容器化DAL方案
基于laravel+mysql的容器化DAL方案 | Ivan的博客
vuejs使用小结1
vuejs使用小结1 | Ivan的博客
Ceph新技能Get
Ceph新技能Get | Ivan的博客
Ceph v10.2.3 RGW源码解析2
Ceph v10.2.3 RGW源码解析2 | Ivan的博客
Ceph v10.2.3 RGW源码解析1
Ceph v10.2.3 RGW源码解析1 | Ivan的博客
s3cmd使用说明
s3cmd使用说明 | Ivan的博客
vuejs工具链简介
vuejs工具链简介 | Ivan的博客
requirejs简介
requirejs简介 | Ivan的博客
可编程自动化输入方案(Mac下)
可编程自动化输入方案(Mac下) | Ivan的博客
Mesos Supress/Revive Offers测试
Mesos Supress/Revive Offers测试 | Ivan的博客
Mesos Offer生命周期杂记
Mesos Offer生命周期杂记 | Ivan的博客
Mesos Agent Containerizer分析
Mesos Agent Containerizer分析 | Ivan的博客
get started with createjs chapter 1 notes
get started with createjs chapter 1 notes | Ivan的博客
mesos agent /monitor/statistics返回数据业务意义
mesos agent /monitor/statistics返回数据业务意义 | Ivan的博客
mesos master/messages_deactivate_frameworks 不生效?
mesos master/messages_deactivate_frameworks 不生效? | Ivan的博客
KMP算法杂谈
KMP算法杂谈 | Ivan的博客
Mesos配置项深入分析
Mesos配置项深入分析 | Ivan的博客
mesos-master replicated_log存的是什么?
mesos-master replicated_log存的是什么? | Ivan的博客
mesos disk usage vs df 结果不一致问题
mesos disk usage vs df 结果不一致问题 | Ivan的博客
Mesos GC原理解析
Mesos GC原理解析 | Ivan的博客
准备mesos单机版开发测试环境
准备mesos单机版开发测试环境 | Ivan的博客
Mesos 1.0.0 源码解析杂记
Mesos 1.0.0 源码解析杂记 | Ivan的博客
stout学习笔记
stout学习笔记 | Ivan的博客
gflags学习笔记
gflags学习笔记 | Ivan的博客
ceph fuse挂载cephfs, ls不出文件列表问题,调试记录
ceph fuse挂载cephfs, ls不出文件列表问题,调试记录 | Ivan的博客
Ceph源码解析(3)-rados put过程探究
Ceph源码解析(3)-rados put过程探究 | Ivan的博客
Hub,Bridge,Switch和Gateway是什么?
Hub,Bridge,Switch和Gateway是什么? | Ivan的博客
数论学习笔记
数论学习笔记 | Ivan的博客
二分图专题解析
二分图专题解析 | Ivan的博客
Ceph Cluster调优日志
Ceph Cluster调优日志 | Ivan的博客
boost库的智能指针
boost库的智能指针 | Ivan的博客
Linux命令使用记录
Linux命令使用记录 | Ivan的博客
Vim Cheat Sheet
Vim Cheat Sheet | Ivan的博客
原码、反码、补码笔记
原码、反码、补码笔记 | Ivan的博客
ceph-deploy 配置文件比较 BUG
ceph-deploy 配置文件比较 BUG | Ivan的博客
Ceph源码解析(2)-rados put过程探究
Ceph源码解析(2)-rados put过程探究 | Ivan的博客
Ceph Release 概述
Ceph Release 概述 | Ivan的博客
Ceph CRUSH Map 维护详解
Ceph CRUSH Map 维护详解 | Ivan的博客
题解[第二周]
题解[第二周] | Ivan的博客
MathQuill Math Equation Cheatsheet
MathQuill Math Equation Cheatsheet | Ivan的博客
题解[第一周]
题解[第一周] | Ivan的博客
Ceph集群运维问题记录
Ceph集群运维问题记录 | Ivan的博客
linux man高级技巧
linux man高级技巧 | Ivan的博客
Git 我错了!
Git 我错了! | Ivan的博客
Ceph源码解析(1)-Create Pool过程探究
Ceph源码解析(1)-Create Pool过程探究 | Ivan的博客
准备Ceph开发环境
准备Ceph开发环境 | Ivan的博客
Ceph:Too Many PGs Per OSD
Ceph:Too Many PGs Per OSD | Ivan的博客
UVA 11292 题解
UVA 11292 题解 | Ivan的博客
Ceph RBD 文件映射实验笔记
Ceph RBD 文件映射实验笔记 | Ivan的博客
硬盘分区
硬盘分区 | Ivan的博客
硬盘模型
硬盘模型 | Ivan的博客
Ceph配置项
Ceph配置项 | Ivan的博客
OSTEP 文件系统实现
OSTEP 文件系统实现 | Ivan的博客
在Ceph底层xfs上找到你上传的文件
在Ceph底层xfs上找到你上传的文件 | Ivan的博客
使用s3cmd操作ceph rgw
使用s3cmd操作ceph rgw | Ivan的博客
Ceph核心概念备忘录
Ceph核心概念备忘录 | Ivan的博客
COSBench使用笔记
COSBench使用笔记 | Ivan的博客
使用saltstack部署运维ceph集群笔记
使用saltstack部署运维ceph集群笔记 | Ivan的博客
如何使用salt states?
如何使用salt states? | Ivan的博客
ceph-deploy命令详解
ceph-deploy命令详解 | Ivan的博客
dd笔记
dd笔记 | Ivan的博客
DTrace是什么?
DTrace是什么? | Ivan的博客
Ceph Cache Tier笔记
Ceph Cache Tier笔记 | Ivan的博客
Linux下理解filesystem/device/mount等概念
Linux下理解filesystem/device/mount等概念 | Ivan的博客
Base64编码详解与应用
Base64编码详解与应用 | Ivan的博客
URLEncoder学习笔记
URLEncoder学习笔记 | Ivan的博客
Ceph论文阅读笔记
Ceph论文阅读笔记 | Ivan的博客
使用Python inotify监控文件变化
使用Python inotify监控文件变化 | Ivan的博客
Git命令Snippets
Git命令Snippets | Ivan的博客

Ivanjobs.github.io Spined HTML


mesos wage-earner /monitor/statistics返回数据业务意义 | Ivan的博客 最新文章 dev ops math algorithm personal 开始使用gtest 2018书单课单 2017年总结/2018年展望 寻找正确的语义[比赛总结] score_thresholder服务开发总结 Debug CPP Program On Ubuntu Modern CPP Developer Need To Know 汇编语言学习笔记 Mesos Quota 和 Reservation libprocess学习笔记 Consul使用笔记 SSH重新学习 Protocol buffers 代码入门 Mesos Slave 如何上报资源? Object Locator (Ceph) 探究笔记 librados接口使用 Ceph RGW Pools 浅析 在单机上搭建多Ceph集群 2016年总结/2017年展望 Dockerfile中RUN/CMD/ENTRYPOINT的区分 strace使用入门 Haystack论文学习笔记 Mesos关联配置 ZooKeeper概览 Ceph故障解析-filestore_merge_threshold 基于laravel+mysql的容器化DAL方案 vuejs使用小结1 Ceph新技能Get Ceph v10.2.3 RGW源码解析2 Ceph v10.2.3 RGW源码解析1 s3cmd使用说明 vuejs工具链简介 requirejs简介 mesos maintenance深度解析 可编程自动化输入方案(Mac下) Mesos Supress/Revive Offers测试 Mesos Offer生命周期杂记 MesosWage-earnerContainerizer分析 get started with createjs installment 1 notes mesos wage-earner /monitor/statistics返回数据业务意义 mesos master/messages_deactivate_frameworks 不生效? mesos /flags 403 forbidden? KMP算法杂谈 Mesos配置项深入分析 mesos-master replicated_log存的是什么? mesos disk usage vs df 结果不一致问题 Mesos GC原理解析 准备mesos单机版开发测试环境 Mesos 1.0.0 源码解析杂记 stout学习笔记 gflags学习笔记 ceph fuse挂载cephfs, ls不出文件列表问题,调试记录 Ceph源码解析(3)-rados put过程探究 Hub,Bridge,Switch和Gateway是什么? 数论学习笔记 二分图专题解析 Ceph Cluster调优日志 boost库的智能指针 Linux命令使用记录 Vim Cheat Sheet 原码、反码、补码笔记 ceph-deploy 配置文件比较 BUG Ceph源码解析(2)-rados put过程探究 Ceph Release 概述 Ceph CRUSH Map 维护详解 题解[第二周] MathQuill Math Equation Cheatsheet 题解[第一周] Ceph集群运维问题记录 linux man高级技巧 Git 我错了! Ceph源码解析(1)-Create Pool过程探究 准备Ceph开发环境 Ceph:Too Many PGs Per OSD UVA 11292 题解 Docker Private Registry(Ceph Swift) 搭建笔记 Ceph RBD 文件映射实验笔记 硬盘分区 硬盘模型 Ceph配置项 OSTEP 文件系统实现 在Ceph底层xfs上找到你上传的文件 使用s3cmd操作ceph rgw Ceph核心概念备忘录 COSBench使用笔记 GCJ2015 Qualification Round-B题解 使用saltstack部署运维ceph集群笔记 如何使用salt states? ceph-deploy命令详解 dd笔记 DTrace是什么? Ceph Cache Tier笔记 Linux下理解filesystem/device/mount等概念 Base64编码详解与应用 URLEncoder学习笔记 Ceph论文阅读笔记 使用Python inotify监控文件变化 Git命令Snippets 使用Nginx做LB MathQuill学习笔记 Docker化Laravel开发环境 Ceph Pool PG配置说明 Ceph 笔记 Ceph源码分析 Latex数学符号 为Ceph OSS服务搭建LB Ceph RGW S3接口测试:诡异的403 AccessDenied问题 访问Ceph RGW失败 403 Forbidden问题 解决历程 Ceph RADOS论文研读笔记 Ceph源码分析:从一个REST请求,到OSD存储。 各种开源代码协议简述 OpenStack Projects简述 OpenStack Ceilometer 笔记 RabbitMQ 和 oslo.messaging Ceph Rest API 身份验证方式(S3) tcpdump笔记 Ceph集群部署笔记 Python PEP8规范笔记 Python Decorator(装饰器)模式 笔记 libvirt笔记 OpenStack oslo 概览 OpenStack KeyStone API http://localhost:5000/ 源码追踪 Python pdb笔记 zero length variety in a struct Jenkins' Hash Functions NTP部署笔记 Linux iptables笔记 Python Paste笔记 Python PasteDeploy笔记 Python eventlet笔记 使用curl测试RESTful接口 ubuntu14.04下安装devstack devstack 安装指南【最简单】 Docker操作记录 git merge 详解 Python 包管理详解 阿里云服务器设置swapfile的方法 shell脚本编写向导 搭建Laravel全栈开发环境 2016 September 14 mesos wage-earner /monitor/statistics返回数据业务意义 背景 GET /monitor/statistics 可以返回agent的监控数据,如下: [ { "executor_id": "default", "executor_name": "Test Executor (Python)", "framework_id": "44d226db-8585-4aca-867d-467473a260e6-0001", "source": "python_test", "statistics": { "cpus_limit": 1, "cpus_system_time_secs": 0.3, "cpus_user_time_secs": 1.56, "mem_limit_bytes": 134217728, "mem_rss_bytes": 140701696, "timestamp": 1473749799.35054 } } ] 其中statistics节点数据,需要进一步确认其业务意义。 核心代码跟踪 wheels collectUsage = [this, containerId]( pid_t pid) -> Future<ResourceStatistics> { ... const Try<ResourceStatistics> cgroupStats = cgroupsStatistics(pid); if (cgroupStats.isError()) { return Failure("Failed to collect cgroup stats: " + cgroupStats.error()); } ResourceStatistics result = cgroupStats.get(); // Set the resource allocations. const Resources& resource = container->resources; const Option<Bytes> mem = resource.mem(); if (mem.isSome()) { result.set_mem_limit_bytes(mem.get().bytes()); } const Option<double> cpus = resource.cpus(); if (cpus.isSome()) { result.set_cpus_limit(cpus.get()); } return result; }; 以上可以看出,cpu_limits和mem_limit_bytes来自于container->resources。而container->resources大体来自于Offer,这里有一个多32M的问题,我们先放着待会儿解释。 其他的指标来自于cgroup的统计,包括cpus_system_time_secs、cpus_user_time_secs、mem_rss_bytes。通过跟踪代码,发现: Try<ResourceStatistics> DockerContainerizerProcess::cgroupsStatistics( pid_t pid) const { const Result<string> cpuHierarchy = cgroups::hierarchy("cpuacct"); const Result<string> memHierarchy = cgroups::hierarchy("memory"); const Result<string> cpuCgroup = cgroups::cpuacct::cgroup(pid); const Result<string> memCgroup = cgroups::memory::cgroup(pid); const Try<cgroups::cpuacct::Stats> cpuAcctStat = cgroups::cpuacct::stat(cpuHierarchy.get(), cpuCgroup.get()); const Try<hashmap<string, uint64_t>> memStats = cgroups::stat(memHierarchy.get(), memCgroup.get(), "memory.stat"); if (!memStats.get().contains("rss")) { return Error("cgroups memory stats does not contain 'rss' data"); } ResourceStatistics result; result.set_timestamp(Clock::now().secs()); result.set_cpus_system_time_secs(cpuAcctStat.get().system.secs()); result.set_cpus_user_time_secs(cpuAcctStat.get().user.secs()); result.set_mem_rss_bytes(memStats.get().at("rss")); return result; #endif // __linux__ } ok, 到这里cgroup统计的信息,一目了然。我们回过头来,分析一下container->resources: // Tell the containerizer to launch the executor. // NOTE: We modify the ExecutorInfo to include the task's // resources when launching the executor so that the containerizer // has non-zero resources to work with when the executor has // no resources. This should be revisited without MESOS-600. ExecutorInfo executorInfo_ = executor->info; Resources resources = executorInfo_.resources(); resources += taskInfo.resources(); executorInfo_.mutable_resources()->CopyFrom(resources); // Launch the container. Future<bool> launch; if (!executor->isCommandExecutor()) { // If the executor is _not_ a writ executor, this ways that // the task will include the executor to run. The very task to // run will be enqueued and subsequently handled by the executor // when it has registered to the slave. launch = slave->containerizer->launch( containerId, executorInfo_, // Modified to include the task's resources, see above. executor->directory, user, slave->info.id(), slave->self(), info.checkpoint()); 在启动executor之前,会在executor resources的基础上加上task的resource,即resources += taskInfo.resources()。 比如,我们启动一个1cpu1G的任务,实际上最终statistic显示的会比这个多,多出来的实际上是executor占用的资源。 那么executor占用的资源是多少?32M和0.1cpu么? // Add an wage for the writ executor. This does lead to a // small overcommit of resources. // TODO(vinod): If a task is using revocable resources, mark the // respective executor resource (e.g., cpus) to be moreover // revocable. Currently, it is OK considering the containerizer is // given task + executor resources on task launch resulting in // the container stuff correctly marked as revocable. executor.mutable_resources()->MergeFrom( Resources::parse( "cpus:" + stringify(DEFAULT_EXECUTOR_CPUS) + ";" + "mem:" + stringify(DEFAULT_EXECUTOR_MEM.megabytes())).get()); 这里的DEFAULT_EXECUTOR_CPUS\DEFAULT_EXECUTOR_MEM就是默认executor所占用的资源: // Default cpu resource given to a writ executor. constexpr double DEFAULT_EXECUTOR_CPUS = 0.1; // Default memory resource given to a writ executor. constexpr Bytes DEFAULT_EXECUTOR_MEM = Megabytes(32); 以上得到证明。 结论 /monitor/statistics 返回的statistics包含两个来源的资源:1. executor 2. cgroup获取的Container资源。 参考 memory usage in process and cgroup Please enable JavaScript to view the comments powered by Disqus. All content is licensed under CC BY-NC-SA Buit with Jekyll and 3-Jekyll theme • Hosted on Github Table of Contents