[linux-lvm] What's the correct way to do raw I/O on Linux?

Xiaoxiang Liu xiliu at ncsa.uiuc.edu
Tue Aug 21 21:22:21 UTC 2001


Since my last post "Why can't I get more bandwidth by adding more disks?",
I have tried to work out some rawio benchmarking code. I am very
happy to see that the bottleneck is not LVM because I tried iozone on LVM
and the performance is good. But I must know about the low-level
performance so that I still need to face the raw I/O problem.

My steps for raw I/O are:
1. Bind /dev/raw/raw1 with one block device or one LV
2. Open the raw device by using open()
3. read or write the raw device by using read() or write()

At the beginning, I just used sequential I/O and got the problem described
in my previous post: I can't get more bandwidth even I build LV on 8 scsi
disks. Later based on James' suggestions, I tried random I/O on that
MTI RAID with 12 scsi disks but still got the same problem: 4.5MB/s for
one disk and 5.5MB/s for LV on 4 or more disks. I also tried to run 2
processes at the same time but the result was same. It sounds like the
pipe is full for some reasons but I can't figure it out.:(

So I just wonder maybe I didn't make raw I/O correctly. Should I use
open(), read() and write()? Or there are other low-level function calls?
I know some rawio benchmark tools such as iometer for NT and Greg's rawio
for FreeBSD but there is none for Linux. By using iometer I can get 75MB/s
for the same MTI RAID. 

Sorry for the long post and thanks for your patience to read it. I'll
appreciate it if you can give me any suggestions. 


Xiaoxiang  







More information about the linux-lvm mailing list