ivanjobs.github.io - Mesos GC原理解析









Search Preview

Mesos GC原理解析 | Ivan的博客

ivanjobs.github.io
gc的对象是什么? 下面是Agent上work_dir下的目录规划: // root ('--work_dir' flag) // |-- slaves // | |-- latest (symlink) // | |-- // | |-- frameworks // | |-- // | |-- executors // | |-- // | |-- runs // | |-- latest (symlink) // | |-- (sandbox) // |-- meta // | |-- slaves // | |-- latest (symlink) // | |-- // | |-- slave.info // | |-- frameworks // | |-- // | |-- framework.info // | |-- framework.pid // | |-- executors // | |-- // | |-- executor.info // | |-- runs // | |-- latest (symlink) // | |-- (sandbox) // | |-- executor.sentinel (if completed) // | |-- pids // | | |-- forked.pid // | | |-- libprocess.pid // | |-- tasks // | |-- // | |-- task.info // | |-- task.updates // |-- boot_id // |-- resources // | |-- resources.info // |-- volumes // | |-- roles // | |-- // | |-- (persistent volume) // |-- provisioner GC的对象就是这里的目录。至于每个目录业务上意义,不是本篇的重点,故略去。
.io > ivanjobs.github.io

SEO audit: Content analysis

Language Error! No language localisation is found.
Title Mesos GC原理解析 | Ivan的博客
Text / HTML ratio 39 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud Ceph << Mesos Python mesos usage timer symlink removalTime = latest OpenStack void 笔记 deletion directories executorDirectoryMaxAllowedAge paths time disk
Keywords consistency
Keyword Content Title Description Headings
Ceph 14
<< 11
Mesos 8
Python 7
mesos 6
usage 6
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
Ceph 14 0.70 %
<< 11 0.55 %
Mesos 8 0.40 %
Python 7 0.35 %
mesos 6 0.30 %
usage 6 0.30 %
timer 6 0.30 %
symlink 4 0.20 %
removalTime 4 0.20 %
= 4 0.20 %
latest 4 0.20 %
OpenStack 4 0.20 %
void 3 0.15 %
笔记 3 0.15 %
deletion 3 0.15 %
directories 3 0.15 %
executorDirectoryMaxAllowedAge 3 0.15 %
paths 3 0.15 %
time 3 0.15 %
disk 3 0.15 %

SEO Keywords (Two Word)

