From nobody Sun Aug 20 17:10:12 2023 X-Original-To: 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 4RTMYg72xJz4qT04 for ; Sun, 20 Aug 2023 17:10:15 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RTMYf4h4wz4ZDc for ; Sun, 20 Aug 2023 17:10:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20221208 header.b=Z2CC8mO8; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2001:4860:4864:20::33 as permitted sender) smtp.mailfrom=mjguzik@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-1bbb4bde76dso1607269fac.2 for ; Sun, 20 Aug 2023 10:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692551413; x=1693156213; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=MLe0zFUf6jIWOW517J+hi3t4+oeXrxr4nei2bzYFuME=; b=Z2CC8mO84nZm/YKdlsRa4+u3GUVPW5lL/Z2jqGSfdONGYVByqBijr1kTEiTtbeqWyu K6bTwj5ubbpAADxb7GOAHREeQ7es26QewbLjrFI0StbOgHqECz8YxTpYNgF5czydILJg g4YGVLIOly7i8VWKoIPpNw6ugZDPmvBWaNDSBWyXgu5AgtvC1MMDzLdY1mX5drZdzrbi z4njWz3AiHzeBmWJlwyY8Bw1Kfd2AYV1dnzZtYMCRDU2n9vPdFllKNe6nGHibJn0nDjY recwIJO6/abZro36Tvy7AzJzGLttNpGUqyJJNTfAHf3CfUvSM6vsqxoqxt659lw0+YKB hZfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692551413; x=1693156213; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MLe0zFUf6jIWOW517J+hi3t4+oeXrxr4nei2bzYFuME=; b=ik3KSnE8EzgHka6PA1mI/NUvzgBWsrOQc1iqhFL5Eb3OFfvuBDeW5DNBsnMF6IPZbZ IP8f0aZkhZ+wMPB3/ugeQGBj0Vhi1x3BjgPMaR+VrkfsCe7r9lUjJpkj5HKDBRjf8O9h P/jQdPLdlVeCPe9jCNZtrLsYWQpLpSVivJXmfK2kj8rtz9OlWXfnqD1YsywXBTW6qt8F 1kQTuI9+8vdAAyzoekD/k8kNZ6S8OkaS2TjQwvHyvLmT947rYGd17xJevCTq6Lz2GSiQ KDRPsaNYurJAxUBXrSlwSazeC+Avb7lmPHv+cy0Rwc3wFcxGDscfyxgqJN6GsFk3Ynoj SByQ== X-Gm-Message-State: AOJu0YwhkrPWVWcKgxRDDGePLlm/KmveZO9bPiFa0YOm9tWdpRARUvvc qUnfGcf+XF7+5zFoM3GzGPMwZh5wha+vlzhVA4L1BW8cmJQ= X-Google-Smtp-Source: AGHT+IHXPFj3Z7DHJL+ctpEmvrDORGecu73x4CpTrOojDTLCrZhELS2m6LgnNP5KIoJuIttL8MZQ4AsrCNOqXDaX0uM= X-Received: by 2002:a05:6870:210f:b0:1ba:c622:3d5a with SMTP id f15-20020a056870210f00b001bac6223d5amr6181315oae.18.1692551412814; Sun, 20 Aug 2023 10:10:12 -0700 (PDT) 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 Received: by 2002:ac9:79d9:0:b0:4f0:1250:dd51 with HTTP; Sun, 20 Aug 2023 10:10:12 -0700 (PDT) In-Reply-To: <4d60bd12b482e020fd4b186a9ec1a250@Leidinger.net> References: <61ca9df1b15c0e5477ff51196d0ec073@Leidinger.net> <88e837aeb5a65c1f001de2077fb7bcbd@Leidinger.net> <4d60bd12b482e020fd4b186a9ec1a250@Leidinger.net> From: Mateusz Guzik Date: Sun, 20 Aug 2023 19:10:12 +0200 Message-ID: Subject: Re: Speed improvements in ZFS To: Alexander Leidinger Cc: current@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2001:4860:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[current@freebsd.org]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2001:4860:4864::/48, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2001:4860:4864:20::33:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; TO_DN_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[current@freebsd.org]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Spamd-Bar: --- X-Rspamd-Queue-Id: 4RTMYf4h4wz4ZDc On 8/18/23, Alexander Leidinger wrote: > Am 2023-08-16 18:48, schrieb Alexander Leidinger: >> Am 2023-08-15 23:29, schrieb Mateusz Guzik: >>> On 8/15/23, Alexander Leidinger wrote: >>>> Am 2023-08-15 14:41, schrieb Mateusz Guzik: >>>> >>>>> With this in mind can you provide: sysctl kern.maxvnodes >>>>> vfs.wantfreevnodes vfs.freevnodes vfs.vnodes_created vfs.numvnodes >>>>> vfs.recycles_free vfs.recycles >>>> >>>> After a reboot: >>>> kern.maxvnodes: 10485760 >>>> vfs.wantfreevnodes: 2621440 >>>> vfs.freevnodes: 24696 >>>> vfs.vnodes_created: 1658162 >>>> vfs.numvnodes: 173937 >>>> vfs.recycles_free: 0 >>>> vfs.recycles: 0 >> >> New values after one rund of periodic: >> kern.maxvnodes: 10485760 >> vfs.wantfreevnodes: 2621440 >> vfs.freevnodes: 356202 >> vfs.vnodes_created: 427696288 >> vfs.numvnodes: 532620 >> vfs.recycles_free: 20213257 >> vfs.recycles: 0 > > And after the second round which only took 7h this night: > kern.maxvnodes: 10485760 > vfs.wantfreevnodes: 2621440 > vfs.freevnodes: 3071754 > vfs.vnodes_created: 1275963316 > vfs.numvnodes: 3414906 > vfs.recycles_free: 58411371 > vfs.recycles: 0 > >>>>> Meanwhile if there is tons of recycles, you can damage control by >>>>> bumping kern.maxvnodes. >> >> What's the difference between recycles and recycles_free? Does the >> above count as bumping the maxvnodes? > > ^^^^^ > >>>> Looks like there are not much free directly after the reboot. I will >>>> check the values tomorrow after the periodic run again and maybe >>>> increase by 10 or 100 so see if it makes a difference. >>>> >>>>> If this is not the problem you can use dtrace to figure it out. >>>> >>>> dtrace-count on vnlru_read_freevnodes() and vnlru_free_locked()? Or >>>> something else? >>>> >>> >>> I mean checking where find is spending time instead of speculating. >>> >>> There is no productized way to do it so to speak, but the following >>> crapper should be good enough: >> [script] >> >> I will let it run this night. > > I have a 51MB text file, compressed to about 1MB. Are you interested to > get it? > Your problem is not the vnode limit, but nullfs. https://people.freebsd.org/~mjg/netchild-periodic-find.svg First, some of the contention is notorious VI_LOCK in order to do anything. But more importantly the mind-boggling off-cpu time comes from exclusive locking which should not be there to begin with -- as in that xlock in stat should be a slock. Maybe I'm going to look into it later. -- Mateusz Guzik