Showing posts with label zfs. Show all posts
Showing posts with label zfs. Show all posts

Wednesday, January 7, 2015

ZFS arc size (ram kullanımı) sınırlandırılması

Platform

ZFSonlinux - OEL 6.5 x86_64

Konfigurasyon

ZFS ayar değişiklikleri için düzenlemeler /etc/modprobe.d/zfs.conf dosyası üzerinde yapılmalıdır.

vi /etc/modprobe.d/zfs.conf

options zfs zfs_arc_max=8589934592

Değişikliğin aktif olması için sistem yeniden başlatılmalıdır.
# reboot

Mevcut ARC size kullanımının gözlemlenmesi

arcstat.py zfsonlinux kurulu sistemlerde bulunmaktadır.
[root@localhost ~]# arcstat.py 1 5
    time  read  miss  miss%  dmis  dm%  pmis  pm%  mmis  mm%  arcsz     c
10:46:52     0     0      0     0    0     0    0     0    0      0  100M
10:46:53     0     0      0     0    0     0    0     0    0      0  100M
10:46:54     0     0      0     0    0     0    0     0    0      0  100M
10:46:55     0     0      0     0    0     0    0     0    0      0  100M
10:46:56     0     0      0     0    0     0    0     0    0      0  100M


Konfigurasyonda kullanılabilecek tüm parametreler

Kullanılabilecek parametreler aşağıda sıralanmıştır. Ayarlarla ilgili değişiklik yapılmadan önce http://docs.oracle.com/cd/E26502_01/html/E29022/chapterzfs-1.html#scrolltoc dökümanından faydalanılmalıdır.
cd /sys/module/zfs/parameters
[root@bursa parameters]# ls -1
l2arc_feed_again
l2arc_feed_min_ms
l2arc_feed_secs
l2arc_headroom
l2arc_headroom_boost
l2arc_nocompress
l2arc_noprefetch
l2arc_norw
l2arc_write_boost
l2arc_write_max
metaslab_debug_load
metaslab_debug_unload
spa_asize_inflation
spa_config_path
zfetch_array_rd_sz
zfetch_block_cap
zfetch_max_streams
zfetch_min_sec_reap
zfs_arc_grow_retry
zfs_arc_max
zfs_arc_memory_throttle_disable
zfs_arc_meta_limit
zfs_arc_meta_prune
zfs_arc_min
zfs_arc_min_prefetch_lifespan
zfs_arc_p_aggressive_disable
zfs_arc_p_dampener_disable
zfs_arc_shrink_shift
zfs_autoimport_disable
zfs_dbuf_state_index
zfs_deadman_enabled
zfs_deadman_synctime_ms
zfs_dedup_prefetch
zfs_delay_min_dirty_percent
zfs_delay_scale
zfs_dirty_data_max
zfs_dirty_data_max_max
zfs_dirty_data_max_max_percent
zfs_dirty_data_max_percent
zfs_dirty_data_sync
zfs_disable_dup_eviction
zfs_expire_snapshot
zfs_flags
zfs_free_min_time_ms
zfs_immediate_write_sz
zfs_mdcomp_disable
zfs_nocacheflush
zfs_nopwrite_enabled
zfs_no_scrub_io
zfs_no_scrub_prefetch
zfs_pd_blks_max
zfs_prefetch_disable
zfs_read_chunk_size
zfs_read_history
zfs_read_history_hits
zfs_recover
zfs_resilver_delay
zfs_resilver_min_time_ms
zfs_scan_idle
zfs_scan_min_time_ms
zfs_scrub_delay
zfs_send_corrupt_data
zfs_sync_pass_deferred_free
zfs_sync_pass_dont_compress
zfs_sync_pass_rewrite
zfs_top_maxinflight
zfs_txg_history
zfs_txg_timeout
zfs_vdev_aggregation_limit
zfs_vdev_async_read_max_active
zfs_vdev_async_read_min_active
zfs_vdev_async_write_active_max_dirty_percent
zfs_vdev_async_write_active_min_dirty_percent
zfs_vdev_async_write_max_active
zfs_vdev_async_write_min_active
zfs_vdev_cache_bshift
zfs_vdev_cache_max
zfs_vdev_cache_size
zfs_vdev_max_active
zfs_vdev_mirror_switch_us
zfs_vdev_read_gap_limit
zfs_vdev_scheduler
zfs_vdev_scrub_max_active
zfs_vdev_scrub_min_active
zfs_vdev_sync_read_max_active
zfs_vdev_sync_read_min_active
zfs_vdev_sync_write_max_active
zfs_vdev_sync_write_min_active
zfs_vdev_write_gap_limit
zfs_zevent_cols
zfs_zevent_console
zfs_zevent_len_max
zil_replay_disable
zil_slog_limit
zio_bulk_flags
zio_delay_max
zio_injection_enabled
zio_requeue_io_start_cut_in_line
zvol_inhibit_dev
zvol_major
zvol_max_discard_blocks
zvol_threads

Saturday, December 20, 2014

