db.currentOp().inprog.forEach(
function (op) {
if (op.secs_running > 5) {
print("host: " + op.host
+ " secs_running: " + op.secs_running
+ " op: " + op.op
+ " ns: " + op.ns
//+ " command: " + JSON.stringify(op.command)
);
db.killOp(op.opid);
}
}
);
Last active
April 26, 2021 14:20
-
-
Save Mualig/66e53beedf6eabc73b3d2c9b62de1e5a to your computer and use it in GitHub Desktop.
Command to kill old mongo DB ops
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment