Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgUYq-0003kR-Uy for pgsql-admin@arkaria.postgresql.org; Fri, 20 Jul 2018 12:31:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fgUYp-0007xb-1L for pgsql-admin@arkaria.postgresql.org; Fri, 20 Jul 2018 12:31:03 +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.89) (envelope-from ) id 1fgUYo-0007xL-Ml for pgsql-admin@lists.postgresql.org; Fri, 20 Jul 2018 12:31:02 +0000 Received: from smtp210-pc.aruba.it ([62.149.157.210] helo=smtpg-pc.aruba.it) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fgUYh-0001Gz-RT for pgsql-admin@lists.postgresql.org; Fri, 20 Jul 2018 12:31:01 +0000 Received: from DT02 ([93.63.211.242]) by smtpcm2-pc.aruba.it with bizsmtp id D0Wt1y00u5ELnP9010Wtst; Fri, 20 Jul 2018 14:30:53 +0200 From: "Alfonso Moscato" To: <066ce286@free.fr>, References: <00a601d4201a$e2291a10$a67b4e30$@merqurio.it> <1745624490.130025832.1532088079202.JavaMail.root@zimbra82-e14.priv.proxad.net> In-Reply-To: <1745624490.130025832.1532088079202.JavaMail.root@zimbra82-e14.priv.proxad.net> Subject: R: repeated out of shared memory error - not related to max_locks_per_transaction Date: Fri, 20 Jul 2018 14:30:54 +0200 Message-ID: <00e001d42025$80d2bb80$82783280$@merqurio.it> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQLNKJtprlyY8naH+IbwA/ikAIhNgaKl+ZMA Content-Language: it DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aruba.it; s=a1; t=1532089853; bh=fqljOexOEffbG6ihFAxWxEWsSUrDTq9QwbvmCijUJjs=; h=From:To:Subject:Date:MIME-Version:Content-Type; b=SGOU2hlJgwFy7dsgZbSQFXCqusWUOYUeAxKVqvz9JrsafvqfTgqqzaEesxaH4VRP7 6o87XPBgzQ5qt0C+LczcgZ2lZDGXZfbCsuEz7818RgqEb54dg4sUqFZRZJGNP62EM6 3ftMbbTaOGF/Uczf2WMUt1m8H3bnJPIYLhx/+28J+lYmk1vi7dpXKa8xPXm+qWTLRU WkQs/OfnMtdErLZSbt6oQd40bqCmqXCXAu8g6cGzODsSXC+TpX3+jsU2o4exKHJQxL 5Tr4y3C5+pxKgz8aFyzXMXAvVLdvMWFT4n92PI+2Xg8fRDeD42cJYiY85BIt6wbzkZ i/+k0SLxghsog== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I did. This is a dedicated server. root@pg:/var/log/postgresql# ipcs -pm ------ Shared Memory Creator/Last-op PIDs -------- shmid proprietario cpid lpid 131072 postgres 12879 15299 root@pg:/var/log/postgresql# ipcs -m ------ Segm. Memoria Condivisa -------- chiave shmid proprietario perms byte nattch = stato 0x0052e2c1 131072 postgres 600 56 83 -----Messaggio originale----- Da: 066ce286@free.fr <066ce286@free.fr>=20 Inviato: venerd=C3=AC 20 luglio 2018 14:01 A: pgsql-admin@lists.postgresql.org Oggetto: Re: repeated out of shared memory error - not related to = max_locks_per_transaction Hi, Try to run ipcs -m (and also ipcs -pm) To check who and wich process is using the shm. ----- Mail original ----- De: "Alfonso Moscato" =C3=80: pgsql-admin@lists.postgresql.org Envoy=C3=A9: Vendredi 20 Juillet 2018 13:14:53 Objet: repeated out of shared memory error - not related to = max_locks_per_transaction We are getting crazy with "out of shared memory" errors, and we can't = figure the reason. We have postgresql "PostgreSQL 9.6.9 on x86_64-pc-linux-gnu (Ubuntu = 9.6.9-2.pgdg16.04+1), compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) = 5.4.0 20160609, 64-bit", the server has 92gb of ram, it is a mixed = environment (mostly OLTP, with some DW), with 100 sessions constantly = open (a CRM) and some long queries run every half an hour. Everything works fine, except that after 1 day and half we start = receiving a lot of "out of shared memory" messages. I am sure it is not related with the usual max_locks_per_transaction = issue, because we have set max_locks_per_transaction to 384, and when we = receive these messages we have no more than 50/100 locks totally. Restarting the server usually works fine for one day and hal more, and = then messages restart. Looking at the log, we see that this error starts casually, sometimes on = very small queries, returning some kbytes of data. We have tried a lot of different configurations. we have tried with = pgtune and pgconfig 2.0. Currently, we have:=20 max_connections =3D 200 shared_buffers =3D 23GB effective_cache_size =3D 69GB maintenance_work_mem =3D 2GB checkpoint_completion_target =3D 0.9 wal_buffers =3D 16MB default_statistics_target =3D 100 random_page_cost =3D 4 effective_io_concurrency =3D 2 work_mem =3D 60293kB min_wal_size =3D 2GB max_wal_size =3D 4GB max_worker_processes =3D 4 max_parallel_workers_per_gather =3D 2 max_locks_per_transaction =3D 384 but we tried with work_mem to 130mb, shared_buffer to a maximum fo 40gb, = effective_cache to 4gb shared memory limits are very big:=20 max number of segments =3D 4096 max seg size (kbytes) =3D 18014398509465599 max total shared memory = (kbytes) =3D 18014398442373116 min seg size (bytes) =3D 1 thanks