NetBSD Problem Report #57243

From www@netbsd.org  Thu Feb 23 22:46:37 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 942691A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 23 Feb 2023 22:46:37 +0000 (UTC)
Message-Id: <20230223224636.293001A923B@mollari.NetBSD.org>
Date: Thu, 23 Feb 2023 22:46:36 +0000 (UTC)
From: nervoso@k1.com.br
Reply-To: nervoso@k1.com.br
To: gnats-bugs@NetBSD.org
Subject: zfs system consumes all memory in pools, the system turns slow due to page in/out
X-Send-Pr-Version: www-1.0

>Number:         57243
>Category:       kern
>Synopsis:       zfs system consumes all memory in pools, the system turns slow due to page in/out
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 23 22:50:00 +0000 2023
>Originator:     sergio lenzi
>Release:        10.0_BETA
>Organization:
k1 sistemas
>Environment:
NetBSD zfs2.lenzicasa 10.0_BETA NetBSD 10.0_BETA (GENERIC) #1: Sat Jan 28 01:36:58 -03 2023  NetBSD@w320.lenzicasa:/home/NetBSD/BUILD/10/amd64/OBJ/sys/arch/amd64/compile/GENERIC amd64
>Description:
the system runs ZFS using a small ufs partition as boot, the rest is munted by zfs itsself using the /etc/zfs/zpool.cache that runs just after devpubd.. the system runs fine with high load for several days on a 128GB of memory... 16 cores machine...
The problem arises some days later, as the pool as seen in top(1) increases and end up consumming all physical memory available... 
in a machine with 16GB it takes 2 days...  a vmstat -m points to lots of zio-data-bufNN zip-buffNN.
The zpool is configured with primarycache=all secondarycache=all  if
changed to primarycache=metadata, secondarycache=metadata the system runs but is very slow due to disk access without cache... 
Could not find a way to limit pool use... can someone point me how?
>How-To-Repeat:
install NetBSD using zfs... use the system for some days, it becomes slow due to page/in page/out because all memory available id used by pools you can see it using top(1)
>Fix:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.