暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

mongodb性能监控

原创 zhou 2024-03-01
118

系统监控

vmstat

top

serverStatus监控

db.serverStatus().mem 系统内存情况
db.serverStatus().connections 连接数信息
db.serverStatus().globalLock 全局锁信息
db.serverStatus().locks 锁信息
db.serverStatus().opcounters 操作统计计数器
db.serverStatus().indexCounters 索引统计信息
db.serverStatus().backgroundFlushing 后台刷新
db.serverStatus().network 网络信息
db.serverStatus().repl 复制集信息
db.serverStatus().recordStats 记录状态信息

mongostat监控

mongostat --host  xxx.xxx.xxx.xxx:27017 -uroot -ppassword --authenticationDatabase admin

Screen Shot 2021-04-16 at 3.26.41 PM

注意监控项

dirty%  >5% 后台刷新,>20% 用户阻塞刷新;对于脏页刷新可调整阈值

used% >80% 后台刷新,>95% 用户阻塞刷新;对于内存使用应调低后台刷新阈值

参数 默认值 含义
eviction_target 80 当cache used超过eviction_target,后台evict线程开始淘汰CLEAN PAGE
eviction_trigger 95 当cache used超过eviction_trigger,⽤户线程也开始淘汰CLEAN PAGE
eviction_dirty_target 5 当cache dirty超过eviction_dirty_target,后台evict线程开始淘汰DIRTY PAG
eviction_dirty_trigger 20 当cache dirty超过eviction_dirty_trigger,⽤户线程也开始淘汰DIRTY PAGE
db.adminCommand({
setParameter: 1,
wiredTigerEngineRuntimeConfig:
`eviction=(threads_min=4,threads_max=4),
eviction_dirty_trigger=30,eviction_dirty_target=1,
eviction_trigger=95,eviction_target=60`
 });
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论