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: os io unit , db block size relation

Re: os io unit , db block size relation

From: Yong Huang <yong321_at_yahoo.com>
Date: 16 Sep 2004 09:10:41 -0700
Message-ID: <b3cb12d6.0409160810.40979366@posting.google.com>


hopehope_123_at_yahoo.com (utkanbir) wrote in message news:<f6c90ebe.0409142332.2f64673d_at_posting.google.com>... ...
> [oracle_at_tanidw1 tolga]$ time strace -T dd
> if=/oracle/ett/data/current/tanduyurus
> ure.txt of=/dev/null bs=10485760 count=5
>
> Here i try to read 5 10MB. blocks from a file which is stored in ext3
> file system.The file system is also part of raid10 array which is EMC
> . We use 960kb. of stripe size and have one io channel.
>
> Before running this command , i execute iostat -x /dev/sdm1 20 on
> another terminal .
>
> Here is the strace output :
>
> read(0, "DUYURU_KOD|UYE_ISYERI_KOD|SUBE_K"..., 10485760) = 10485760
> <0.594360>
> write(1, "DUYURU_KOD|UYE_ISYERI_KOD|SUBE_K"..., 10485760) = 10485760
> <0.000008>
> read(0, "42\n3133|2|33|485|20040914000000|"..., 10485760) = 10485760
> <0.409270>
> write(1, "42\n3133|2|33|485|20040914000000|"..., 10485760) = 10485760
> <0.000012>

...
> munmap(0x2000000000308000, 10534912) = 0 <0.000611>
>
> real 0m3.075s
> user 0m0.006s
> sys 0m0.088s
>
> And , iostat values :
>
> avg-cpu: %user %nice %sys %idle
> 253.93 0.00 12.25 757.83
>
> Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz
> await svctm %util
> sdm1 590.70 0.05 100.05 0.40 5526.00 3.60 55.05 6.81
> 67.80 1.51 15.53
>
>
> It is clear that the dd command reads 50MB. I want to see this in
> iostat command :
>
> iostat says 5526.00 sectors are read. So this is 2763 KB.
> (5526*521bytes )
>
> I dont know which part i missed? (May be i forgot the simple math !)
>
> And , iostat says , the system makes 100 read calls per second . This
> is 55 sectors per read . This 100 read call is not what i issued.
> Since strace output shows read function calls , i consider the os
> counts the number of this read calls as io but i think it is not
> correct. What exactly does iostat count as read call?

As Fabrizio says, your I/O may be logical. Why not unmount the filesystem, remount it and then try your strace dd and iostat again? /oracle/ett/data/current/tanduyurus is on /dev/sdm1, isn't it?

Your math is slightly off. iostat says 5526 sectors per second. Your read lasts 3.075 s. So the total bytes read physically are about 8500 KB, not 2763 KB.

If I remember correctly (Fabrizio may correct me), iostat reads or sar -d (which lumps reads and writes together) record the driver read calls, not necessarily syscall read() calls. I.e., if read() needs more than the driver read can serve at a time (10M is definitely larger than that), you see more iostat reads than strace read() syscalls. When you do the test, obviously you need to make sure other processes issue no or few I/O's against /dev/sdm1. Also make sure all I/O's are physical. Then we can get the driver I/O chunk size by 50MB/[number under r/s X total real time], assuming my understanding is correct.

I guess this is not really relevant. But I notice read() shown in strace dd opens file descriptor 0, while read() in strace cat opens a higher number such as 3. It probably doesn't matter, though.

Yong Huang Received on Thu Sep 16 2004 - 11:10:41 CDT

Original text of this message

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