我正在测试 FS 上的读/写操作,以通过 dd cmd 检查速度。
/app - created with LVM
/app1 - created with parted
当我运行下面的命令时,可以看到使用相同命令的两个操作在速度上存在巨大差异。想知道为什么如果 lvm 和 war 分区的排列方式相似,会出现这样的差异。还是说 lvm 分区比原始分区慢?
[root@xxx~]# dd if=/dev/zero of=/app1/testfile bs=1000M count=1 oflag=direct
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB) copied, 5.27156 s, 199 MB/s
[root@xxx~]# dd if=/dev/zero of=/app1/testfile1 bs=1000M count=10 oflag=direct
10+0 records in
10+0 records out
10485760000 bytes (10 GB) copied, 51.5217 s, 204 MB/s
[root@xxx~]# dd if=/dev/zero of=/app1/testfile2 bs=1000M count=20 oflag=direct
20+0 records in
20+0 records out
20971520000 bytes (21 GB) copied, 102.977 s, 204 MB/s
[root@xxx~]# dd if=/dev/sde1 of=/dev/null bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 2.41581 s, 444 MB/s
[root@xxx~]#
[root@xxx~]# dd if=/dev/sde1 of=/dev/null bs=1G count=10
10+0 records in
10+0 records out
10737418240 bytes (11 GB) copied, 24.4689 s, 439 MB/s
使用 lvm
[root@xxx~]# dd if=/dev/zero of=/app/testfile1 bs=1000M count=1 oflag=direct
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB) copied, 5.24942 s, 200 MB/s
[root@xxx~]# dd if=/dev/zero of=/app/testfile2 bs=1000M count=10 oflag=direct
10+0 records in
10+0 records out
10485760000 bytes (10 GB) copied, 51.4475 s, 204 MB/s
[root@xxx~]# rm -f /app/testfile2 /app/testfile1
[root@xxx~]# dd if=/dev/mapper/vg00-app of=/dev/null bs=1000M count=1
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB) copied, 4.04793 s, 259 MB/s
[root@xxx~]# dd if=/dev/mapper/vg00-app of=/dev/null bs=1000M count=10
10+0 records in
10+0 records out
10485760000 bytes (10 GB) copied, 43.5869 s, 241 MB/s
[root@xxx ~]#