2013/12/24 Benda Xu <[email protected]>:
> 2013/12/24 Qijiang Fan <[email protected]>
>>
>> @heroxbd
>>
>> btrfs 真的很蛋疼啊。。。。
>
>
> What's the I/O bound activity on mir? Is it appending log files?
>
> For these constant updating files, copy-on-write is not efficient. That's
> the price paid for the novel idea. And ZFS is indifferent.
>
>     https://wiki.freebsd.org/ZFSTuningGuide#Application_Issues
>
> Turn off copy-on-write for your log directory and pypi:
>
>
> https://btrfs.wiki.kernel.org/index.php/FAQ#Can_copy-on-write_be_turned_off_for_data_blocks.3F
>

在 mir 上用 dd 测了几次 / 的读写所读,因为已知 btrfs 的 sync 有问题,特意没有加 conv=fsync:

/$ time sudo dd if=/dev/zero of=./zero bs=512k count=1024
1024+0 records in
1024+0 records out
536870912 bytes (537 MB) copied, 0.442638 s, 1.2 GB/s
sudo dd if=/dev/zero of=./zero bs=512k count=1024 user=0.00s
kernel=0.56s wall=0.572
/$ time sudo dd if=/dev/zero of=./zero bs=512k count=1024
1024+0 records in
1024+0 records out
536870912 bytes (537 MB) copied, 0.47787 s, 1.1 GB/s
sudo dd if=/dev/zero of=./zero bs=512k count=1024 user=0.00s
kernel=0.55s wall=0.606

这里看到的数据很正常,但是在 Xen 宿主上的数据(反映实际的 disk IO)很不正常:

--dsk/sda--
 read  writ
  47k  203k
   0     0
  32k 8512k
   0  1628k
   0  2040k
   0  2132k
   0  1828k
   0     0
   0     0
   0  2228k
   0    70M
   0    60M
   0    44M
   0    77M
   0    54M
   0    30M
   0    18M
   0    24M
   0    49M
   0    86M
   0     0
   0     0
   0    28k
   0    16k
   0    36M
   0    32M
   0    92M
   0    40M
  28k 5632k
8192B   12M
   0    21M
  24k   38M
   0   104M
   0    25M
   0    16M
   0    15M
   0    14M
   0    19M
 596k   42M

写操作实际上持续了非常长的时间,而且 throughput 一直都不高,几乎一直没超过 60MB/s。

作为控制组,下面是在 /srv/xvdd 上测试的结果:

/srv/xvdd$ sudo dd if=/dev/zero of=./zero bs=512k count=1024
1024+0 records in
1024+0 records out
536870912 bytes (537 MB) copied, 5.11575 s, 105 MB/s
/srv/xvdd$ sudo dd if=/dev/zero of=./zero bs=512k count=1024
1024+0 records in
1024+0 records out
536870912 bytes (537 MB) copied, 5.13745 s, 105 MB/s

这是 Xen 宿主上的数据:

--dsk/sdd--
 read  writ
 251k 1972k
   0     0
   0     0
   0    79M
   0   103M
   0   118M
   0   115M
4096B  104M
   0  3528k
   0    80k
   0  5440k
   0     0
   0     0
   0    70M
   0   120M
   0   104M
   0   114M
4096B  101M
   0    16M
   0    72k
   0  5248k
   0  5732k^C

throughput 在 100MB/s 以上,这应该是正常的。

rootfs 所在的 xvda 磁盘比 xvdd 繁忙,所以不排除这一因素的影响。

-- 
Regards,
肖骐 Cheer Xiao

-- 

--- 
您收到此邮件是因为您订阅了 Google 网上论坛的“TUNA 主邮件列表”论坛。
要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 [email protected]。
要查看更多选项,请访问 https://groups.google.com/groups/opt_out。

回复