Keyword Occurrence Density
latest symlink 4 0.20 %
disk usage 3 0.15 %
existing timer 2 0.10 %
the next 2 0.10 %
LOGINFO << 2 0.10 %
Ceph v1023 2 0.10 %
Mesos GC原理解析 2 0.10 %
Timeout removalTime 2 0.10 %
usage << 2 0.10 %
deletion time 2 0.10 %
timer = 2 0.10 %
Ceph RGW 2 0.10 %
slaves latest 2 0.10 %
runs latest 2 0.10 %
frameworks 2 0.10 %
executors 2 0.10 %
symlink 2 0.10 %
symlink 2 0.10 %
sandbox 2 0.10 %
for the 1 0.05 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
slaves latest symlink 2 0.10 % No
symlink sandbox 2 0.10 % No
latest symlink 2 0.10 % No
runs latest symlink 2 0.10 % No
disk usage << 2 0.10 % No
latest symlink 2 0.10 % No
最新文章 dev ops 1 0.05 % No
string path来安排一个item的GC,schedule负责添加新的 item,并且也检查timer是否需要reset: 1 0.05 % No
path来安排一个item的GC,schedule负责添加新的 item,并且也检查timer是否需要reset: Fires 1 0.05 % No
item,并且也检查timer是否需要reset: Fires a 1 0.05 % No
Fires a message 1 0.05 % No
a message to 1 0.05 % No
message to self 1 0.05 % No
to self for 1 0.05 % No
for the next 1 0.05 % No
self for the 1 0.05 % No
the next event 1 0.05 % No
next event This 1 0.05 % No
event This also 1 0.05 % No
This also cancels 1 0.05 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
runs latest symlink 2 0.10 % No
latest symlink sandbox 2 0.10 % No
slaves latest symlink 2 0.10 % No
最新文章 dev ops math 1 0.05 % No
to self for the 1 0.05 % No
path来安排一个item的GC,schedule负责添加新的 item,并且也检查timer是否需要reset: Fires a 1 0.05 % No
item,并且也检查timer是否需要reset: Fires a message 1 0.05 % No
Fires a message to 1 0.05 % No
a message to self 1 0.05 % No
message to self for 1 0.05 % No
for the next event 1 0.05 % No
self for the next 1 0.05 % No
外部系统调用scheduleDuration string path来安排一个item的GC,schedule负责添加新的 item,并且也检查timer是否需要reset: 1 0.05 % No
the next event This 1 0.05 % No
next event This also 1 0.05 % No
event This also cancels 1 0.05 % No
This also cancels any 1 0.05 % No
also cancels any existing 1 0.05 % No
cancels any existing timer 1 0.05 % No
string path来安排一个item的GC,schedule负责添加新的 item,并且也检查timer是否需要reset: Fires 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 GC原理解析 | 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 August 12 Mesos GC原理解析 gc的对象是什么? 下面是Agent上work_dir下的目录规划: // root ('--work_dir' flag) // |-- slaves // | |-- latest (symlink) // | |-- <slave_id> // | |-- frameworks // | |-- <framework_id> // | |-- executors // | |-- <executor_id> // | |-- runs // | |-- latest (symlink) // | |-- <container_id> (sandbox) // |-- meta // | |-- slaves // | |-- latest (symlink) // | |-- <slave_id> // | |-- slave.info // | |-- frameworks // | |-- <framework_id> // | |-- framework.info // | |-- framework.pid // | |-- executors // | |-- <executor_id> // | |-- executor.info // | |-- runs // | |-- latest (symlink) // | |-- <container_id> (sandbox) // | |-- executor.sentinel (if completed) // | |-- pids // | | |-- forked.pid // | | |-- libprocess.pid // | |-- tasks // | |-- <task_id> // | |-- task.info // | |-- task.updates // |-- boot_id // |-- resources // | |-- resources.info // |-- volumes // | |-- roles // | |-- <role> // | |-- <persistence_id> (persistent volume) // |-- provisioner GC的对象就是这里的目录。至于每个目录业务上意义,不是本篇的重点,故略去。 怎样做GC? // Store all the timeouts and respective paths to delete. // NOTE: We are using Multimap here instead of Multihashmap, considering // we need the keys of the map (deletion time) to be sorted. Multimap<process::Timeout, PathInfo> paths; // We moreover need efficient lookup for a path, to determine whether // it exists in our paths mapping. hashmap<std::string, process::Timeout> timeouts; process::Timer timer; 上面是GC Process的数据结构,一个timer用作定时器,另外两个是GC的核心数据结构: paths是Timeout -> PathInfo的映射,timeouts是path->Timeout的映射。 外部系统调用schedule(Duration, string path)来安排一个item的GC,schedule()负责添加新的 item,并且也检查timer是否需要reset: // Fires a message to self for the next event. This moreover cancels any // existing timer. void GarbageCollectorProcess::reset() { Clock::cancel(timer); // Cancel the existing timer, if any. if (!paths.empty()) { Timeout removalTime = (*paths.begin()).first; // Get the first entry. timer = delay(removalTime.remaining(), self(), &Self::remove, removalTime); } else { timer = Timer(); // Reset the timer. } } reset的逻辑很明显,从path中取第一个Timeout时间,然后设置定时remove, 那么后面的paths怎么接着处理的呢? 我们查看remove的逻辑,发现最后一行是reset(), 这样就清楚了。(注意这么paths里面的Timeouts是有序的) gc_disk_headroom? 我们发现gc相关的有几个有意思的配置:–gc_disk_headroom, –disk_watch_interval, –gc_delay, 这几个参数是做什么的? 这几个参数是GC特定客户的逻辑,这里的特定用户指的是 checkDiskUsage: void Slave::_checkDiskUsage(const Future<double>& usage) { if (!usage.isReady()) { LOG(ERROR) << "Failed to get disk usage: " << (usage.isFailed() ? usage.failure() : "future discarded"); } else { executorDirectoryMaxAllowedAge = age(usage.get()); LOG(INFO) << "Current disk usage " << std::setiosflags(std::ios::fixed) << std::setprecision(2) << 100 * usage.get() << "%." << " Max unliable age: " << executorDirectoryMaxAllowedAge; // We prune all directories whose deletion time is within // the next 'gc_delay - age'. Since a directory is unchangingly // scheduled for deletion 'gc_delay' into the future, only directories // that are at least 'age' old are deleted. gc->prune(flags.gc_delay - executorDirectoryMaxAllowedAge); } delay(flags.disk_watch_interval, self(), &Slave::checkDiskUsage); } 这里是直接使用prune这个接口: void GarbageCollectorProcess::prune(const Duration& d) { foreach (const Timeout& removalTime, paths.keys()) { if (removalTime.remaining() <= d) { LOG(INFO) << "Pruning directories with remaining removal time " << removalTime.remaining(); dispatch(self(), &GarbageCollectorProcess::remove, removalTime); } } } prune这个接口会立马删除在d以内的path。可以研究一下age的计算,也就是executorDirectoryMaxAllowedAge: // TODO(vinod): Figure out a way to express this function via cmd line. Duration Slave::age(double usage) { return flags.gc_delay * std::max(0.0, (1.0 - flags.gc_disk_headroom - usage)); } 这里的逻辑是gc_disk_headroom越大,则age就越小;gc_disk_headroom越小,则age越大。 也就是说,Executor目录存放的时候,由disk usage决定。使用这个参数,可以实现:比如我们的disk usage还剩10%的时候会告警,这里可以设置成0.1或者保守点0.2, 就能够保证不会出现告警。 总结 总结一下, mesos GC有两套逻辑: 一个是基于gc_delay参数,相关gc的目录,会计算最后修改时间到当前时间间隔,gc_deplay-这个间隔,得到timer时间,timer到了会去清理该目录。另一个是checkDiskUsage的时候,只针对Executor目录,具体逻辑参考上面。 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