From nobody Fri May 03 17:03:09 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VWHF55ryTz5J78G for ; Fri, 3 May 2024 17:03:21 +0000 (UTC) (envelope-from freebsd-questions@umpquanet.com) Received: from sfo.umpquanet.com (sfo.umpquanet.com [104.245.33.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "umpquanet.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VWHF33Tx5z46B8 for ; Fri, 3 May 2024 17:03:19 +0000 (UTC) (envelope-from freebsd-questions@umpquanet.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=umpquanet.com header.s=20231023 header.b=hclkAbp7; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-questions@umpquanet.com designates 104.245.33.249 as permitted sender) smtp.mailfrom=freebsd-questions@umpquanet.com Received: from sfo.umpquanet.com (localhost [127.0.0.1]) by sfo.umpquanet.com (8.16.1/8.16.1) with ESMTPS id 443H399f020818 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Fri, 3 May 2024 10:03:11 -0700 (PDT) (envelope-from freebsd-questions@umpquanet.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=umpquanet.com; s=20231023; t=1714755791; bh=wTd1lVJJMhxRAh852BeKSnKzE3l3KKpQALhJOoWvpIs=; h=Date:From:To:Subject; b=hclkAbp7abuTRUhghKhUAzLXVGSQ3RXiRMrW8ixmY4m23UZ7a8dGRygS9uZO3ILjJ N/QJuiYVrEdp9uF5ZK1HCspQEqqYqeSkvygEaTrhVGmolTyCGTyIRK1I2TjVRj0uUx 8+QSafrgXs4+noBGLz1q47Sn9IdzysFvAx/+IhX/xSrwym9PB1lPPbh7k3E/jKLg6Y vIlC7NhZ7CMYKTSA/yAW2P3fYqj/i5Hl3Z+wQotOYWnpQjxDiCsxXYYxENNEdeTQkY ey6+BNUEkqMkDMvM8m9slsb2PHPD5bMyIuEOCWOhzlQOrrcQ6YldA4WgVMmBl72aA2 lV93BO00XX/kg== Received: (from james@localhost) by sfo.umpquanet.com (8.16.1/8.16.1/Submit) id 443H39D4020817 for freebsd-questions@freebsd.org; Fri, 3 May 2024 10:03:09 -0700 (PDT) (envelope-from freebsd-questions@umpquanet.com) X-Authentication-Warning: sfo.umpquanet.com: james set sender to freebsd-questions@umpquanet.com using -f Date: Fri, 3 May 2024 10:03:09 -0700 From: Jim Long To: freebsd-questions@freebsd.org Subject: Unable to limit memory consumption with vfs.zfs.arc_max Message-ID: List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.49 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.991]; R_DKIM_ALLOW(-0.20)[umpquanet.com:s=20231023]; R_SPF_ALLOW(-0.20)[+a]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:6364, ipnet:104.245.32.0/23, country:US]; DMARC_NA(0.00)[umpquanet.com]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; HAS_XAW(0.00)[]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[umpquanet.com:+] X-Rspamd-Queue-Id: 4VWHF33Tx5z46B8 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