Question: What is the difference between
the UNIX internal page cache and the UNIX Journaled Filesystem (JFS)
cache? Under what circumstances do I turn-off each cache for
Oracle databases? I was under the impression that "raw" I/O
bypasses the JFS, while direct I/O bypasses the internal page cache?
Answer: UNIX has the problem of
duplicate caches, with caching at the disk layer, server layer and
again at the Oracle database layer. Basically UNIX/Linux will
take unused memory and use it to buffer reads and direct I/O
bypasses the internal page cache.
important notes on Oracle physical file caching. Note that
Oracle AIX I/O
is different because Concurrent I/O (CIO) is not available on JFS.
The basic difference between JFS and the internal filesystem
page cache is that the Journaled file system (JFS) is for caching
writes, while the internal filesystem cache caches incoming data
blocks from disk at the OS layer.
Internal file cache (direct I/O):
At disk read time, UNIX/Linux moves the requested
data block into the internal file cache, and again transfers the
file into the Oracle SGA. This double-caching can be
alleviated by using Oracle with
JFS file cache (raw I/O):
The JFS cache is only used for updates, and the Oracle redo logs
should be on a JFS filesystem. Traditionally, moving to a
"raw" device will bypass the JFS buffer and only "external" updated
files such as archived redo logs should always be on JFS because of
the protection for writes.
Col. Garmany notes:
"There is no performance penalty for using a JFS
and JFS only makes small writes a little bit faster. Only UNIX
filesystems support JFS, and raw devices are outside of JFS.
On Linux, ext2 is not a JSF and ext3 is JSF and you can easily
switch between ext2 and ext3 without moving files. Only a test
will show if raw devices are faster than JFS, and many current file
systems are close to the performance of raw. I would recommend
using JFS unless you have a high end array that provides a protected
cache for writes."
Get the Complete
Oracle SQL Tuning Information
The landmark book
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
for 30% off directly from the publisher.