From nobody Tue Apr 23 08:37:01 2024 X-Original-To: freebsd-hackers@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 4VNwV254Pfz5Jktl for ; Tue, 23 Apr 2024 08:37:30 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Received: from mailgate.Leidinger.net (mailgate.leidinger.net [IPv6:2a00:1828:2000:313::1:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (P-256) client-digest SHA256) (Client CN "mailgate.leidinger.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VNwV20rRqz45mH; Tue, 23 Apr 2024 08:37:30 +0000 (UTC) (envelope-from Alexander@Leidinger.net) Authentication-Results: mx1.freebsd.org; none List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leidinger.net; s=outgoing-alex; t=1713861437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/UE9oHsref+oVEZ3QeL92GrSsMyUhYDMkeQPH7hAw/k=; b=HhzgvbqQbed84WBRlRHjYp2yi1ENv+AwEf8BFECQDmkr4EHr/TkHPvX5fahPkn9ktBomYR a6C2qqxg+v88d3zDOFFXsmghBnQczT2f0nr4WrUtoaxpLug4310vKO/oMOQl3w9FAFdszY r3s4tNHNgHh1JzfoDV1DN7l4N/sX0AmWNUNyGkMfN65fS2ySlC/26rmxyfH/72Ue+SjOYT TywYOQ2P4O/v/zWoby8MDRX3bV4+IMYRCn+6o3Fn2sXkyctglGDSJfrhOUSy3RInzOUykq 6Yz/vZnKF5oBCm49pyr/B1oEbYA8sdUXEw1U/MGTPsRl/NdEpLpuJwLXlgjV4A== Date: Tue, 23 Apr 2024 10:37:01 +0200 From: Alexander Leidinger To: Alan Somers Cc: Karl Denninger , freebsd-hackers@freebsd.org Subject: Re: Stressing malloc(9) In-Reply-To: References: Message-ID: <2b72c4f749e93dfec08a164d5a664ee3@Leidinger.net> Organization: No organization, this is a private message. Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=_354318f0c1c8e56ac65f3fe01cb4c8cd"; micalg=pgp-sha256 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:34240, ipnet:2a00:1828::/32, country:DE] X-Rspamd-Queue-Id: 4VNwV20rRqz45mH This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --=_354318f0c1c8e56ac65f3fe01cb4c8cd Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed Am 2024-04-23 00:05, schrieb Alan Somers: > On Mon, Apr 22, 2024 at 2:07 PM Karl Denninger > wrote: >> >> On 4/22/2024 12:46, Alan Somers wrote: >> >> When I said "33kiB" I meant "33 pages", or 132 kB. And the solution >> turns out to be very easy. Since I'm using ZFS on top of geli, with >> the default recsize of 128kB, I'll just set >> vfs.zfs.vdev.aggregation_limit to 128 kB. That way geli will never >> need to allocate more than 128kB contiguously. ZFS doesn't even need >> those big allocations to be contiguous; it's just aggregating smaller >> operations to reduce disk IOPs. But aggregating up to 1MB (the >> default) is overkill; any rotating HDD should easily be able to max >> out its consecutive write IOPs with 128kB operation size. I'll add a >> read-only sysctl for g_eli_alloc_sz too. Thanks Mark. >> >> -Alan >> >> Setting this on one of my production machines that uses zfs behind >> geli drops the load average quite materially with zero impact on >> throughput that I can see (thus far.) I will run this for a while but >> it certainly doesn't appear to have any negatives associated with it >> and does appear to improve efficiency quite a bit. > > Great news! Also, FTR I should add that this advice only applies to > people who use HDDs. For SSDs zfs uses a different aggregation limit, > and the default value is already low enough. You basically say, that it is not uncommon to have such large allocations with kernels we ship (even in releases). Wouldn't it make sense to optimize the kernel to handle larger uma allocations? Or do you expect it to be specific to ZFS and it may be more sane to discuss with the OpenZFS developers to reduce this default setting? Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_354318f0c1c8e56ac65f3fe01cb4c8cd Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc; size=833 Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmYnczkACgkQEg2wmwP4 2IZnIhAAk5V4Y5SVbxQf3ackPNLDIvb3/rxDo0+UgYi+3mQKcqAbxv469Jis3JTr fr4b/lO8tBtI19M9uJLRlAkXPjcI3emf78H4wh2YpTTnveJAKuv2wWiNWe/r4J5e MEwIDOfzfY3SCY0wrhwaTMUOWuS4F4paWy1A1lVdYGEhLy3j1TptuP0ddL3D2SJT 5QrpGoLoERZ0EnddeBIEpILPBvNVSUkHT5JWvGfp2bk+Zgc3STR1TjPSTPsknLwv qI6PkCXEN+3Cub1XM2O2uFkLSRr50M1T/pLZX1k76En3PBGKc+LcglFoQ7CM901s y6uN70j3vy6k6lLGfVPcZ96cQ+3aRppUbCh7HV9FcNwkQH5sRUNrQHyloXTFaoXM ghPQVUnAk/JEMTRlbHwSgPr6/0U42OZ9DVVpdWWmzazN/pbU5cYZoBk1jG1R8CDK wKz1kutQbb/M4oenR0MVeky7GyJJdv4/GDcLr7o0rhy1UIIzwdCQAi3le7oKEqSL uApeTR9VSfm2WDem4FXXXZlbm9pOqGwT1waskf+4YTUI92VoOF1I9Z2REtbOdAJe QnSZqwFE00hEVI2/bOr4c8sUouqQLXArIeHi4S7/23O2+gg4BAY1vKtX+f+d+MRN O2X/NTQZINRXcHKN4Ei9LyciV0x02g5ixWYzkuVZBeDlrsAm8k0= =zKch -----END PGP SIGNATURE----- --=_354318f0c1c8e56ac65f3fe01cb4c8cd--