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 1kIBlH-0000kM-Kq for pgsql-general@arkaria.postgresql.org; Tue, 15 Sep 2020 14:16:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kIBlG-0001XE-LU for pgsql-general@arkaria.postgresql.org; Tue, 15 Sep 2020 14:16:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIBjy-0005XN-2E for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 14:15:26 +0000 Received: from se17.registrar-servers.com ([198.54.122.197]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIBjv-00023t-Fk for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 14:15:25 +0000 Received: from [104.219.248.236] (helo=server111.web-hosting.com) by se17.registrar-servers.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1kIBjr-0001KD-Kf for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 07:15:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rblst.info; s=default; h=Content-Transfer-Encoding:Content-Type:Message-ID:Subject:To: From:Date:MIME-Version:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=42Em+u/Dj2a6T8nROWnhRoMkscLoEA/UvuHTQlL8IQg=; b=SdnS/f9Ug7l/EZ6JdIrGbnzY0j z/JPYN4Z8qXjzVdJ++Ujz4Nu68V3ueMAxELr6bKmj1GEeHpxdXtyG0/fIaZYdbnN6vv9GZNEc6ti8 aNvZz3OeiobeamNsA7kbYh4GJc6rKmBF3w2TYl/Ows013Dp/uJpPS+i1Hxpqrb3MVP7YWk+9rXf4v vQKOCVaiS1Fr2UcrDYpIGKY7hKsMcylXx74NA1E2bUwwdaR9tSDeakU9SwAg2vG2OhwObZmuCiYAW P14fVgFq0WGQqSfSAjJcUS/CheJhkOHXKZpaB+ZXsE7ajycPPvmudTgD6ss94EsHp4h1b/dojY1rs Ny0lX0wQ==; Received: from [::1] (port=34302 helo=server111.web-hosting.com) by server111.web-hosting.com with esmtpa (Exim 4.93) (envelope-from ) id 1kIBjm-003M9v-U6 for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 10:15:19 -0400 MIME-Version: 1.0 Date: Tue, 15 Sep 2020 16:15:14 +0200 From: =?UTF-8?Q?R=C3=A9beli-Szab=C3=B3_Tam=C3=A1s?= To: pgsql-general@lists.postgresql.org Subject: How to calculate shared memory size Message-ID: <12b98406e50a52930bb96c8f76b73e1d@rblst.info> X-Sender: pub@rblst.info User-Agent: Roundcube Webmail/1.3.13 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-0.2 X-Originating-IP: 104.219.248.236 X-SpamExperts-Domain: nctest.net X-SpamExperts-Username: whmcalls3 Authentication-Results: registrar-servers.com; auth=pass (login) smtp.auth=whmcalls3@nctest.net X-SpamExperts-Outgoing-Class: unsure X-SpamExperts-Outgoing-Evidence: Combined (0.33) X-Recommended-Action: accept X-Filter-ID: Mvzo4OR0dZXEDF/gcnlw0Z1apovzGPsYhEeBL1aoZmqpSDasLI4SayDByyq9LIhV13h68bh3gMCy tbyfMjdnYkTNWdUk1Ol2OGx3IfrIJKywOmJyM1qr8uRnWBrbSAGDAdD4JNeNqr51g14D9cdbyj8v kMAm+JsTBBAVVQFzp7c25ZA2TVJLh4qIyFYe7gFLHwqcmPNa47J8DA764rlcIVGavff7/jlq6fkm O4krnmsMJOdCvV7pG+H0SYQW3lmK8I9rYL4U5mJI8Yn79KRIFLh+fEbIKvI565j4thUSyAYPi6Xa UJOKbNn2rlkZfIWwdlzeqgLHqMHcMQ9hN/g2iTAVHjYntR9elzPavaRCwERBjtYFPuVXfsT0ihIB NX8lKblFPaUJoadjXUaI41VwAd4uBF10rnmczAqV9rXzqijObKENEdo0uBsQ3MTxRgu///eVDl3X k36Zmn/jgTZmpXC2dTdS3jm0vb29ZmHyAC3dgRj6yrQAuxbFOPSpYqPfmLF0wqTcEF+RrgN98ekF aqAm1sucBto6OIf9sMv/7rhFgwmpUOXPcPeresbPjCmp/q4FRGnCQb9Qjwu36TjWnbR1IoyVcpAX xfUeXJw8PSKZyxi/aFboTUAaA09dklP/aIfVaCHpEB6cFH6WJxE4ZmFi5g0H5jNDv1Jav8Uw/p/Y xq6YoBI2h6HUUROT0PFwrUvPpsYJEag94JbDbRz5jKaz6zGrZuP/KfGJJwGHDNTYf2fmzAoWhY9O l2O+hRepgaLRUXLVjTNroXY0trsynIl5lor9k9n8ALMQHyDRZMgltO7FgSqNCWVvrdiwWVEHiJAn +eFYNWNR8igyp3LxXTwJWw42swm4bO6gacpMpzIq6iENpx+M5CNoLEEOpbajJ6JqtftK0amN/XOh o1zpBV0RyHekDaMQRUjXtcOhnAlwpp/WummZ+0SOkK47Tt1sFdDzDETtPsIzc13Og30NyUQs2SKP /zYlKyZ+ZmMbYmx/atGmSN6m4V7Gg3S4FvW683heaidnoNvgMRgcwPHHWVl9z+cit67n8JcqnAvD LFQIXJ6hPBndYXR3ivc47rje X-Report-Abuse-To: spam@se16.registrar-servers.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello all, I want to do a proper calculation of the number of huge pages needed for PostgreSQL to start. To do that, I need a good approximation of how much shared memory will be requested at server startup. Looking at the shared memory calculation in the source (ipci.c), I can see that two terms stand out: size = add_size(size, BufferShmemSize()); ---> shared_buffers size = add_size(size, XLOGShmemSize()); --> 1/32 * shared_buffers, but max WAL segment size If I use only those two terms ( shared buffers + WAL segment size) for my calculation, the result will be off by a lot, especially with bigger shared buffers (e.g. 32 GB). What are any other major addends (in the order of 10 megabytes or more) that I need to take into account to get a better result? Regards, tamas