mongodb性能监控指标详细解释

常用监控项及说明

当我们监控mongodb实例时,大约有300多项的监控指标,通常我们可以关注以下的20项指标就够了

监控项 说明
mongodb_memory 内存占用(MiB)
mongodb_mongod_op_latencies_latency_total 累计操作耗时(毫秒)
mongodb_mongod_op_latencies_ops_total 累计操作次数
mongodb_op_counters_total 累计接收的操作请求次数(即使操作不成功也会增加)
mongodb_connections 连接数
mongodb_mongod_metrics_cursor_open 打开游标数量
mongodb_mongod_metrics_document_total 累计文档操作次数
mongodb_mongod_global_lock_current_queue 当前排队等待获取锁的操作个数
mongodb_mongod_metrics_query_executor_total 查询和查询计划评估过程扫描的(索引或文档)条目总数
mongodb_asserts_total 累计断言错误次数
mongodb_mongod_metrics_get_last_error_wtime_num_total 累计getLastError操作数量
mongodb_mongod_wiredtiger_cache_bytes 当前缓存数据大小(byte)
mongodb_mongod_wiredtiger_cache_bytes_total 写入或读取的缓存数据大小(byte)
mongodb_mongod_wiredtiger_cache_pages 当前缓存页数量
mongodb_mongod_wiredtiger_cache_evicted_total 累计缓存移除页数量
mongodb_extra_info_page_faults_total 累计缺页中断次数
mongodb_ss_network_bytesOut 累计发送网络流量(byte)
mongodb_ss_network_bytesIn 累计接收网络流量(byte)
mongodb_mongod_replset_member_replication_lag 副本集成员主从延迟(秒)

mongodb_memory

例:
mongodb_memory{job="mongodb", service="mongodb", team="dba", type="resident"}
34957
mongodb_memory{job="mongodb", service="mongodb", team="dba", type="virtual"}
49537

mongodb_mongod_op_latencies_latency_total

-这个指标可以帮助监控系统管理员了解 MongoDB 数据库实例中各类操作的响应时间,并对系统进行性能优化。

avg(rate(mongodb_mongod_op_latencies_latency_total{team="dba"}[5m])) by (instance)
avg(rate(mongodb_mongod_op_latencies_latency_total{team="dba",type="read"}[5m])) by (instance)
avg(rate(mongodb_mongod_op_latencies_latency_total{team="dba",type="write"}[5m])) by (instance)
avg(rate(mongodb_mongod_op_latencies_latency_total{team="dba",type="command"}[5m])) by (instance)
avg(rate(mongodb_mongod_op_latencies_latency_total{team="dba",type="transactions"}[5m])) by (instance)

mongodb_op_counters_total

avg(rate(mongodb_op_counters_total{team="dba", type="getmore"}[5m])) by (instance)
avg(rate(mongodb_op_counters_total{team="dba", type="insert"}[5m])) by (instance)
avg(rate(mongodb_op_counters_total{team="dba", type="query"}[5m])) by (instance)
avg(rate(mongodb_op_counters_total{team="dba", type="update"}[5m])) by (instance)
avg(rate(mongodb_op_counters_total{team="dba", type="command"}[5m])) by (instance)
avg(rate(mongodb_op_counters_total{team="dba", type=""}[5m])) by (instance)

mongodb_connections

mongodb_connections{ state="available"}
mongodb_connections{ state="current"}
mongodb_connections{ state="totalCreated"}

cache_dirty_percent

mongodb_mongod_wiredtiger_cache_bytes_total

avg(rate(mongodb_mongod_wiredtiger_cache_bytes_total{team="dba", type="read"}[5m])) by (instance)
avg(rate(mongodb_mongod_wiredtiger_cache_bytes_total{team="dba", type="written"}[5m])) by (instance)

mongodb_asserts_total

sum(rate(mongodb_asserts_total{team="dba"} [5m])) by (instance)

mongodb_mongod_global_lock_current_queue

mongodb_mongod_global_lock_current_queue{team="dba", type="total"}

mongodb_extra_info_page_faults_total

sum(rate(mongodb_extra_info_page_faults_total{team="dba"}[5m])) by (instance)

mongodb_mongod_replset_member_replication_lag

max(mongodb_mongod_replset_member_replication_lag{team="dba" }) by   (instance)

mongodb_ss_network_bytesOut

sum(rate(mongodb_ss_network_bytesOut{team="dba"}[5m])) by (instance)

mongodb_ss_network_bytesIn

sum(rate(mongodb_ss_network_bytesIn{team="dba"}[5m])) by (instance)

指标分类及标识

>> Home

51ak

2022/12/08

Categories: nosql 监控 mongodb Tags: 原创 精品

《数据库工作笔记》公众号
扫描上面的二维码,关注我的《数据库工作笔记》公众号