rmdir.cn

mongotop

集合级别读写耗时监控

语法

mongotop [选项]

说明

mongotop 按集合粒度追踪并报告 mongod 实例的读写操作耗时。每秒刷新,显示每个集合的读写总时间(毫秒),快速定位哪些集合正在经历高负载。

参数

  • --uri

    MongoDB 连接字符串

  • <sleeptime>

    刷新间隔秒数,默认 1 秒

  • -n

    输出次数后退出

示例

基本监控

每秒刷新集合读写耗时

mongotop --uri="mongodb://localhost:27017"

长间隔监控

每 5 秒刷新一次

mongotop 5

输出指定次数

输出 20 次后退出

mongotop -n 20