Re: LVM write performance
On 08/08/2011 03:33 PM, Stan Hoeppner wrote:
> On 8/8/2011 1:25 AM, Dion Kant wrote:
>> Dear list,
>> When writing to a logical volume (/dev/sys/test) directly through the
>> device, I obtain a slow performance:
>> root@dom0-2:/dev/mapper# dd of=/dev/sys/test if=/dev/zero
>> 4580305+0 records in
>> 4580305+0 records out
>> 2345116160 bytes (2.3 GB) copied, 119.327 s, 19.7 MB/s
>> Making a file system on top of the LV, mounting it and write into a file
>> is ok:
>> root@dom0-2:/dev/mapper# mkfs.xfs /dev/sys/test
>> root@dom0-2:/mnt# mount /dev/sys/test /mnt/lv
>> root@dom0-2:/mnt# dd of=/mnt/lv/out if=/dev/zero
>> 2647510+0 records in
>> 2647510+0 records out
>> 1355525120 bytes (1.4 GB) copied, 11.3235 s, 120 MB/s
>> Furthermore, by accident I noticed that writing directly to the block
>> device is oke when the LV is mounted (of course destroying the file
>> system on it):
>> root@dom0-2:/mnt# dd of=/dev/sys/test if=/dev/zero
>> 3703375+0 records in
>> 3703374+0 records out
>> 1896127488 bytes (1.9 GB) copied, 15.4927 s, 122 MB/s
>> Does anyone know what is going on?
>> The configuration is as follows:
> Yes. You lack knowledge of the Linux storage stack and of the dd
> utility. Your system is fine. You are simply running an improper test,
> and interpreting the results from that test incorrectly.
> Google for more information on the "slow" results you are seeing.
Hmm, Interpreting your answer, this behaviour is what you expect.
However, I think it is a bit strange to find, with this "improper
test", about a factor 10 difference between reading from and writing to
a logical volume by using dd directly on the device file. Note that dd
if=/dev/sys/test of=/dev/null does give disk i/o limited results.
Apparently the Debian kernel behaves differently with respect to this
"issue" from for example an openSUSE kernel, which does give symmetric
(near disk i/o limited) results.
What is the proper way to copy a (large) raw disk image onto a logical
Thanks for your advise to try Google. I already found a couple of posts
from people describing this similar issue, but no proper explanation yet.