3776136 KB are free for other applications. Don't get confused by the first line which shows that 28160KB are
free! Note that most of the memory used is for buffers and cache since Linux always tries to use RAM to the
fullest extent to speed up disk operations. Using available memory for buffers (file system metadata) and cache
(pages containing contents of files or block devices) helps the system to run faster because disk information is
already in memory, thereby reducing I/O. If space is needed by programs or applications such as Oracle, then
Linux will free the necessary buffers and cache to yield memory for the applications. Typically, if the system
has been up for an extended period, a small number can be observed under the "free" column on the first line.
Tuning Page Cache
Page Cache is a disk cache which holds data of files and executable programs, e.g. pages with actual contents of
files or block devices. Page Cache (disk cache) is used to reduce the number of disk reads.
The Page Cache in Red Hat Enterprise Linux 5 is dynamically adjusted. You can adjust the minimum free
pages using
# echo 1024 > /proc/sys/vm/min_free_kbytes
Again to make the change permanent, add the following line to the file /etc/sysctl.conf:
# echo vm.min_free_kbytes=1024 >> /etc/sysctl.conf
The easiest way to tune when to start reclaiming Page Cache pages is to adjust the swappiness percentage. The
default value of /proc/sys/vm/swappiness is 60 which means that applications that are not actively oc-
cupying CPU cycles can be swapped out. Higher values will provide more I/O cache and lower values will wait
longer to swap out idle applications.
In general, swapping out unused pages allows thesystem to be more efficient but it is not always good for
database servers. An Oracle database server typically uses a big cache of its own, in which case swapping pages
may be detrimental. The optimal solution for Oracle database servers is to configure Linux Huge Pages and al-
low Oracle processes to use them for internal caching. Huge pages are not used as a system Page Cache so
Linux and Oracle caching algorithms do not interfere.
Linux usually flushes the page cache using pdflush kernel threads. At any given time, 2 to 8 pdflush threads are
running on the system. You can monitor active threads by monitoring
/proc/sys/vm/nr_pdflush_threads. Whenever all existing pdflush threads are busy for at least one
second, an additional pdflush thread is spawned. The new ones try to write back data to device queues that are
not congested, the goal being each active device has its own thread flushing data to that device. Each time a sec-
ond has passed without any pdflush activity, one of the threads is removed.
Exactly what each pdflush thread does is controlled by a series of parameters in /proc/sys/vm:
dirty_writeback_centisecs (default 500): In hundredths of second, this is how often pdflush wakes up to write
data to disk. The default wakes up pdflush every five seconds.
It may be beneficial to decrease this parameter on systems with lots of memory and active writing processes.
The smaller value will make pdflush threads more aggressive in cleaning dirty pages. The kernel implements
some rules to prevent write congestion. It limits the number of pages that can be flushed at once and may skip
one second between pdflush activations if the threads are too busy. It does not make sense to set this parameter
10 | www.redhat.com