MongoDB mongotop命令详解

本文介绍MongoDB自带的实时统计工具mongotop的使用方法及参数选项,帮助用户了解如何通过mongotop查看数据库实例上的读写操作统计情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mongotop用来跟踪MongoDB的实例, 提供每个集合的统计数据。默认情况下,mongotop每一秒刷新一次。
mongotop用法:
C:\Users\duansf>mongotop --help
View live MongoDB collection statistics.

Options:
  --help                                produce help message
  -v [ --verbose ]                      be more verbose (include multiple times
                                        for more verbosity e.g. -vvvvv)
  --quiet                               silence all non error diagnostic
                                        messages
  --version                             print the program's version and exit
  -h [ --host ] arg                     mongo host to connect to ( <set
                                        name>/s1,s2 for sets)
  --port arg                            server port. Can also use --host
                                        hostname:port
  --ipv6                                enable IPv6 support (disabled by
                                        default)
  -u [ --username ] arg                 username
  -p [ --password ] arg                 password
  --authenticationDatabase arg          user source (defaults to dbname)
  --authenticationMechanism arg (=MONGODB-CR)
                                        authentication mechanism
  --gssapiServiceName arg (=mongodb)    Service name to use when authenticating
                                        using GSSAPI/Kerberos
  --gssapiHostName arg                  Remote host name to use for purpose of
                                        GSSAPI/Kerberos authentication
  --locks                               use db lock info instead of top

C:\Users\duansf>mongotop -h localhost -vvvvv
2016-03-31T17:39:27.553+0800 creating new connection to:localhost:27017
2016-03-31T17:39:27.562+0800 [ConnectBG] BackgroundJob starting: ConnectBG
2016-03-31T17:39:27.565+0800 connected to server localhost:27017 (127.0.0.1)
2016-03-31T17:39:27.565+0800 connected connection!
connected to: localhost

                            ns       total        read       write
2016-03-31T09:39:28
                wangshuai.test         0ms         0ms         0ms
   wangshuai.system.namespaces         0ms         0ms         0ms
      wangshuai.system.indexes         0ms         0ms         0ms
                    test.users         0ms         0ms         0ms
        test.system.namespaces         0ms         0ms         0ms
           test.system.indexes         0ms         0ms         0ms
                 test.chenfeng         0ms         0ms         0ms
                    test.books         0ms         0ms         0ms


                            ns       total        read       write
2016-03-31T09:39:29
                wangshuai.test         0ms         0ms         0ms
   wangshuai.system.namespaces         0ms         0ms         0ms
      wangshuai.system.indexes         0ms         0ms         0ms
                    test.users         0ms         0ms         0ms
        test.system.namespaces         0ms         0ms         0ms
           test.system.indexes         0ms         0ms         0ms
                 test.chenfeng         0ms         0ms         0ms
                    test.books         0ms         0ms         0ms

                            ns       total        read       write
2016-03-31T09:39:30
                wangshuai.test         0ms         0ms         0ms
   wangshuai.system.namespaces         0ms         0ms         0ms
      wangshuai.system.indexes         0ms         0ms         0ms
                    test.users         0ms         0ms         0ms
        test.system.namespaces         0ms         0ms         0ms
           test.system.indexes         0ms         0ms         0ms
                 test.chenfeng         0ms         0ms         0ms
                    test.books         0ms         0ms         0ms


                            ns       total        read       write
2016-03-31T09:39:31
                wangshuai.test         0ms         0ms         0ms
   wangshuai.system.namespaces         0ms         0ms         0ms
      wangshuai.system.indexes         0ms         0ms         0ms
                    test.users         0ms         0ms         0ms
        test.system.namespaces         0ms         0ms         0ms
           test.system.indexes         0ms         0ms         0ms
                 test.chenfeng         0ms         0ms         0ms
                    test.books         0ms         0ms         0ms

                            ns       total        read       write
2016-03-31T09:39:32
                wangshuai.test         0ms         0ms         0ms
   wangshuai.system.namespaces         0ms         0ms         0ms
      wangshuai.system.indexes         0ms         0ms         0ms
                    test.users         0ms         0ms         0ms
        test.system.namespaces         0ms         0ms         0ms
           test.system.indexes         0ms         0ms         0ms
                 test.chenfeng         0ms         0ms         0ms
                    test.books         0ms         0ms         0ms

输出字段说明:
ns:数据库命名空间,后者结合了数据库名称和集合。
db:数据库的名称。名为 . 的数据库针对全局锁定,而非特定数据库。
total:mongod在这个命令空间上花费的总时间。
read:在这个命令空间上mongod执行读操作花费的时间。
write:在这个命名空间上mongod进行写操作花费的时间。</set

<set





</set

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15498/viewspace-2073258/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15498/viewspace-2073258/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值