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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Filesystem for Linux production database server?

Re: Filesystem for Linux production database server?

From: Mladen Gogala <mgogala_at_adelphia.net>
Date: Wed, 02 Jul 2003 16:43:55 -0700
Message-ID: <F001.005C2DCD.20030702163420@fatcity.com>


On 2003.07.02 05:10, Craig I. Hagan wrote: > Linux file systems usually do not support direct I/O (bypassing the buffer > cache), which means that you're going to have double caching with almost This is no longer the case. Look at the O_DIRECT open option, which can be used
with oracle. Make sure that your distribution has support for it.

I'm running RH 8.0 with the latest version of the 2.20 kernel. O_DIRECT flag is supported as of 2.4.10 but it is dependent on the file system. Each file system has it's own implementation of the "open" system call and most of the filesystems simply ignore the O_DIRECT specification. If you open a file with O_DIRECT, you should record much greater disk I/O activity by using "sar -d" then without it. Also, the program without O_DIRECT should execute much slower because it shouldn't go through cache. The two programs are attached to this message, the difference is only in O_DIRECT flag. You can see for yourself that ext3 completely ignores O_DIRECT flag. My suspicion is that only OCFS is using O_DIRECT on linux. Here are results of my tests: $ time test1
Repetitions:50000

    6.30s real 0.00s user 1.41s system $
$ time test1
Repetitions:50000

    6.30s real 0.01s user 1.31s system $ time test2
Repetitions:50000

    6.37s real 0.02s user 1.48s system $ time test2
Repetitions:50000

    6.32s real 0.00s user 1.38s system $

O_DIRECT has always been tied to file system. Some honored it, most of them have simply ignored it. JFS on AIX honors it and I hoped that it does so on Linux as well. As for XFS, I must say that (and I am a former SGI user and a life-long admirer) I don't know anybody using it.

--
Mladen Gogala
Oracle DBA#define _GNU_SOURCE

#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <errno.h>
main() { int fd=-1,count=0,rep=0; char buff[8192]; fd=open("/tmp/tttt",O_RDONLY|O_DIRECT); if (fd == -1) { fprintf(stderr,"Error:%s\n",strerror(errno)); exit(errno); } while ((count=read(fd,buff,8192)) > 0) rep++; printf("Repetitions:%d\n",rep); }
#define _GNU_SOURCE
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <errno.h>
main() { int fd=-1,count=0,rep=0; char buff[8192]; fd=open("/tmp/tttt",O_RDONLY); if (fd == -1) { fprintf(stderr,"Error:%s\n",strerror(errno)); exit(errno); } while ((count=read(fd,buff,8192)) > 0) rep++; printf("Repetitions:%d\n",rep); }
Received on Wed Jul 02 2003 - 18:43:55 CDT

Original text of this message

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