Can somebody explain me what is lock pinger in MongoDB

[LockPinger] cluster XXXXXXX:27019 pinged successfully at Wed Feb 5 04:46:01 2014 by distributed lock pinger 'XXXXXX:27019/ip-XX-XX-XX-XX:27017:1391512883:1804289383', sleeping for 30000ms

1 Answer 1


There are distributed locks used in a sharded environment. The balancer takes a lock (only one migration is active at a time), the shards will take out meta data locks when doing splits also. Those live in the config.locks collection.

As for the lock pinger, the config.lockpings collection keeps track of the active components in the cluster, so it is an informational collection. The lock pinger is what populates this collection and you have pasted what looks to be the result of a successful ping.

Note: please do not use these collections for anything in your application or elsewhere. These collections (as noted on the linked pages) are considered internal only and can (and will) be changed/removed/updated without notice.

  • Can you please explain me what is actually happening when doing lock pinging? Feb 6, 2014 at 7:44
  • As I said, it is keeping track of the various pieces of the cluster, when a process successfully pings it updates the timestamp in the collection, then the pinger goes back to sleep (as you can see in the log message). Perhaps if you explained why you are trying to figure this out it might be easier to answer your question, in general terms this can just be considered internal housekeeping my MongoDB and be ignored.
    – Adam C
    Feb 6, 2014 at 9:16
  • The reason is, I have created shard cluster with 3 shard servers, 1 config and 1 router. While monitoring all the servers the router sometimes use 100% of CPU but I do not see any log regarding high CPU usage. So I thought that this lock pinging may use high CPU for pinging process. Please advise me if there is any other reason for 100% CPU usage. Feb 6, 2014 at 10:03
  • It will not be the lock pings, they are very lightweight, I assume you think they are the culprit because they show up regularly, but that is just a function of them running periodically (people often think the serverStatus command is at fault on mongod processes for the same reason). If you are seeing high CPU, then I would look for large in memory sorts, hash computation on a hashed shard key, see if increasing the log level on the mongos gives more insight. Oh, and if this is a prod system, do not run with 1 config server, ever.
    – Adam C
    Feb 6, 2014 at 10:46
  • Thank you.. Do you know any other reason behind the high CPU usage? Feb 6, 2014 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.