From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4ED29ECAAD5 for ; Tue, 6 Sep 2022 13:00:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238052AbiIFNAN (ORCPT ); Tue, 6 Sep 2022 09:00:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239522AbiIFNAN (ORCPT ); Tue, 6 Sep 2022 09:00:13 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0A712091 for ; Tue, 6 Sep 2022 06:00:12 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id CD4A24298; Tue, 6 Sep 2022 09:00:11 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org CD4A24298 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1662469211; bh=IJOyuF6urIA6S6GGr4y8z0q8js5tsULVoh3/SfaEaSY=; h=Date:To:Cc:Subject:References:In-Reply-To:From:From; b=kNcNYgo7B+SXT9G7UVRk1GlHKzArqu5Vjktjh71Hh8dLTgJIjtVd66yfQDzW61AHV X81eS/BgDSKN7vROipE7CUoNfQH7BEntXM6/wqHhs3kFAB4gff+GmFwrzQl/lNAaok tKYDFLQaDbbpGdx9Fmk4u+UjD23dnxAHlrBLQjFg= Date: Tue, 6 Sep 2022 09:00:11 -0400 To: dai.ngo@oracle.com Cc: Chuck Lever III , Jeff Layton , Linux NFS Mailing List , steved@redhat.com Subject: Re: [PATCH v4 2/2] NFSD: add shrinker to reap courtesy clients on low memory condition Message-ID: <20220906130011.GB25323@fieldses.org> References: <2df6f1fe-c8eb-d5a1-0a11-2fd965555a33@oracle.com> <7041D47D-ECB3-497E-9174-96E9E36FFBDE@oracle.com> <3CD64E7F-8E81-4B37-AAF3-499B47B25D19@oracle.com> <44A716C4-3904-424D-A5D6-CE46FC9145F0@oracle.com> <2b9549f8-58ec-be8a-1b15-3a6d7751a04f@oracle.com> <5B4E5FAA-5D46-4E43-962D-64AFDC035C41@oracle.com> <1f395e2b-695f-836f-2038-6a672c651d53@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1f395e2b-695f-836f-2038-6a672c651d53@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Sat, Sep 03, 2022 at 10:59:17AM -0700, dai.ngo@oracle.com wrote: > On 9/3/22 10:29 AM, Chuck Lever III wrote: > >What I was suggesting was a longer term strategy for improving the > >laundromat. In order to scale well in the number of clients, it > >needs to schedule client expiry and deletion without serializing. > > > >(ie, the laundromat itself can identify a set of clients to clean, > >but then it should pass that list to other workers so it can run > >again as soon as it needs to -- and that also means it can use more > >than just one CPU at a time to do its work). > > I see. Currently on my lowly 1-CPU VM it takes about ~35 secs to > destroy 128 clients, each with only few states (generated by pynfs's > CID5 test). We can improve on this. Careful--it's not the CPU that's the issue, it's waiting for disk. If you're on a hard drive, for example, it's going to take at least one seek (probably at least 10ms) to expire a single client, so you're never going to destroy more than 100 per second. That's what you need to parallelize. See item 3 from https://lore.kernel.org/linux-nfs/20220523154026.GD24163@fieldses.org/ Also, looks like current nfs-utils is still doing 3 commits per expiry. Steve, for some reason I think "nfsdcld: use WAL journal for faster commits" never got applied: https://lore.kernel.org/linux-nfs/20220104222445.GF12040@fieldses.org/ --b.