If a long-consuming task is issued to the MONGODB server, the client-forced termination causes the task to continue executing on the server side.
MongoDB now provides a way to query and manage the tasks that are being performed.
Db.currentop () obtains all current ' in progressing ' operations, including Insert/query/update/remove/getmore/command, etc. > Db.currentop ( True
The data structure returned is as follows:
{"InProg": [{"opid": ID of 3434473,//Operation Activ E ": <boolean>,//is Active" secs_running ": How many seconds did the 0,//operation Run" OP ":" &l T;operation> ",//specific operating behavior, including (Insert/query/update/remove/getmore/command)" ns ":" <database> ;. <collection> ",///operation of the namespace, such as: Database name. Collection name" Query ": {//specific action statement}, "Client": "
Find an operation that takes a long time to secs_running, which can be an unusual operation,> db. Killop(opid) MongoDB has a high CPU, how to force stop the operation that is being performed