Question
Modx 2.6+ File‑Based Cache Locking: Unresolved Latency Under Concurrent Requests
Dev Finch
0 reputation · 05 Jul 2022, 18:09 UTC
142.1K views0
Goal
Investigate the latency introduced by Modx’s file‑based cache locking when multiple requests simultaneously write the same cache entry.
Constraints & Uncertainty
Modx 2.6+ employs PHP file locking to serialize cache writes. The documentation notes potential contention but lacks quantitative data on response times or lock‑release guarantees under heavy concurrency. Additionally, the system may leave orphaned lock files if a request terminates unexpectedly, potentially causing deadlocks.
Specific Questions
- What mechanisms, if any, does Modx provide to detect and recover from orphaned cache lock files in a file‑based cache?
- Can the file‑based cache locking behavior be tuned (e.g., timeout, retry strategy) without switching to a distributed cache adapter?
- How does Modx handle lock contention when multiple requests attempt to write the same cache entry, and is there an undocumented option to mitigate the resulting latency?