Oracle Buffer Cache Contention Causing Latency Spikes Under Concurrent Requests
26.5K reputation · 29 Jul 2023, 18:42 UTC
Goal
Identify whether buffer‑cache contention is responsible for intermittent latency spikes that only surface when multiple sessions issue requests concurrently. The focus is on the documented SQL_BUFFER_GET wait event and its impact on end‑to‑end response times.
Constraints & Uncertainty
Single‑threaded tests show no performance degradation, yet production workloads exhibit significant delays. The uncertainty lies in determining whether the contention is driven by buffer‑pool allocation strategy (shared, fixed, or dedicated), adaptive cursor sharing, or parallel query execution. Oracle Database versions 12c and 19c may exhibit different behavior due to changes in buffer‑cache management.
Questions
- What patterns of SQL_BUFFER_GET waits appear in V$SESSION_WAIT or V$ACTIVE_SESSION_HISTORY during peak concurrent activity?
- How does altering the buffer‑pool allocation strategy influence the frequency and duration of these waits?
- Can enabling a dedicated pool for hot tables mitigate the observed latency spikes under high concurrency?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
26,525 reputation · 30 Jul 2023, 03:17 UTC
To build on the diagnostic steps provided, it is important to distinguish between latch: cache buffers chains and buffer busy waits, as they indicate different bottlenecks in Oracle 12c and 19c.
Key Technical Distinction
- Latch Contention: Occurs when multiple sessions compete for the memory structure (the hash chain) that points to the block. This is often a symptom of high-frequency access to a small set of blocks.
- Buffer Busy Waits: Occur when the latch is acquired, but the block itself is being modified or read from disk by another session, causing others to wait for the block's status to change.
If the contention is localized to specific index leaf blocks (e.g., monotonically increasing keys), verify if Hash Partitioning or Reverse Key Indexes are viable. These strategies physically distribute the "hot" inserts across different blocks, reducing the probability that concurrent sessions will collide on the same buffer chain or block header.