From nobody Thu Apr 21 16:49:02 2022 X-Original-To: freebsd-current@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 4B20011DCE83 for ; Thu, 21 Apr 2022 16:49:04 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail2.ambrisko.com (mail2.ambrisko.com [70.91.206.91]) by mx1.freebsd.org (Postfix) with ESMTP id 4Kkk5W35x2z3smZ for ; Thu, 21 Apr 2022 16:49:03 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) IronPort-SDR: aanghzseMsgfgaKliHOonJuZdmnhikJLr6IWp1E8L13vPR8h8w+NA0k6IcxXy8WqrLN0E9I8S1 bAwGuAshAp8ex4b1IsBV6fZ5cN1t74IP4= X-Ambrisko-Me: Yes IronPort-Data: A9a23:LRuywKt8iReaoOwfofSwpm5Y+efnVEJeMUV32f8akzHdYApBsoF/q tZmKW6GP62LN2b9fI8nPdi+o09X7JGHm4VqTAZk/npkFHgTpJueD7x1DKtQ0wB+jyHnZBg6h ykmh1WpwPkcFhcwnD/0WlTchSIUOZ+gF+OU5NHsangZqT9MEE/NuDo78wILqtcAbeuRX2thj ejPT/j3YzdJ7dLU3lU8sMpvoDs31Bj7VahxUlYWPZint3eG/5UZ4Q52yQhc8hLFrodo8u6SH 44vzZm4+H/U5REkDpWsl7zhc1YJRfjZOg3mZnh+Avn4xEEc9mprlPxT2Pk0MS+7jx2Amtpry c5OsrS5TA0zP7bPn6IWVBww/yRWYPQcp+SaSZS4mYnJp6HcSFPFx/h+BUc6MJcw/ut2DWBI+ vECbjYAcnirguC53aC6ScFjg80iKI/gO4Z3kn96wDzTFvpjSo3ZWajM+fdWxjo9jNtCW/HEa KIkhZBHBPjbSwZCIEkaEsh4leKinHjkcDoeo1WQzZfbKlP7lGRZuIUB+vKMEjBTbckKzEueu Ezc+GH1XkMTONCFk2PX+3emnO7UniTTUYcYDryj9fksi1qWnzRBBBoTXFq9gP+4lk/uBooGe hBMonIj/foo6UimbtjhRBnk8nSKiQERBohLGOog5QDTlqeNu1SFBnIJRyJqYcA9sJNkXiQj0 1KExou7BTFmvLCPZ2ia87OY8WG7NSQPdzZQbCoOVwoe4N7LqYQ5lBPUTdElG6mw14WnFTb1y jGMjS4/m7RD0JZShvnjpQjK2mv+qILIQwg54hTscliktg4pNpS4Y4GI6ETA6aoSJoiuUVTc7 mMPnNKT7b5SAMjVxjCNWugEAJqg++2BbG/HmVdqEpQsq2at9nqkcdwC6T1yPh0wYMcCZTLzZ kbX/wpU7oVSJ3itK6RwZtvpWcgtyKHhE/XjV+zVPocWO8ktLFff8XE8f1OU0kDsjFMowPM2N pqseMqxCWoXVPZ8xz2sSuZBibImmnIkyWXIScypxhiry+DGNmWYU6kIKgHIZ+Uz9qKfowKT+ NFabpPYxxJaWez4Qy/W7Y9DcAhTfCRjXcj7+55Na+qOAgt6A2VwWfbezIQod5Fhg6kIxPzD+ WuwWxMAxVfy7ZEdxd5mtpy3hGvTYKtC IronPort-HdrOrdr: A9a23:52+F2K1rSMbKA+AbE90oHgqjBLIkLtp133Aq2lEZdPWaSK2lfu SV7ZMmPH7P+VIssR4b9exoVJPufZqYz+8S3WBzB8bGYOCFghrKEGgK1+KLqFDd8m/Fh4xgPM xbE5SWZuefMbBL5/yR3DWF Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport2.ambrisko.com with ESMTP; 21 Apr 2022 08:45:34 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.17.1/8.17.1) with ESMTPS id 23LGn27L075125 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 21 Apr 2022 09:49:02 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) X-Authentication-Warning: internal.ambrisko.com: Host localhost [127.0.0.1] claimed to be ambrisko.com Received: (from ambrisko@localhost) by ambrisko.com (8.17.1/8.17.1/Submit) id 23LGn2hU075124; Thu, 21 Apr 2022 09:49:02 -0700 (PDT) (envelope-from ambrisko) Date: Thu, 21 Apr 2022 09:49:02 -0700 From: Doug Ambrisko To: Alexander Leidinger Cc: Mateusz Guzik , freebsd-current@freebsd.org Subject: Re: nullfs and ZFS issues Message-ID: References: <20220420113944.Horde.5qBL80-ikDLIWDIFVJ4VgzX@webmail.leidinger.net> <20220421083310.Horde.r7YT8777_AvGU_6GO1cC90G@webmail.leidinger.net> <20220421154402.Horde.I6m2Om_fxqMtDMUqpiZAxtP@webmail.leidinger.net> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220421154402.Horde.I6m2Om_fxqMtDMUqpiZAxtP@webmail.leidinger.net> X-Rspamd-Queue-Id: 4Kkk5W35x2z3smZ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of ambrisko@ambrisko.com has no SPF policy when checking 70.91.206.91) smtp.mailfrom=ambrisko@ambrisko.com X-Spamd-Result: default: False [-0.48 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.87)[-0.866]; FREEFALL_USER(0.00)[ambrisko]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[ambrisko.com]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(0.39)[0.391]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7922, ipnet:70.88.0.0/14, country:US]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; MID_RHS_MATCH_FROM(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, Apr 21, 2022 at 03:44:02PM +0200, Alexander Leidinger wrote: | Quoting Mateusz Guzik (from Thu, 21 Apr 2022 | 14:50:42 +0200): | | > On 4/21/22, Alexander Leidinger wrote: | >> I tried nocache on a system with a lot of jails which use nullfs, | >> which showed very slow behavior in the daily periodic runs (12h runs | >> in the night after boot, 24h or more in subsequent nights). Now the | >> first nightly run after boot was finished after 4h. | >> | >> What is the benefit of not disabling the cache in nullfs? I would | >> expect zfs (or ufs) to cache the (meta)data anyway. | >> | > | > does the poor performance show up with | > https://people.freebsd.org/~mjg/vnlru_free_pick.diff ? | | I would like to have all the 22 jails run the periodic scripts a | second night in a row before trying this. | | > if the long runs are still there, can you get some profiling from it? | > sysctl -a before and after would be a start. | > | > My guess is that you are the vnode limit and bumping into the 1 second sleep. | | That would explain the behavior I see since I added the last jail | which seems to have crossed a threshold which triggers the slow | behavior. | | Current status (with the 112 nullfs mounts with nocache): | kern.maxvnodes: 10485760 | kern.numvnodes: 3791064 | kern.freevnodes: 3613694 | kern.cache.stats.heldvnodes: 151707 | kern.vnodes_created: 260288639 | | The maxvnodes value is already increased by 10 times compared to the | default value on this system. With the patch, you shouldn't mount with nocache! However, you might want to tune: vfs.zfs.arc.meta_prune vfs.zfs.arc.meta_adjust_restarts Since the code on restart will increment the prune amount by vfs.zfs.arc.meta_prune and submit that amount to the vnode reclaim code. So then it will end up reclaiming a lot of vnodes. The defaults of 10000 * 4096 and submitting it each loop can most of the cache to be freed. With relative small values of them, then the cache didn't shrink to much. Doug A.