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 1lAVd5-0007TK-Sl for pgsql-general@arkaria.postgresql.org; Fri, 12 Feb 2021 10:24:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lAVd4-0003eS-CO for pgsql-general@arkaria.postgresql.org; Fri, 12 Feb 2021 10:24:50 +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 1lAVd4-0003eL-4f for pgsql-general@lists.postgresql.org; Fri, 12 Feb 2021 10:24:50 +0000 Received: from ms-10.1blu.de ([178.254.4.101]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lAVcx-00042w-BY for pgsql-general@lists.postgresql.org; Fri, 12 Feb 2021 10:24:49 +0000 Received: from [188.174.51.246] (helo=c720-r368166.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAVct-0002zi-SF for pgsql-general@lists.postgresql.org; Fri, 12 Feb 2021 11:24:40 +0100 Received: from c720-r368166.fritz.box (localhost [127.0.0.1]) by c720-r368166.unixarea.de (8.16.1/8.14.9) with ESMTPS id 11CAOc7S001589 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Fri, 12 Feb 2021 11:24:38 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by c720-r368166.fritz.box (8.16.1/8.14.9/Submit) id 11CAObBq001588 for pgsql-general@lists.postgresql.org; Fri, 12 Feb 2021 11:24:37 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: c720-r368166.fritz.box: guru set sender to guru@unixarea.de using -f Date: Fri, 12 Feb 2021 11:24:37 +0100 From: Matthias Apitz To: pgsql-general@lists.postgresql.org Subject: kernel.shmmax and kernel.shmall for Linux server Message-ID: Reply-To: Matthias Apitz MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Operating-System: FreeBSD 13.0-CURRENT r368166 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 188.174.51.246 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, I've read the doc https://www.postgresql.org/docs/13/kernel-resources.html but I'm still relatively clueless, what to set. For example for our standard installations like - RAM: 32 GByte - one PostgreSQL 13.1 server - one database with ~400 tables, 4 GByte in size - 100-200 connecting PostgreSQL-clients (C/C++ application servers, single threaded, for interactive usage) The above document says, the Linux default values are good enough, but they're: # /usr/sbin/sysctl kernel | grep shm kernel.shm_next_id = -1 kernel.shm_rmid_forced = 0 kernel.shmall = 1152921504606846720 kernel.shmmax = 18446744073709551615 kernel.shmmni = 4096 The values are coming from # cat /boot/sysctl.conf-5.3.18-24.46-default ... kernel.shmmax = 0xffffffffffffffff # SHMALL = SHMMAX/PAGE_SIZE*(SHMMNI/16) kernel.shmall = 0x0fffffffffffff00 Any hints for real values? matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub