Score:4

What are the options to monitoring page cache usage?

gb flag

In essence the Page Cache is a part of Virtual File System (VFS) which main purpose, as you can guess, is improving IO latency of read and write operations.

In computing, a page cache, sometimes also called disk cache, is a transparent cache for the pages originating from a secondary storage device such as a hard disk drive (HDD) or a solid-state drive (SSD).

The operating system keeps a page cache in otherwise unused portions of the main memory (RAM), resulting in quicker access to the contents of cached pages and overall performance improvements.

Based on the above, what are the tools that already exists in order to monitoring the page cache? I wish to monitor usage, hits, and especially the dirty pages.

OS version is RHEL 7.X.

Score:5
pk flag

In /proc/meminfo you have a number of memory parameters for the system. In particular, the relevant values should be Cached: (Memory used by the page cache) and Dirty: (not just those of the page cache)

For a given process, you should look at /proc/$PID/smaps

You can find more information about the different fields on https://www.kernel.org/doc/html/latest/filesystems/proc.html

A simpler solution would be to simply monitor the column cache of free -w, which outputs the memory used by the page cache and slabs.

Score:3
in flag

For RedHat the company offer one solution (I do not have permission to copy it here).

If you are OK to compile and implement from source on your platform you can try one tool named cachestat which is intended to do exactly what you want. But it is for Ubuntu, so you need to build it.

Score:2
ca flag

You can use cachestat and cachetop to show both global and by-process cache hit/miss ratio.

You can easily install them in RHEL 7 by issuing yum install bcc-tools. Among the dependencies you will find the kernel-devel packages, whose headers must match your currently running kernel. If the two tools abort with a message similar to modprobe: FATAL: Module kheaders not found, update your kernel and reboot.

Here you can find other very useful performance tools.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.