Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Direct I/O

Re: Direct I/O

From: <yong321_at_yahoo.com>
Date: 16 May 2005 20:27:30 -0700
Message-ID: <1116300450.608044.285450@o13g2000cwo.googlegroups.com>


ora_l..._at_yahoo.com wrote:
> A question on direct I/O: Does direct IO mean bypassing the Unix
buffer
> cache and going to DB cache directly while IO or does it mean
bypassing
> DB cache and writing/reading from PGA to/from disk?

The first part is correct (although direct I/O doesn't dictate you must go through Oracle buffer cache). The second part is about Oracle direct path read or write; it has nothing to do with DIO.

> When using filesystems in Unix boxes is the cache for file systems
> always allocated? What happens if it turned off.

Since you already know there exists direct I/O technology, you should know the filesystem cache may not be allocated. To be accurate, though, filesystem cache always exists, just a matter of size. There're many exceptions to cause DIO's to fail and conventional, non-direct I/O silently takes place.

> What if we allocate
> more space for FS caching with Oracle? Since oracle does caching
> anyways in DB cache, is it ok to keep the direct I/O on all the time?
> on systems running oracle applications only is it Ok to turn
filesystem
> cache off.

It's generally good practice to give more memory to Oracle buffer cache instead of filesystem page cache, because Oracle knows better how to manage its data blocks. In my own study notes, I have these words: "If your data access pattern is well defined, and if the amount of data can be fully cached in Oracle buffer cache, then DIO is better because the second time (not first time) the same data is accessed, it's fast. If neither condition is met, I'll take the lazy man's approach and let file system intelligently manage it." "When direct I/O is disabled (by default), performance is not quite sensitive to Oracle buffer cache size." That's from a test on queries. DMLs, however, probably favor DIO almost indiscriminately.

With physical memory of today's database servers approaching 100GB, it's becoming more important to evaluate pros and cons of allocating large amounts of memory to Oracle vs. filesystem. (As usual, Jonathan Lewis has extraordinary insight in this issue.) When in doubt, do your own test. In any case, leave some room for filesystem cache, which can be used to minimize the adverse effect of Oracle's failure to cache certain important data blocks.

Yong Huang
yong321ATyahoo.com Received on Mon May 16 2005 - 22:27:30 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US