Search

Top 60 Oracle Blogs

Recent comments

Sneak Preview of pgio (The SLOB Method for PostgreSQL) Part IV: How To Reduce The Amount of Memory In The Linux Page Cache For Testing Purposes.

I hope these sneak peeks are of interest…

PostgreSQL and Buffered I/O

PostgreSQL uses buffered I/O. If you want to test your storage subsystem capabilities with database physical I/O you have to get the OS page cache “out of the way”–unless you want to load really large test data sets.

Although pgio (the SLOB Method for PostgreSQL) is still in Beta, I’d like to show this example of the tool I provide for users to make a really large RAM system into an effectively smaller RAM system.

Linux Huge Pages

Memory allocated to huge pages is completely cordoned off unless a process allocates some IPC shared memory (shmget(1)).  The pgio kit comes with a simple tools called pgio_reduce_free_memory.sh which leverages this quality of huge pages in order to draw down available memory so that one can test physical I/O with a database size that is quite smaller than the amount of physical memory in the database host.

The following picture shows an example of using pgio_reduce_free_memory.sh to draw set aside 443 gigabytes of available memory so as to leave only 32 gigabytes for OS page cache. As such, one can test a pgio database of, say, 64 gigabytes and generate a tremendous about of physical I/O.

 

pgio1https://kevinclosson.files.wordpress.com/2018/05/pgio1-e1527117316719.pn... 150w, https://kevinclosson.files.wordpress.com/2018/05/pgio1-e1527117316719.pn... 300w, https://kevinclosson.files.wordpress.com/2018/05/pgio1-e1527117316719.pn... 768w, https://kevinclosson.files.wordpress.com/2018/05/pgio1-e1527117316719.png 908w" sizes="(max-width: 500px) 100vw, 500px" />

 

I should think this little tool could be helpful for a lot of testing purposes beyond pgio.