Skip to content

RDS buffer cache hit ratio - difference between writer and reader

0

I am looking for some advice around the buffer cache hit ratio.

On the reader it's almost always 100% or very high 99.99xxx%.

The writer can get down to 99.7% - is it expected that the writer will have a lower buffer cache hit ratio that the reader?

asked 2 years ago1.6K views

1 Answer
0

Hello @AWS-User-8443772

When you first start up the cluster, its buffer cache is empty and will fill up with pages as your workload is queried against the db, the value of BufferCacheHitRatio should be as high as possible (as close to 100% as possible), as reading data from working set memory is faster and more cost-effective than reading from the storage volume. If your indexes do not fit into memory, you will see a lower BufferCacheHitRatio. Continually reading from disk incurs additional I/O costs and is not as performant as reading from memory. You can monitor VolumeReadIOPS to determine if disk is being hit more than expected.

A key rule to remember is that, if you notice an increase in diskIOPS + increase in cost + decrease in the BufferCacheHitRatio and IndexBufferCacheHitRatio, then your best bet is buffer is not being utilized.

As CPU is high and BufferCacheHitRatio doesn't go <99.99%, in order to determine if it is the query's causing the increase in CPU, I recommend enabling performance insights [1] on the cluster, this will allow you to monitor the Vcpu's being utilized by the queries. The profiler log will also assist with determining the execution time for queries [2]. I also added [3] that will assist you in determining the root cause for the increased CPU.

References: [1] Performance insights Documentdb: https://docs.aws.amazon.com/documentdb/latest/developerguide/performance-insights.html

[2] Profiling Documentdb: https://docs.aws.amazon.com/documentdb/latest/developerguide/profiling.html

[3] Determining high CPU documentdb: https://docs.amazonaws.cn/en_us/documentdb/latest/developerguide/user_diagnostics.html#user_diagnostics-cpu_utilization

If the Answer is helpful, please click Accept Answer & UPVOTE, this can be beneficial to other community members.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.