During an interview for a testing position, the interviewer asked which memory performance metrics to focus on in the Linux operating system for performance testing.
Answer:
1.
1. total – Total physical memory
2. used – Used physical memory
3. free – Free memory
4. buffer/cache – Buffer and cache memory
Buffer is a cache for disk data, while cache is a cache for file data.
They are used in both read and write requests.
5. available – Available memory
Available memory includes free memory and reclaimable buffer/cache.
6. fault/s – Page fault count per second
This includes minflt/s – minor page fault count per second, and majflt/s – major page fault count per second.
A page fault occurs when a program accesses a virtual memory page that is not in physical memory, triggering an exception by the memory management unit.
Minor page faults occur when the required memory page is already in physical memory but has not yet been mapped to the current process’s list.
Major page faults occur when the required memory page is not in physical memory and needs to be loaded from disk.
Minor page faults are usually normal and unavoidable.
However, frequent major page faults may indicate insufficient memory or an I/O bottleneck.
Therefore, the key metrics to focus on are:
available memory
majflt/s – Major page fault count per second
Congratulations, you have completed the study of
Linux system memory performance metrics.