LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-18-2009, 05:14 PM   #1
srithi
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Rep: Reputation: 0
Difference between using Raw block device with O_DIRECT and Raw Character Device


Hello,

I am running a Sybase Database (version 15.0.3 64-bit) on RHEL 5.3 using LVM Raw Block devices. Basically, Sybase would open the devices using O_DIRECT. I also tried mapping the same Block devices to raw devices (/dev/raw/rawN) and did a database load test to compare the IO speed between Block device with O_DIRECT and raw devices. Noticed that the raw character device database load was faster than the block device with DirectIO. Even though, I used the same set of devices, not sure why there is a difference in IO speed. Will the Linux kernel use different drivers for Block Devices opened with O_DIRECT and Raw character devices? Any suggestions would be greatly appreciated.

Thanks
 
Old 08-19-2009, 10:52 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I can't give details but O_DIRECT and raw are certainly two different things. We've run Oracle RAC on OCFS (Oracle Cluster Filesystem) which uses O_DIRECT on RHEL3 and on ASM on raw devices on RHEL5.

Performance isn't necessarily the biggest concern however. According to later documentation raw devices are deprecated in Linux and may be removed completely in future versions of the kernel. I chose ASM on raw for my RHEL5 install or RAC because most of their documentation was written for RHEL4. It wasn't until I ran across an OCFS2 (which also does O_DIRECT) that I found a suggestion from Oracle to use that instead of ASM on raw because of the deprecation.

I'm not sure why the kernel team feels O_DIRECT is better than raw to the point they'd actually think about taking the latter option away.

By the way - in the above the O_DIRECT is on OCFS filesystems rather than simply on the block devices. I wonder if Sybase has an equivalent filesystem (or even uses the open source OCFS2) that somehow optimizes use of O_DIRECT?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Character/Raw Device Files SBN Linux - General 1 05-18-2008 04:48 PM
writing raw data to a block device nacio Linux - Software 4 05-17-2007 10:37 PM
Difference between Block device and Character device quartslove Fedora 2 11-29-2006 08:50 PM
find hex patterns in raw hdd block device dtimms Linux - Software 6 01-04-2006 05:52 AM
block device raw access rvilarl Programming 0 10-24-2004 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration