Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 2024 10:03:09 -0700
From:      Jim Long <freebsd-questions@umpquanet.com>
To:        freebsd-questions@freebsd.org
Subject:   Unable to limit memory consumption with vfs.zfs.arc_max
Message-ID:  <ZjUYzdiz01GgnbX/@sfo.umpquanet.com>

next in thread | raw e-mail | index | archive | help
I have a small server with 16G RAM running
stable/14-n267062-77205dbc1397.

The kernel has been consuming all the RAM, as ARC cache from what I can
see, requiring frequent (daily?) reboots to keep it functional.  The ZFS pool
is not large:

# zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
gauss  3.62T  2.00T  1.63T        -         -     0%    55%  1.00x    ONLINE  -

I'm attempting to limit vfs.zfs.arc_max to 4294967296 (4G) in
/etc/sysctl:

# $FreeBSD$
#
#  This file is read when going to multi-user and its contents piped thru
#  ``sysctl'' to adjust kernel values.  ``man 5 sysctl.conf'' for details.
#

# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0

kern.maxvnodes=1000000
vfs.zfs.arc_max=4294967296

# sysctl vfs.zfs.arc_max
vfs.zfs.arc_max: 4294967296

# top -b
last pid: 39206;  load averages:  0.19,  0.22,  0.18  up 0+20:32:15    09:48:48
83 processes:  1 running, 82 sleeping
CPU:  0.1% user,  0.0% nice,  1.0% system,  0.0% interrupt, 98.9% idle
Mem: 636K Active, 72M Inact, 18M Laundry, 15G Wired, 338M Free
ARC: 14G Total, 9675M MFU, 3801M MRU, 3456K Anon, 79M Header, 279M Other
     678M Compressed, 7943M Uncompressed, 11.71:1 Ratio

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
 1903 root          1  21    0   144M    39M select   0   0:12   0.59% smbd
 1586 root          1  20    0    33M  5400K select   1   0:57   0.00% snmpd
 1812 root          1  20    0   137M    27M select   0   0:06   0.00% smbd
 1956 root          1  20    0   151M    32M select   3   0:04   0.00% smbd
 5779 root          1  20    0   144M    38M select   0   0:04   0.00% smbd
36017 root          1  20    0   145M    40M select   3   0:04   0.00% smbd
 1572 ntpd          1  20    0    23M  1260K select   1   0:03   0.00% ntpd
 1816 root          1  20    0    52M    10M select   3   0:02   0.00% winbindd
 2056 root          1  20    0    24M   848K select   2   0:02   0.00% httpd
 2287 root          1  20    0    24M  1272K select   0   0:02   0.00% httpd
 1612 root          1  68    0    22M  2976K select   0   0:02   0.00% sshd
 1787 root          1  20    0    42M  2312K select   0   0:01   0.00% nmbd
 2047  65529        1  20    0    11M  1208K select   2   0:01   0.00% mathlm
 1517 root          1  20    0    13M  1268K select   3   0:01   0.00% syslogd
 1621 root          1  20    0    19M  1716K select   3   0:01   0.00% sendmail
 1854 root          1  20    0    53M    13M select   3   0:01   0.00% winbindd
 1831 root          1  20    0    19M  1796K select   3   0:01   0.00% sendmail
 2031 root          1  20    0    19M  3236K select   0   0:01   0.00% sendmail

This is showing ARC at 14G, when I'm trying to limit it to 4G.

How can I enforce a limit on how much RAM the ARC cache is allowed to
consume?

Thank you!

Jim




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZjUYzdiz01GgnbX/>