How device size affects disk performance in Linux (II)

16 02 2011
I've just noticed that in a virtualized environment, where roundtrips are more expensive, read speed differences between a page-aligned partition and a non page-aligned one are even more noticeable:

Non-aligned partition (size in sectors: (41929649-63)+1=41929587):

none:~# fdisk -l -u /dev/sdb

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 x 512 = 512 bytes
Disk identifier: 0x93dbf2be

Device Boot Start End Blocks Id System
/dev/sdb1 63 41929649 20964793+ 83 Linux

none:~# dd if=/dev/sdb1 of=/dev/null bs=1M count=100 skip=0
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 3.80593 s, 27.6 MB/s

none:~# dd if=/dev/sdb1 of=/dev/null bs=1M count=100 skip=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 3.82304 s, 27.4 MB/s

none:~# dd if=/dev/sdb1 of=/dev/null bs=1M count=100 skip=200
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 3.83713 s, 27.3 MB/s

Page-aligned partition (size in sectors: (41929654-63)+1=41929592) :

none:~# fdisk -l -u /dev/sdb

Disk /dev/sdb: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders, total 41943040 sectors
Units = sectors of 1 x 512 = 512 bytes
Disk identifier: 0x93dbf2be

Device Boot Start End Blocks Id System
/dev/sdb1 63 41929654 20964796 83 Linux


none:~# dd if=/dev/sdb1 of=/dev/null bs=1M count=100 skip=0
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.618494 s, 170 MB/s

none:~# dd if=/dev/sdb1 of=/dev/null bs=1M count=100 skip=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.582423 s, 180 MB/s

none:~# dd if=/dev/sdb1 of=/dev/null bs=1M count=100 skip=200
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.589081 s, 178 MB/s

NOTE: In both tests, the data is cached in the host (so there is no real I/O to disks but traffic through virtualization pipes), but clean in the guest.


Trackbacks


No Trackbacks

Comments

Display comments as (Linear | Threaded)
No comments

Add Comment


Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA