I'm not much of a Linux SRE but at $WORK we're consistently seeing customers wit...
Tobin Baker @tobinbaker@discuss.systems
I'm not much of a Linux SRE but at $WORK we're consistently seeing customers with low RSS (relative to RAM) that are getting OOM-killed or going into terminal swap, purely from page cache thrashing. Ultimately the problem is just that the file-page working set is larger than (RAM - RSS), but we want to detect and mitigate page cache saturation before going into swap if possible (by rejecting/removing various forms of work). So I'm trying to find a leading rather than lagging indicator of page cache saturation and so far refault rate (i.e. (workingset_refault_file / pgsteal_file) from /proc/vmstat) is definitely not it (saturates almost instantly without ramp-up). The most promising candidate so far (after a couple hours of research) seems to be turnover time, i.e. the smallest time t after which everything cached at t=0 has been evicted. This can be estimated incrementally as (# cached file pages) / (Δpgsteal_file / Δt), i.e. the time it would take to evict all cached file pages given the current eviction rate. It seems to ramp up smoothly as the file-page working set expands, unlike refault rate. But it has to be calibrated so you have a workload-normed baseline to compare.
So is turnover time the best leading indicator of page cache saturation? Does anyone here have any experience with this stuff?