Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1asYkS-0003nn-67 for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Apr 2016 16:43:36 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1asYkR-0002nR-Lp for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Apr 2016 16:43:35 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asYjo-00025r-G3 for pgsql-bugs@postgresql.org; Tue, 19 Apr 2016 16:42:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1asYji-0004px-Cy for pgsql-bugs@postgresql.org; Tue, 19 Apr 2016 16:42:55 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u3JGgl2M015173; Tue, 19 Apr 2016 12:42:47 -0400 From: Tom Lane To: John Lumby cc: pgsql bugs Subject: Re: Re: BUG #14098: misleading message "out of shared memory" when lock table space exhausted In-reply-to: References: <20160418164648.26012.40241@wrigleys.postgresql.org>,<320.1461001031@sss.pgh.pa.us>, Comments: In-reply-to John Lumby message dated "Tue, 19 Apr 2016 10:45:11 -0400" Date: Tue, 19 Apr 2016 12:42:47 -0400 Message-ID: <15172.1461084167@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org John Lumby writes: > Firstly, the documentation (Server Configuration, Lock Management) is very clear : > _____________________________________________________ > max_locks_per_transaction (integer) > The shared lock table tracks locks on > max_locks_per_transaction * (max_connections + max_prepared_transactions) objects (e.g., tables); > hence, *no more* than this many distinct objects can be locked at any one time. You're mistaking a guarantee for a hard limit. What actually happens is that enough shared memory is reserved for at least max_locks_per_transaction * (max_connections + max_prepared_transactions) lock entries, plus a bunch of unrelated stuff, plus some slop. The other uses of shared memory are pretty static, so the end result is that only the lock table is likely to eat up the slop. max_locks_per_transaction is thus more of a floor than a ceiling. I'm not sure if that documentation wording needs improvement or not. Other references to max_locks_per_transaction don't seem to imply that it's an exact bright line, but I can see where if you read only that line in this para and not the rest of the para, you might come away with such a conclusion. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs