1: See what is currently being done by MongoDB?
Db.currentop () is equivalent to: db. $cmd. Sys.inprog.findOne ()
2: Detailed Currentop ()
Gechongrepl:primary> Db.currentop () {"InProg": [{"Opid": 6222, "active": true, "secs_running": 3, "microsecs_running ": Numberlong (3662328)," Op ":" Getmore "," ns ":" local.oplog.rs "," query ": {}," client ":" 192.168.91.132:45745 "," desc ":" Conn5 "," threadId ":" 0x7f1370cb4700 "," ConnectionID ": 5," Waitingforlock ": false," Numyields ": 0," Lockstats ": {" Timelockedmicros ": {" R ": Numberlong (141)," W ": Numberlong (0)}," Timeacquiringmicros ": {" R ": Numberlong (+)," W ": Number Long (0)}}}]}
"Opid": 6222, #进程号
"Active": true, #是否活动状态
"Secs_running": 3, #操作运行了多少秒
"Microsecs_running": Numberlong (3662328),
"Op": "Getmore", #操作类型, including (Insert/query/update/remove/getmore/command)
"NS": "Local.oplog.rs", #命名空间
"Query": {},#如果op是查询操作, this will show the contents of the query, also said here to show the specific action statement
"Client": "192.168.91.132:45745", #连接的客户端信息
"desc": "Conn5", #数据库的连接信息
"ThreadId": "0x7f1370cb4700", #线程ID
"ConnectionID": 5, #数据库的连接ID
"Waitingforlock": false, #是否等待获取锁
"Numyields": 0,
"Lockstats": {
"Timelockedmicros": {#持有的锁时间微秒
"R": Numberlong (141), #整个MongoDB实例的全局读锁
"W": Numberlong (0)}, #整个MongoDB实例的全局写锁
"Timeacquiringmicros": {#为了获得锁, microsecond time to wait
"R": Numberlong (+), #整个MongoDB实例的全局读锁
"W": Numberlong (0)} #整个MongoDB实例的全局写锁
MongoDB Process Control Series One: View the currently executing process