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.96) (envelope-from ) id 1weYUG-004roK-11 for pgsql-general@arkaria.postgresql.org; Tue, 30 Jun 2026 13:26:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1weYUF-008Pvq-0Z for pgsql-general@arkaria.postgresql.org; Tue, 30 Jun 2026 13:26:51 +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.96) (envelope-from ) id 1weGDQ-004NSD-0z for pgsql-general@lists.postgresql.org; Mon, 29 Jun 2026 17:56:16 +0000 Received: from mail-yw1-x112f.google.com ([2607:f8b0:4864:20::112f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1weGDO-00000000nBI-1aJI for pgsql-general@postgresql.org; Mon, 29 Jun 2026 17:56:15 +0000 Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-80b9993928dso39775387b3.0 for ; Mon, 29 Jun 2026 10:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782755773; cv=none; d=google.com; s=arc-20260327; b=tCALSdXvZSl8fJWRrLrD5PkxjdEpMybDPq9G96Koc4nyulXuvFatHO5uJidC1FbIGr +LSLgNXaO9lYod+i/qkpv2OJdkmMejYyZ5JLxFQzis5JLYVFl6/ZQsg0BOZKtmuW2jun h0BbQ6BlEvl+JL1BvS11RBHQ9HgfwjdrHHmT3AczsJUyx4+UhD0TTHLKHQIjZGeZMlza 8YRBe056gVw6qHsGduzTrd2NbKsQR8ASe/iEFdbZ7dlSM2peBRevI8bgVZu9LVkwspUZ B62j8kVI30JBJy2EGqAsMXLgSNL8QYbxPFAsDf4IvAc2PZtIiACQ2f9N2bEJIso2xcY8 2DTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=y0xl0o4iZJvpzjD15qtYnT945MWmbQCLgLLNGcGQvc8=; fh=x9Jmr8+FtiCQKUvo/7/je6SkcsG+V48pI/LmEXQOSec=; b=F10/XX4DD1lJwqsOSrpUmbIdxXg6hIX/Wr9ib+dyMfksOLKVeJOY2OIHp0PUlgZtaq eAVUYgKxqGByfDtZFPqgp1RPOszSwLHGdXqlKEdHQtgnVCMMPIQPpsGhMmkuZELaf20k izCh4H1+xJSaBv+xGh+p1FvM2whJE7JEIG5yB99JdaHIozJUygtxteZ5hzpoulXJS1UB N427qC09sommxFUJBaXNIUxL2ud5o9cx72Ms4FGZYL8WSE8NxxmgGECQAApjhhvaIqJU wSMnBYIsgBSjvr0DrkcJ+WjMBzwRsah4oGF6k3AGBsdTIO7xyCl/GdixaKDwFrrIruiW w5GQ==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782755773; x=1783360573; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=y0xl0o4iZJvpzjD15qtYnT945MWmbQCLgLLNGcGQvc8=; b=avpw4So7xQCdYEnfBh1kJ25ssbA4gmNZ47rQRUPxiT65f4v7Q1QB25bCop3c8KQlQZ Oy4K/AjM4ge2Cdo9o2UFm+xIZ5aa7BZJxC8skxslTS9aPVRbOAWJDrZ6+L+62AdetnfK gzpOPiVwr8GueABrILuoZk37hOdBHcFS0wyLD9PCubSHqkw/8fGQ60hNbu4wEzX7w3HV AW2YoOkAfs0HS5AeogJUyeRieU+OopWzuJDjz4eAVzZ4llcLwICfOCTdQCRN+2i4820D GxOXuGrCx5kG1q4dB/9nRXttmEb76vyq/gnQV/FvdOhMQmS9cew3SOMn2ulROVa8yRuC y9vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782755773; x=1783360573; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=y0xl0o4iZJvpzjD15qtYnT945MWmbQCLgLLNGcGQvc8=; b=Dfsat/vq0+CrGZmW88scMSdaVJKYD7Ibtp0HXGO7ssZJPpmViIEOQd7yZdYOZhvahr 9dSxJLcSdv2UUi6PkzVzanS/JQpXKMbyhVKFRO6kojuTfnt7HMSC0lYl3vOrRm+C6uA2 grCRIOiEvratRkTXTfZ98iup6kI2T9L/nb47A+6eMXvJOHwXIxNy8JEqQZnub3LVKSJY cJY+TYNZ+2CAuwnTjuOUs38b6IqFR5ibJJ1ZR3TEIjxmGTrxTt8XV8RahOdOOi/7EG9M 3l1jdEL4zr0hEyo/MBz3rPETrlMxDZue5vbLnaVtGb45oyshMxIjnkjuMotCc5b4z1or EXWQ== X-Gm-Message-State: AOJu0YwDwLW77232laUv4YHolnhfp5081+SPDbMkMBvTIXhq0hb6FzRq kofnQQQJsZyfw09pq/HlYAFtnvoy54aKDpYolHfaClKDF1R3B1YheUB2+aagAEWlRpe4xvO9VLf 1pOGAzxOG2AwBAxfwEcl8ThN2nCIxGq4+kw== X-Gm-Gg: AfdE7cnLxwHxnyCnwoXMa+jEX7m/C+0Jy28QF40r6M4iwdpO0Mn8rl7Ji2Uw6mZUyXa oCdtcwE8fEu/h9B0m4AYLD5CX0lxruYbw29UsyYDeOq7lnfwcq1NOtqq2EKJHo5zE+k5DqO6Q55 KiTJc8jOBw2R4R2TQCb6tl0hAubTGYl0zV9refXpeOKDfFtHzHNzOfarck3jQa/x2ikil7wDLZD PhlUjdrxP2hAt17ZPhR+scpLPT332exvkufGsP1BWaO8zmlJczNtpxtNJ33vLnkCAY4dnJus9lU Q0FCRAcQnas47Qwii6BkyUkotUbEeurGAohtLDU0 X-Received: by 2002:a05:690c:4b04:b0:80c:317c:bf44 with SMTP id 00721157ae682-810d82dbcf0mr5826537b3.19.1782755773299; Mon, 29 Jun 2026 10:56:13 -0700 (PDT) MIME-Version: 1.0 From: Vivek Gadge Date: Mon, 29 Jun 2026 23:25:59 +0530 X-Gm-Features: AVVi8Cf9Aq3w1WZs0kx2T-ftuNp7aMv18HwFtLfXgzflVzQRekjsJpi4TU0M0Qw Message-ID: Subject: Guidance on Calculating max_locks_per_transaction for a Highly Partitioned Environment To: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="00000000000096bf540655682cf9" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000096bf540655682cf9 Content-Type: text/plain; charset="UTF-8" Hello Team, I am looking for guidance on determining an appropriate value for the max_locks_per_transaction parameter in our PostgreSQL 17.6 production environment. Environment has the following characteristics: PostgreSQL Version: 17.6 max_connections = 1500 Daily partitioning strategy Large OLTP workload with transactions that may access multiple partitions Occasionally, we encounter the following error: ERROR: out of shared memory HINT: You might need to increase max_locks_per_transaction. We understand that the shared lock table is sized based on max_locks_per_transaction, max_connections, and max_prepared_transactions. However, we have not found any guidance on how to estimate an appropriate value for environments with a large number of partitions and indexes. We would appreciate guidance on the following: Is there a recommended methodology or formula for estimating max_locks_per_transaction. Our objective is to determine an appropriate value based on workload characteristics rather than increasing the parameter through trial and error. Thanks Vivek Gadge. --00000000000096bf540655682cf9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Team,

= I am looking for guidance on determining an appropriate value for the max_l= ocks_per_transaction parameter in our PostgreSQL 17.6 production environmen= t.

Environment has the f= ollowing characteristics:

=C2=A0 =C2=A0 PostgreSQL Version: 17.6
=C2=A0 =C2= =A0 max_connections =3D 1500
=C2=A0 =C2=A0 Daily par= titioning strategy
=C2=A0 =C2=A0 Large OLTP workload= with transactions that may access multiple partitions=C2=A0

Occasionally, we encounter the follow= ing error:

ERROR: out of= shared memory
HINT: You might need to increase max_= locks_per_transaction.

W= e understand that the shared lock table is sized based on max_locks_per_tra= nsaction, max_connections, and max_prepared_transactions. However, we have = not found any guidance on how to estimate an appropriate value for environm= ents with a large number of partitions and indexes.
=
We would appreciate guidance on the following:<= /div>

=C2=A0 =C2=A0 Is there a= recommended methodology or formula for estimating max_locks_per_transactio= n.

Our objective is to d= etermine an appropriate value based on workload characteristics rather than= increasing the parameter through trial and error.
<= br>
Thanks=C2=A0

Vivek Gadge.

--00000000000096bf540655682cf9--