Header RSS Feed
If you only want to see the articles of a certain category, please click on the desired category below:
ALL Android Backup BSD Database Hacks Hardware Internet Linux Mail MySQL Monitoring Network Personal PHP Proxy Shell Solaris Unix Virtualization VMware Windows Wyse

Solaris: How to limit ZFS ARC cache maximum size
Friday - Feb 28th 2014 - by - (0 comments)

One of the reasons why ZFS is a fast file system is the use of a file system caching called ARC (Adaptive Replacement Cache), which runs in memory. 

The current size of ARC can be seen with the following command:

kstat -p zfs:0:arcstats:size
zfs:0:arcstats:size     12310432872

At the time of this output, ARC was using 11.4GB.

Although ARC should be intelligent enough to not occupy RAM which is needed by zones or applications, I have seen cases where ARC uses 50% of the total available memory and the other 50% were fully occupied by zones and applications, causing applications (like MySQL) to swap. That's a performance nightmare.

But there's a way to limit the ARC size by setting the value of zfs_arc_max. At the end of /etc/system I added the following lines:

* Limit ZFS Arc
* http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide#Limiting_the_ARC_Cache
set zfs:zfs_arc_max = 21474836480

This means that I have set a maximum limit for the zfs arc to 20GB (21474836480 Bytes).

After a reboot (and RAM-Upgrade at the same time), the memory graph clearly shows that the ARC size (represented by CACHES in the graph) has hit 20GB, but never went above it:

ZFS Arc Cache Memory Graph 


Add a comment

Show form to leave a comment

Comments (newest first):

No comments yet.

Go to Homepage home
Linux Howtos how to's
Monitoring Plugins monitoring plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

6938 Days
until Death of Computers