Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJpTK-0004aw-5W for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Aug 2021 03:57:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJpTI-0003cV-J1 for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Aug 2021 03:57:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJpTI-0003cM-8u for pgsql-hackers@lists.postgresql.org; Sat, 28 Aug 2021 03:57:32 +0000 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mJpTD-0007zC-7a for pgsql-hackers@postgresql.org; Sat, 28 Aug 2021 03:57:31 +0000 Received: by mail-il1-x132.google.com with SMTP id l10so9285390ilh.8 for ; Fri, 27 Aug 2021 20:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RMEvkWdGlgLtR7AEz47bSu2mX9eKVBCeIR2XQ8dfOok=; b=x7jRFgXe0jYg4GSsXCbrZsdS295ujw9D8/0OQqRN0rLGCb1/OvYzlsKf9iae7L9Jwd hUj+alYM6NPuWvYMI+tuN7PfdRcYdHN98SttT7SM/5M9D1yZIHqEVwtUxcdsuxQzc1p2 hwn41yre5aJnoiyteWbj4hFXg3lSrHpAXMrt9/b6hN2C65KubltZRfQoXL3uJXeRPXVd AFU18n4U9tW5b/+/OyX99OC2gnbU7J+/oCPfdCSvhzp8PXgvTsxnVYYPiojnJ5ntLXfz Ak/qT40H3hk+IvNUkp5OGr7lIEgBXglwrhOEF3bSPsuW9cek2Hn9saLhqPyzUIVzI9Vg hPaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RMEvkWdGlgLtR7AEz47bSu2mX9eKVBCeIR2XQ8dfOok=; b=H4mfEeOTFm3cacPCMSIX8e5rPiLWPYvZRvGvaIFNjn8eKrZ0P7y1ojAAWH1a03/l5E vWTdvvISUDtqYbiod+GsLhsBbMHlvNEZa+nrClmmsN0uTevs28e+WP1p4FBlRuSENcd+ W8YNRK4vu8B/RmJqwb3wxr9Guwv9zHrChCvIdae6WAzf9LIPg+jUnV84DdSB2UQFtpUd OVkEFG2BGHggarSViLjAddNhK/aDaKZglIez1r+X8mj7p1H5bxPHPqivG1Owc0gN69bl nFUwN4VvBUL8br4IJxR/1obnf9q/juTYCN/Z6+7Yc5FLYgJNBKv4GmzRny+W0f6beoiG ZCjQ== X-Gm-Message-State: AOAM532zzwz0FfYyqHCzATvV/be00bLQ/WUo6XH9mLPDl9ZxM6UweWOt 8ZRNhk6Xcik9g4mQMgmFgY5sJT4942wRfA== X-Google-Smtp-Source: ABdhPJwRZfFBzD+t+vEZecO47MCq//QU9G20xASnwRqcXlxURDgtN+Od2p2Lff8Zld6bQK3WXmF//w== X-Received: by 2002:a92:d1c6:: with SMTP id u6mr8578789ilg.263.1630123044637; Fri, 27 Aug 2021 20:57:24 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id n11sm4405413ilq.21.2021.08.27.20.57.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Aug 2021 20:57:24 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 01582800C45; Fri, 27 Aug 2021 22:57:22 -0500 (CDT) Date: Fri, 27 Aug 2021 22:57:22 -0500 From: Justin Pryzby To: Michael Paquier Cc: "Bossart, Nathan" , Andres Freund , Magnus Hagander , Mark Dilger , Don Seiler , pgsql-hackers@postgresql.org Subject: Re: Estimating HugePages Requirements? Message-ID: <20210828035722.GQ26465@telsasoft.com> References: <92BB93C3-1AA8-4548-96F7-062C4AF09182@amazon.com> <20210810034205.r72j5uouynepj4f2@alap3.anarazel.de> <0545F7B3-70C0-4DE8-8C85-EAFE6113B7EE@amazon.com> <20210827184648.d3jbv73pgyccqwkz@alap3.anarazel.de> <071DC95B-4CA8-4D2B-BD24-1A66B3EFFE28@amazon.com> <20210827193813.oqo5lamvyzahs35o@alap3.anarazel.de> <0D1645F3-ADFD-4B2F-9F34-961BDFBB881B@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Aug 28, 2021 at 11:00:11AM +0900, Michael Paquier wrote: > On Fri, Aug 27, 2021 at 08:16:40PM +0000, Bossart, Nathan wrote: > > On 8/27/21, 12:39 PM, "Andres Freund" wrote: > >> One thing I wonder is if this wouldn't better be dealt with in a more generic > >> way. While this is the most problematic runtime computed GUC, it's not the > >> only one. What if we introduced a new shared_memory_size GUC, and made > >> --describe-config output it? Perhaps adding --describe-config=guc-name? > >> > >> I also wonder if we should output the number of hugepages needed instead of > >> the "raw" bytes of shared memory. The whole business about figuring out the > >> huge page size, dividing the shared memory size by that and then rounding up > >> could be removed in that case. Due to huge_page_size it's not even immediately > >> obvious which huge page size one should use... > > > > I like both of these ideas. > > That pretty much looks like -C in concept, isn't it? Except that you > cannot get the actual total shared memory value because we'd do this > operation before loading shared_preload_libraries and miss any amount > asked by extensions. There is a problem similar when attempting to do > postgres -C data_checksums, for example, which would output an > incorrect value even if the cluster has data checksums enabled. Since we don't want to try to allocate the huge pages, and we also don't want to compute based on shared_buffers alone, did anyone consider if pg_controldata is the right place to put this ? It includes a lot of related stuff: max_connections setting: 100 max_worker_processes setting: 8 - (added in 2013: 6bc8ef0b7f1f1df3998745a66e1790e27424aa0c) max_wal_senders setting: 10 max_prepared_xacts setting: 2 max_locks_per_xact setting: 64 I'm not sure if there's any reason these aren't also shown (?) autovacuum_max_workers - added in 2007: e2a186b03 max_predicate_locks_per_xact - added in 2011: dafaa3efb max_logical_replication_workers max_replication_slots -- Justin