Adım adım ZFS operasyonları

zpool komutu ile yeni disk için pool oluşturma

Yeni takılan diski zfs ile kullanmak için pool oluşturulmalıdır.

işlem 1
zpool create tank1 /dev/da3


zfs komutu ile pool içinde mountpoint özelliğini ayarlayarak yeni filesystem oluşturma işlemi aşağıdaki şekilde gerçekleşti.

işlem 2
zfs create -o mountpoint=/opt/output tank1/opt_output
zfs filesystem properties

zfs tercih etmemin en önemli iki nedeni filesystem ekle/çıkar işlemlerini ve ek olarak yarattığınız farklı filesystem'lere ait farklı özellikleri kolayca yönetebilmek.

Örnek olarak mountpoint özelliği ile dosya sistemimizin hangi yola bağlanacağı bilgisini aşağıdaki şekilde değiştirebiliyoruz.

Varsayılan olarak mountpoint /tank1 olarak ayarlandı. Değiştirmek için:

okantest:~# test>  zfs get mountpoint tank1
NAME   PROPERTY    VALUE       SOURCE
tank1  mountpoint  /tank1      default


işlem 3
okantest:~# test>  zfs set mountpoint=/opt/tank1 tank1

filesystem e özel değiştirebileceğiniz özellik listesini
zfs get all tank1

komutu ile alabilirsiniz.

Sık olarak değiştirdiğim zfs dosya sistemi özellikler (zfs filesystem properties ) şunlar:

  •     compression  (on | gzip | gzip-[1-9] | zle | lzjb | off)
  •     mountpoint
  •     quota
  •     recordsize bu değer optimize edilmeli default: 128k


zfs compression test results
Strength&Type    Time    Size    Comments
off/assorted    56.157s    660M   
zle/assorted    58.859s    608M    some gain, small cost
lzjb/assorted    56.919s    490M    fair gain, small cost
on/assorted    58.168s    496M    =lzjb
gzip-1/assorted    69.715s    376M    Significant gains, increased cost
gzip-2/assorted    69.416s    383M   
gzip-3/assorted    71.724s    361M   
gzip-4/assorted    76.042s    367M   
gzip-5/assorted    77.492s    367M   
gzip/assorted    81.487s    359M   
gzip-7/assorted    84.402s    365M   
gzip-8/assorted    88.709s    357M    Not much better than gzip-1, and progressively more expensive, timewise
gzip-9/assorted    93.229s    364M   
              
off/avi    18.700s    344M   
zle/avi    16.497s    324M    Best time, best compression, not sure why
lzjb/avi    18.414s    331M    “free”, with some space savings
on/avi    18.135s    325M    =lzjb
gzip-1/avi    30.593s    336M   
gzip-2/avi    30.714s    335M   
gzip-3/avi    30.043s    335M   
gzip-4/avi    32.278s    344M   
gzip-5/avi    31.652s    338M   
gzip/avi    32.148s    337M   
gzip-7/avi    33.087s    337M   
gzip-8/avi    32.642s    336M   
gzip-9/avi    30.125s    341M   
              
off/mp3    0.280s    7.29M    You can't win if you don't play.
zle/mp3    0.140s    7.20M   
lzjb/mp3    0.139s    7.20M   
on/mp3    0.137s    7.20M   
gzip-1/mp3    0.158s    7.20M   
gzip-2/mp3    0.137s    7.20M   
gzip-3/mp3    0.138s    7.20M   
gzip-4/mp3    0.150s    7.20M   
gzip-5/mp3    0.139s    7.20M   
gzip/mp3    0.141s    7.20M   
gzip-7/mp3    0.150s    7.20M   
gzip-8/mp3    0.139s    7.20M   
gzip-9/mp3    0.164s    7.20M   
              
off/programs    13.422s    240M   
zle/programs    11.731s    245M   
lzjb/programs    08.398s    231M    Second best on time, not bad on compression
on/programs    05.823s    173M    Best time and compression… should equal lzjb
gzip-1/programs    12.386s    207M   
gzip-2/programs    13.223s    214M   
gzip-3/programs    14.091s    222M   
gzip-4/programs    14.833s    219M   
gzip-5/programs    15.788s    222M   
gzip/programs    15.394s    223M   
gzip-7/programs    15.915s    220M   
gzip-8/programs    15.736s    222M   
gzip-9/programs    16.119s    222M   
              
off/text    0.257s    5.31M   
zle/text    0.120s    4.81M   
lzjb/text    0.114s    4.67M   
on/text    0.118s    4.67M   
gzip-1/text    0.137s    4.27M   
gzip-2/text    0.114s    4.25M   
gzip-3/text    0.114s    4.25M   
gzip-4/text    0.125s    4.23M   
gzip-5/text    0.114s    4.23M   
gzip/text    0.125s    4.22M   
gzip-7/text    0.115s    4.22M   
gzip-8/text    0.118s    4.22M   
gzip-9/text    0.124s    4.22M    Best compression, no surprise