# MongoServerError: mmapv1 lock acquire timeout

- **ID:** `mongodb/mmapv1-lock-acquire-timeout`
- **Domain:** mongodb
- **Category:** resource_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

With the deprecated MMAPv1 storage engine, a write operation waited too long for a database-level lock due to high concurrency.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| mongodb-3.2 | active | — | — |
| mongodb-3.4 | active | — | — |
| mongodb-3.6 | active | — | — |

## Workarounds

1. **Migrate to WiredTiger storage engine which uses document-level concurrency.** (95% success)
   ```
   Migrate to WiredTiger storage engine which uses document-level concurrency.
   ```
2. **Reduce write concurrency by batching writes or using a queue to serialize operations.** (70% success)
   ```
   Reduce write concurrency by batching writes or using a queue to serialize operations.
   ```

## Dead Ends

- **** — Increasing lock timeout just delays failure; the underlying contention remains. (80% fail)
- **** — Adding more application threads exacerbates lock contention. (95% fail)
