2010-06-09

FreeBSD zfs raidz

環境:P4 3.0GHz、2GB Ram、FreeBSD 8.0R i386、Hitachi 1TB x4

開機啟動 zfs
#echo 'zfs_enable="YES"' >> /etc/rc.conf 
設定參數 (參考 ZFSTuningGuide)
#ee /boot/loader.conf
vm.kmem_size="330M"
vm.kmem_size_max="330M"
vfs.zfs.arc_max="40M"
vfs.zfs.vdev.cache.size="5M"
初始化硬碟 (ad4、ad6、ad8、ad10)
#dd if=/dev/zero of=/dev/ad4 bs=1m count=1 
#fdisk -I /dev/ad4
#glabel label radz11 /dev/ad4s1
建立 raidz pool 並察看
#zpool create tank raidz /dev/label/raidz11 /dev/label/raidz12 /dev/label/raidz13 /dev/label/raidz14 
#zpool status tank
pool: tank
state: ONLINE
scrub: none requested
config:
        NAME               STATE     READ WRITE CKSUM
        tank               ONLINE       0     0     0
         raidz1           ONLINE       0     0     0
            label/raidz11  ONLINE       0     0     0
            label/raidz12  ONLINE       0     0     0
            label/raidz13  ONLINE       0     0     0
            label/raidz14  ONLINE       0     0     0

errors: No known data errors

#df -H
Filesystem     Size    Used   Avail Capacity  Mounted on
tank           2.9T    0B      2.9T  0%           /tank

# zpool list
NAME   SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
tank   3.64T   630K  3.64T     0%    ONLINE  -
建立 mount point
#zfs set mountpoint=/home/dslab/data tank/data
#df -H
Filesystem     Size    Used   Avail Capacity  Mounted on
tank/data      2.9T      0B    2.9T     0%         /home/dslab/data
tank           2.9T      0B    2.9T     0%         /tank
測試讀寫效能
#dd if=/dev/zero of=/home/dslab/data/test bs=1m count=4000
4000+0 records in
4000+0 records out
4194304000 bytes transferred in 108.070644 secs (38810762 bytes/sec)

#dd if=/home/dslab/data/test of=/dev/null bs=1m
4000+0 records in
4000+0 records out
4194304000 bytes transferred in 33.516918 secs (125139907 bytes/sec)

#bonnie -d /home/dslab/data -s 4096 -m zfs
              -------Sequential Output-------- ---Sequential Input-- --Random--
              -Per Char- --Block--- -Rewrite-- -Per Char- --Block--- --Seeks---
Machine    MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU  /sec %CPU
zfs      4096 25813 36.6 33618 17.0 22683 11.5 44180 53.0 81775 15.9 107.6  1.0

結果不是很理想,應該是 cpu 不夠力。

沒有留言:

張貼留言