Solaris,ZFSでいろいろ試してます

ZFSでは、mirror(RAID-1相当)、raidz(RAID-5相当)、raidz2(RAID-6相当)
を使うことができますが、striping(RAID-0)の指定する方法がありません。
それはUSBメモリ2本での速度計測でも書きましたが、自動的にストライピングで
動作するからです。それについて検証します。

まずUSBメモリ1本でzpoolを作り、そこに512MBのファイルを書きます。
# zpool create usbpool c20t0d0
# zpool list usbpool
NAME      SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
usbpool  1.86G  74.5K  1.86G     0%  ONLINE  -
# mkfile 512m /usbpool/file1
# ls -la /usbpool
total 524370
drwxr-xr-x   2 root            3 Jan 25 23:15 ./
drwxr-xr-x  25 root           27 Jan 25 23:14 ../
-rw------T   1 root     536870912 Jan 25 23:16 file1

この状態で、USBメモリを追加します。umount する必要もなく、オンラインで追加できます。
zpoolの容量は増えます。zpool iostat -v で使用量の違いがわかります。
# zpool add usbpool c21t0d0
# zpool iostat -v usbpool
capacity operations bandwidth
pool used avail read write read write

------ ----- ----- ----- ----- ----- ----- usbpool 1.00G 2.69G 1 12 117K 137K
c20t0d0 739M 1.14G 1 5 60.7K 65.1K c21t0d0 285M 1.55G 0 7 56.6K 71.9K

------ ----- ----- ----- ----- ----- -----
キャッシュをクリアするため、一旦export/import してから、読み込みの速度を計測します。
# zpool export usbpool
# zpool import usbpool
# /usr/gnu/bin/dd if=/usbpool/file1 of=/dev/null bs=1024k
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 24.4675 s, 21.9 MB/s

片側からしか読めないので20MB/s程度です。読み込み中にzpool iostatは以下のようになってます。
               capacity     operations    bandwidth
pool         used  avail   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
usbpool     1.00G  2.69G    168      0  21.0M      0
  c20t0d0    739M  1.14G    168      0  21.0M      0
  c21t0d0    285M  1.55G      0      0      0      0
----------  -----  -----  -----  -----  -----  -----

続いてfile2を読み込みます。こちらは2本から読み込めるため、30MB/s超となりました。
# /usr/gnu/bin/dd if=/usbpool/file2 of=/dev/null bs=1024k
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 16.3193 s, 32.9 MB/s
               capacity     operations    bandwidth
pool         used  avail   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
usbpool     1.00G  2.69G    256      0  32.0M      0
  c20t0d0    739M  1.14G    116      0  14.5M      0
  c21t0d0    285M  1.55G    140      0  17.4M      0
----------  -----  -----  -----  -----  -----  -----

1本の時に書き込んだファイルは1本の方にしか書かれてないのでストライピングになりませんが、
2本構成になってからはストライピングになるということになります。
ただし、それぞれの空き容量によっては分散して書く量に差が出ますので、
完全なストライピングにはなりません。

逆に容量の違うデバイスを複数集めても、可能な限りストライピング動作はしてくれます。
(mirrorでも読み込み時はストライピング動作します)
タグ

管理人/副管理人のみ編集できます