Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s839D-009G0n-2h for pgsql-hackers@arkaria.postgresql.org; Fri, 17 May 2024 19:21:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1s839C-00GgTo-RP for pgsql-hackers@arkaria.postgresql.org; Fri, 17 May 2024 19:21:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1s839C-00GgTe-Hs for pgsql-hackers@lists.postgresql.org; Fri, 17 May 2024 19:21:42 +0000 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s8396-000huH-Tj for pgsql-hackers@postgresql.org; Fri, 17 May 2024 19:21:41 +0000 Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-792e6328290so22811785a.0 for ; Fri, 17 May 2024 12:21:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715973696; x=1716578496; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=mGSXuJe9O4oGxn6iUr4ZlN1GUWl5Edcco4VctiijEek=; b=lOgC39LeY1km/wQqmu2X23H9BkvHgCa8M1kMXOyf1QanVTtWm4ewQoCuhabZFtNcxW Ec1VO7lApue+f3xJJiySk13K+FuEnWk4Qo9/CqVzC0MtdhzGf6D5UTQFbB0sRkkhVFqn RAoTcLErOA6kkrLjt3bi02fPix62AZIaVWuNYuV+ASIE9IzH4ug/gwqGKoqtrMfYz488 TtbTTq2pHRuCadNUisCXUOKDudizEigmXcR4rwUJ/sSONAG7xjyMhq8FY6Om+zp+ExwG DLF1VYyRXIVG1MKByNwvLv4pzE5IcE26oOxZ3pkCZDHsqE38qQ93Qo3cG5FPoiIqNp4g cebg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715973696; x=1716578496; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mGSXuJe9O4oGxn6iUr4ZlN1GUWl5Edcco4VctiijEek=; b=I0eSmdUPojAxghHaY5N0MSh9UCmzOMZa2ovX/8Lu3xeyYk82Ixh5nC04nHha9Dshby PJUKWw5gL8mI/cDJqK4WdmX8NMiT9JdFHz+3ifvuVIxBiXeQywkw6yNANbsLiOlrDJDh T+DVPnpc2/cgRh+jujymPvOQ68FqETb/kRT0g8R6TLzViyhugFat9bMFnwuI55+MM5PP N0bugX/EiynBHChZe1cwGL9L+CDRVjqAgmxi4HntKPBytA5GTWbiHRBvOwAWgKuN4Wse ArrwSqD8xEtGh4yk6rl6M/ATGquQ9AFyeTkS6UriDhF0sOck4Ax3MDN/w2EEMMH76juH SNqw== X-Forwarded-Encrypted: i=1; AJvYcCX8fMAyY8mRyDopGvTl7OPujWHA+mydWjQE0f3m+C+iQyGxFeMJL/rtT7WYONNZ/Dr976cHUYx/Y6+1iqSnvvIm3OOHm4xtnFqdW7L6 X-Gm-Message-State: AOJu0YwMROWtrr2qHJ6zZ1B1Zjps9uvhvp0GArTnfbtgL8h5Q7NwlVrQ 2yd0CKqBgEtvMV1gt8luBoRCMweXQVKWyGo5iwPIKryFtbGSMK9Q X-Google-Smtp-Source: AGHT+IFaemvyGqs2Wdj6lVxt63eUEtGhrPHjeI2gdrk0rCb6+k7+NXzGClLd3G1dYggtQR5NZOVHFg== X-Received: by 2002:a05:620a:22b2:b0:792:c13e:2996 with SMTP id af79cd13be357-792c758fff3mr2013941485a.29.1715973695824; Fri, 17 May 2024 12:21:35 -0700 (PDT) Received: from nathanxps13 ([157.185.103.226]) by smtp.gmail.com with ESMTPSA id af79cd13be357-792bf33f1a5sm919469885a.131.2024.05.17.12.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 12:21:35 -0700 (PDT) Date: Fri, 17 May 2024 14:21:23 -0500 From: Nathan Bossart To: Tom Lane Cc: "Imseih (AWS), Sami" , Justin Pryzby , "pgsql-hackers@postgresql.org" Subject: Re: problems with "Shared Memory and Semaphores" section of docs Message-ID: <20240517192123.GA1933425@nathanxps13> References: <20240517164452.GA1914161@nathanxps13> <2463906.1715965795@sss.pgh.pa.us> <20240517174837.GB1918496@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <20240517174837.GB1918496@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, May 17, 2024 at 12:48:37PM -0500, Nathan Bossart wrote: > On Fri, May 17, 2024 at 01:09:55PM -0400, Tom Lane wrote: >> Nathan Bossart writes: >>> At a bare minimum, we should probably fix the obvious problems, but I >>> wonder if we could simplify this section a bit, too. >> >> Yup. "The definition of insanity is doing the same thing over and >> over and expecting different results." Time to give up on documenting >> these things in such detail. Anybody who really wants to know can >> look at the source code. > > Cool. I'll at least fix the back-branches as-is, but I'll see about > revamping this stuff for v18. Attached is probably the absolute least we should do for the back-branches. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com --sm4nu43k4a2Rpi4c Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-fix-kernel-resources-docs-on-back-branches.patch" From 853104fa59bb1c219f02f71ece0d5106cb6c0588 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Fri, 17 May 2024 14:17:59 -0500 Subject: [PATCH v1 1/1] fix kernel resources docs on back-branches --- doc/src/sgml/runtime.sgml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 6047b8171d..883a849e6f 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -781,13 +781,13 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such SEMMNI Maximum number of semaphore identifiers (i.e., sets) - at least ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 5) / 16) plus room for other applications + at least ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16) plus room for other applications SEMMNS Maximum number of semaphores system-wide - ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 5) / 16) * 17 plus room for other applications + ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16) * 17 plus room for other applications @@ -838,7 +838,8 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such When using System V semaphores, PostgreSQL uses one semaphore per allowed connection (), allowed autovacuum worker process - () and allowed background + (), allowed WAL sender process + (), and allowed background process (), in sets of 16. Each such set will also contain a 17th semaphore which contains a magic @@ -852,7 +853,7 @@ psql: error: connection to server on socket "/tmp/.s.PGSQL.5432" failed: No such linkend="sysvipc-parameters"/>). The parameter SEMMNI determines the limit on the number of semaphore sets that can exist on the system at one time. Hence this parameter must be at - least ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 5) / 16). + least ceil((max_connections + autovacuum_max_workers + max_wal_senders + max_worker_processes + 7) / 16). Lowering the number of allowed connections is a temporary workaround for failures, which are usually confusingly worded No space -- 2.25.1 --sm4nu43k4a2Rpi4c--