24 — LockTimeout
performanceconcurrency
The operation could not acquire a lock within the timeout period
What is happening?
LockTimeout means a MongoDB operation waited for a lock longer than the configured timeout and was abandoned. MongoDB uses reader-writer locks at the database and collection level. Heavy concurrent write operations or long-running transactions can cause lock contention.
Common causes
- Long-running transaction holding a write lock
- Background index build competing with write operations
- High write concurrency on the same collection
- DDL operation (rename, drop) blocked by active cursors