4323e 发表于 2015-1-13 08:31:19

mongotop 读写性能检测

参考链接:http://docs.mongodb.org/manual/reference/program/mongotop/

Fields
mongotop returns time values specified in milliseconds (ms.)
mongotop only reports active namespaces or databases, depending on the --locks option. If you don’t see a database or collection, it has received no recent activity. You can issue a simple operation in the mongo shell to generate activity to affect the output of mongotop.

mongotop.ns
Contains the database namespace, which combines the database name and collection.
Changed in version 2.2: If you use the --locks, the ns field does not appear in the mongotop output.

mongotop.db
New in version 2.2.
Contains the name of the database. The database named . refers to the global lock, rather than a specific database.
This field does not appear unless you have invoked mongotop with the --locks option.

mongotop.total
Provides the total amount of time that this mongod spent operating on this namespace.

mongotop.read
Provides the amount of time that this mongod spent performing read operations on this namespace.

mongotop.write
Provides the amount of time that this mongod spent performing write operations on this namespace.

mongotop.<timestamp>
Provides a time stamp for the returned data.

Use
By default mongotop connects to the MongoDB instance running on the localhost port 27017. However, mongotop can optionally connect to remote mongod instances. See the mongotop options for more information.
To force mongotop to return less frequently specify a number, in seconds at the end of the command. In this example, mongotop will return every 15 seconds.

mongotop 15
This command produces the following output:
connected to: 127.0.0.1
                  ns       total      read       write         2015-01-12T15:45:40
test.system.namespaces         0ms         0ms         0ms
local.system.replset         0ms         0ms         0ms
local.system.indexes         0ms         0ms         0ms
admin.system.indexes         0ms         0ms         0ms
                admin.         0ms         0ms         0ms

                  ns       total      read       write         2015-01-12T15:45:55
test.system.namespaces         0ms         0ms         0ms
local.system.replset         0ms         0ms         0ms
local.system.indexes         0ms         0ms         0ms
admin.system.indexes         0ms         0ms         0ms
                admin.         0ms         0ms         0ms
To return a mongotop report every 5 minutes, use the following command:
mongotop 300
To report the use of per-database locks, use mongotop --locks, which produces the following output:

$ mongotop --locks
connected to: 127.0.0.1

                  db       total      read       write          2015-01-12T16:33:34
               local         0ms         0ms         0ms
               admin         0ms         0ms         0ms
                   .         0ms         0ms         0ms

页: [1]
查看完整版本: mongotop 读写性能检测