When running the experiment limiting the 6th query of TPC-H on PostgreSQL, we found that the local memory will be 50% application occupation and 50% OS Buffer Cache. I desperately need a tool that can record why the PG needs to double caching either using sysv read/write or mmap scheme.
Two plugins to install
- pg_buffercache: already in the pg contrib extension folder, if you didn't install it, go to the pg_buffercache folder and make sure the pg_config is in the right environment.
- pgfincore: make sure you check out the right branch which 1.2.2 is compatible with PG 9.6
cat
the metrics to csv
I need to record pg_buffered
, pgbuffer_percent
, percent_of_relation
, os_cache_mb
.
in case of double caching
You'll know how the os_cache coaleased with the data in buffer cache, you can follow the [2], to flush it.