Articles in this section

How and when to set read-page-cache to true

Context

The  read-page-cache  configuration directive removes O_DIRECT and O_DSYNC for devices associated with the namespace when reading data. This means that the read data will not only go to asd, but also into the page cache. If the same record gets read again by a subsequent transaction, it will not need to go to the device to get it, but the read will be satisfied from the page cache (memory).  This should improve latency as reading storage device is much slower. The extra copy of data from page cache to asd for the initial read is negligible.


Method

Run this command to  enable read-page-cache  for a namespace:

asinfo -v "set-config:context=namespace;id=namespaceName;read-page-cache=true"

 

If the data is already in memory (data-in-memory true),  then set read-page-cache to true is not very useful.  In general, it is best to test and benchmark the performance for your own specific data pattern.   The “post-write-queue” already benefits  the “immediate read after write” traffic pattern.

 

To enable read-page-cache, it is also best practice to ensure  min-free-kybtes is set accordingly (greater than index-stage-size)  as explained  in this link:

 

https://aerospike.com/docs/database/learn/best-practices/#min_free_kbytes

 

This ensures the OS does not need to drop caches when memory is needed.



 


Notes

* The read-page-cache does not affect the write path.

Applies To Earliest Version

Pre 4.9

Applies To Latest Version

Current Version
Was this article helpful?
0 out of 0 found this helpful