Setting "zfs_arc_max" value in FreeBSD 8.

Alexander Leidinger Alexander at Leidinger.net
Sat Jan 23 09:44:40 UTC 2010


On Fri, 22 Jan 2010 20:28:09 -0500 jhell <jhell at DataIX.net> wrote:


> 
> On Wed, 20 Jan 2010 05:14, Alexander@ wrote:
> > Quoting jhell <jhell at DataIX.net> (from Tue, 19 Jan 2010 09:45:58
> > -0500):
> >
> >> On 1/19/2010 5:16 AM, Sherin George wrote:
> >>> Thanks Ivan :)
> >>> 
> >>> I found It. add following in /boot/loader.conf
> >>> 
> >>> ===================
> >>> vfs.zfs.arc_max="10244M"
> >>> ===================
> >
> >> I just thought I would give a shout at this for stable/7 as of last
> >> week. I am not sure if this is just me but I had tried to adjust
> >> zfs_arc_max and found out that it was unadjusted to my value after
> >> the system came back up.
> >> 
> >> Anyone know if it is adjustable on a system with 1024MB of ram ?
> >> Is this just being auto calculated by some other value ?
> >
> > Can you confirm that you made the modification
> > in /boot/loader.conf, and that you used the double-quotes around
> > the value as shown above?
> >
> > The code in 7-stable regarding this is the same as in 8-stable and
> > 9-current, so if it is done correctly, it has to change accordingly.

> Yes,
> 
> The sysctl in question on my machine is/was put in loader.conf with
> the double quotes.
> 
> Every time I have set this before I was trying to set it to a value
> >= 512M which with the values below must have not been excepted and
> >fell back 
> to 320M.
> 
> If I set this to a value of <= 511M it works fine which leads me to 
> believe this is limited by some other value listed below ?

It can not be bigger than kmem_max. While I do not know if this is
checked, it sounds from your description that it is.

> dmesg:
> real memory  = 1072107520 (1022 MB)
> avail memory = 1035038720 (987 MB)
> 
> loader.conf:
> kern.maxusers="512"	<< Not sure if this has anything to do

It should influence the kmem_max... if you would not change it yourself.

> with it. vfs.zfs.arc_min="80M"
> vfs.zfs.arc_max="512M"	<< This fails. stays at 335544320.

It needs to be a lot less than kmem_max (the arc is allocated from
the kmem, as such it can not exceed kmem_max, and as other parts of
the kernel also need kmem, you need to limit the arc size). On a 32bit
system with 1 GB RAM I have kmem_size_max set to 512M and arc_max set to
160M.

> vm.kmem_size="512M"
> vm.kmem_size_max="512M"	<< Maybe this one.
> kern.ipc.semmni="40"
> kern.ipc.semmns="300"
> kern.maxdsiz="536870912"
> kern.maxfiles="16384"

Bye,
Alexander.


More information about the freebsd-hackers mailing list