Re: pkg upgrade, vfs.zfs.arc.free_target, vfs.zfs.arc.sys_free, vm.pageout_oom_seq

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sun, 31 Aug 2025 08:38:59 UTC
On Aug 30, 2025, at 09:58, Graham Perrin <grahamperrin@gmail.com> wrote:

> On 30/08/2025 14:50, Mark Millard wrote:
> 
>> … efficient ZFS use. …
> 
> 
> Thanks, I should add that efficiency is not my objective with these tests.
> 
> I'd like the outcomes to include pkg upgrade tips for end users who, for various reasons, find themselves with the benefits of ZFS (not least, bectl for boot environments) on systems that are constrained (e.g. 4 GB memory and limited free space on a HDD).
> 
> I sense that vm.pageout_oom_seq might be the sanest approach, in cases where hardware constraints are relatively severe. I'm open to alternative suggestions.


It would appear that RAM==4GiBytes without SWAP would not be
generally supported by pkg as stands. Testing hw.physmem="4G"
without SWAP . . .

OOM KILLS result:

# pkg upgrade -rFreeBSD-ports -fUy
Checking for upgrades (1485 candidates): 100%
Processing candidates (1485 candidates): 100%
Checking integrity...Child process pid=2219 terminated abnormally: Killed

dmesg -a shows:

pid 2219 (pkg), jid 0, uid 0, was killed: failed to reclaim memory
Aug 31 01:28:47 FBSDamd64S kernel: pid 2219 (pkg), jid 0, uid 0, was killed: failed to reclaim memory

So 4 GiBytyes of RAM is insufficient, even with use of: vm.pageout_oom_seq=120

Note: In this context increases is not going to help: it is way too little RAM
for pkg. (I was observing via top at the time.)

If pkg continues to require such RAM+SWAP usage, FreeBSD is going to end up
requiring more than, say, 5 GiBytes of RAM+SWAP, even for UFS contexts.

> In the past I could be quite careless about untimely interruptions to upgrades ("simply re-run the pkg command, maybe more than once, until it found nothing more to upgrade."). Nowadays there's a greater risk of an awkward problem following an untimely interruption. I don't mind the awkwardness (I know how to dig myself out of a hole); other users might be less forgiving.


For reference, see:

https://lists.freebsd.org/archives/freebsd-pkgbase/2025-August/000804.html

with details of my test context (where swap was in use).

===
Mark Millard
marklmi at yahoo.com