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 1kIByX-0001Io-S8 for pgsql-general@arkaria.postgresql.org; Tue, 15 Sep 2020 14:30:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kIByV-0003ib-Vs for pgsql-general@arkaria.postgresql.org; Tue, 15 Sep 2020 14:30:27 +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 1kIBha-0004bl-TM for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 14:12:58 +0000 Received: from se14r.web-hosting.com ([198.54.122.238]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIBhY-0001v1-7V for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 14:12:57 +0000 Received: from [104.219.248.236] (helo=server111.web-hosting.com) by se14.registrar-servers.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1kIBhM-0003Q2-Jg for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 07:12:51 -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=HyRbTWNFM78OQouumG3OhRxCnnZp6uvZ8Ma38yGHItY=; b=3mMWmStqbn8sr6UUN3STiDwXSu P9tVp3DxsxD7uYSEuaGYVrwvdRi/beA4SBY26448+zbKwmfsP7JwZIS0CkInHB3U1kOyUsuetOa3h WWM7IUKeazixqrdkifqm0yX8Io7wP1y1CXW/UvP+r1qR0rEiEW+zW5U4/FMpoOB48mhctnbFTGjwl 6edDfWkeTUcLJQHb4/m0mFBMhaoLvOqIEFWEeaU2ISXvcfFUlMwas4ydwVog5W7faZZ687CO4hTwo xEzftdl8mCOxcxSvxFqA71gY5Ui9uAxVwzqzYvytG9dRIwHcBS2lVnoLotkLVgheJjjvntnZr0KoM bazt+hKw==; Received: from [::1] (port=49716 helo=server111.web-hosting.com) by server111.web-hosting.com with esmtpa (Exim 4.93) (envelope-from ) id 1kIBhH-003JBE-Fl for pgsql-general@lists.postgresql.org; Tue, 15 Sep 2020 10:12:43 -0400 MIME-Version: 1.0 Date: Tue, 15 Sep 2020 16:12:39 +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: X-Sender: t@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.30) X-Recommended-Action: accept X-Filter-ID: Mvzo4OR0dZXEDF/gcnlw0Z1apovzGPsYhEeBL1aoZmqpSDasLI4SayDByyq9LIhVGKLpPMfaJpwT TlW+07W9GETNWdUk1Ol2OGx3IfrIJKywOmJyM1qr8uRnWBrbSAGDAdD4JNeNqr51g14D9cdbyj8v kMAm+JsTBBAVVQFzp7c25ZA2TVJLh4qIyFYe7gFLM/lTxGllLDqrdtw6+3/+W1Gavff7/jlq6fkm O4krnmsMJOdCvV7pG+H0SYQW3lmK8I9rYL4U5mJI8Yn79KRIFLh+fEbIKvI565j4thUSyAYK0SAc ATczCYX4pAtNHXCWdlzeqgLHqMHcMQ9hN/g2iTAVHjYntR9elzPavaRCwERBjtYFPuVXfsT0ihIB NX8lKblFPaUJoadjXUaI41VwAd4uBF10rnmczAqV9rXzqijObKENEdo0uBsQ3MTxRgu/pdvDAVQ2 PlgM81+gdKsLDG5912tytXUXegq0bcQnic8bDOdTMnvHqOmP4VxBW3PTCJuKmef1JCbmfgcv6zoJ wFcrwQx3GfeoVZltvRi2yTs5Ix7/C9VwqPH/5QpQnZ0BoT+6/6ngnC3zT5MJtpTZ7L69ywUfK1GF yeI4etqXx2iqrJJ80NVlREkpW4CenvdvASJFC/49WOPBr5nlEUI4xLRHve4p4CvPNI1g05P3BJcS HQXS+Mq90YbKbRNbSlb5V8iKnAw1VsQYaQuT/5njFrUkTpO2BnfbYChvf4AyO5rOEfwWDMSrp8pz Sh0hxEsJ/8iQN0zxJ5cQMCoazTQHTTMBJ7Uc/AwZadNDySZt+jtu+L/CVj5sMDsfsovrf+SvGAcG bH0oHNiNhZs6PeDHH2bjO41FyBEqIaDudcVplPGbHONVD8IDbWUnBaE7Nl6hur+9pZKcOSZ86bGV T6eMrSzINT9sp8+tv1VT+mSJDMTrvTanFN/xNNGn9Vu4ea34/73cIb08xkVb3ZKCv/rl/ny9/Tf2 O4QO0A+0ochIGZ9sgTgg8ES4YHJ6XDsKxitm6YZflXKvK4TN7SfIl4AyWs684QgLjFPOTe/FPj7y TAZwex3yoyNXmDWGgOLq9vyL 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. For that I need to know how much shared memory will be allocated at 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 However, if I only use 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 terms (in the order of 10 megabytes or more) that I need to take into account to get a better result? Regards, tamas