REQ-NFR-063
Read-only mode middleware adds <= 5 ms p99 overhead on read endpoints
What
Read-only mode middleware SHALL add no more than 5 ms latency overhead at p99 on read endpoints (GET/HEAD/OPTIONS).
Why
Read-only mode runs in front of every request; on hot read paths even small overhead compounds. Performance budget protects the operational responsiveness of the read surface during freezes.
How
Middleware short-circuits on safe methods after a single env-var lookup (cached at process start); no DB I/O.
Done when
Latency benchmark (e.g. wrk against /v1/projects) shows p99 delta <= 5 ms vs read-only-disabled baseline; benchmark archived under doc/perf/.
Out of scope
Write-path overhead (those return 403 immediately; latency is the user's choice).
Category
performance
established project management guidelines Mapping
Read-only middleware p99 budget - measurable quality.