Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I think I have a long running mongo script tanking my database, but I'm not sure. I was connected to the linux server via SSH and I ran the script like so:

mongo my_database my_script.js

It started chugging away, but it was taking too long, so I hit Ctrl-C and dropped back to the shell. I assumed the script was killed off, but now I'm seeing queries that it contained still running on the database.

How do I get a list of scripts the database is currently running and kill them? I know about db.currentOp and db.killOp, but the actual queries themselves are quick, I need to kill the script that's running them in a loop.

share|improve this question
Ok, the query was tanking our database, so we just restarted the mongod service. Our other secondaries stepped up, which was good, but this is not the solution I was looking for. – LoveMeSomeCode Mar 28 '14 at 19:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.