ZFS

From pressy's brainbackup
Revision as of 17:21, 17 December 2012 by WikiSysop (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ZFS

Limit the ARC Cache

To prevent ZFS eating up the whole memory you should limit the size of the ZFS ARC cache. Otherwise you could get a slow performance on applications with huge RAM requirements on freeing up the ZFS cache again.

Setting the ARC Cache

# tail -3 /etc/system
*** ZFS ARC Cache Limitation (10GB)
set zfs:zfs_arc_max=0x280000000
********
# init 6

Limit ARC Cache without reboot

That depends on the solaris version. This one is true for Solairs10u10, not sure for older systems. In this example the cache is set to 10GB, not to eat up my (nice) 512 GB RAM with FS cache...

root@server # mdb -kw
Loading modules: [ unix genunix dtrace specfs ufs sd mpt px md qlc fctl fcp ssd sockfs ip hook neti sctp arp usba nca zfs random sppp cpc crypto fcip logindmux ptm nfs mpt_sas mr_sas ipc isp ]
> arc_stats::print -a arcstat_p.value.ui64 arcstat_c.value.ui64 arcstat_c_max.value.ui64
7054e528 arcstat_p.value.ui64 = 0x3ec5082e00
7054e558 arcstat_c.value.ui64 = 0x7d8a150000
7054e5b8 arcstat_c_max.value.ui64 = 0x7d8a150000
> 7054e528/Z 0x140000000
arc_stats+0x500:0x3ec5082e00            =       0x140000000
> 7054e558/Z 0x280000000
arc_stats+0x530:0x7d8a150000            =       0x280000000
> 7054e5b8/Z 0x280000000
arc_stats+0x590:0x7d8a150000            =       0x280000000
> ::quit
 
root@server # kstat -m zfs | head
module: zfs                             instance: 0
name:   arcstats                        class:    misc
        c                               10737418240
        c_max                           10737418240
        c_min                           67398443008
        crtime                          511.291508
        data_size                       10702071808
        deleted                         3378
        demand_data_hits                0
        demand_data_misses              0
 
#########  decimal view #########
root@server # echo "arc_stats::print -d arcstat_size.value.ui64" | mdb -k
arcstat_size.value.ui64 = 0t10737535816
root@server # echo "10737535816/1024/1024/1024" | bc
10
root@server #  mdb -k
Loading modules: [ unix genunix dtrace specfs ufs sd mpt px md qlc fctl fcp ssd sockfs ip hook neti sctp arp usba nca zfs random sppp cpc crypto fcip logindmux ptm nfs mpt_sas mr_sas ipc isp ]
>  ::memstat
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                    3445179             26915    5%
ZFS File Data             1308485             10222    2%
Anon                     46117794            360295   70%
Exec and libs              163098              1274    0%
Page cache                 583288              4556    1%
Free (cachelist)          1136262              8877    2%
Free (freelist)          13195758            103091   20%
 
Total                    65949864            515233
Physical                 65927716            515060
>