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 1nPhIp-0002dc-Ny for pgsql-performance@arkaria.postgresql.org; Thu, 03 Mar 2022 08:59:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nPhIo-00029O-DZ for pgsql-performance@arkaria.postgresql.org; Thu, 03 Mar 2022 08:59:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nPhIo-00029F-3U for pgsql-performance@lists.postgresql.org; Thu, 03 Mar 2022 08:59:14 +0000 Received: from 16.mo583.mail-out.ovh.net ([87.98.174.144]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nPhIj-0001FS-CA for pgsql-performance@lists.postgresql.org; Thu, 03 Mar 2022 08:59:13 +0000 Received: from player715.ha.ovh.net (unknown [10.111.172.95]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 5E76123B1F for ; Thu, 3 Mar 2022 08:59:05 +0000 (UTC) Received: from rechte.fr (82-65-133-131.subs.proxad.net [82.65.133.131]) (Authenticated sender: marc4@rechte.fr) by player715.ha.ovh.net (Postfix) with ESMTPSA id BD40727D329D9 for ; Thu, 3 Mar 2022 08:59:04 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-107S0013be28949-53fd-441e-af92-a70e0f1f328e, CC9045FF61E83A5D6BF42C31E62AA5D1FAF6CC00) smtp.auth=marc4@rechte.fr X-OVh-ClientIp: 82.65.133.131 Content-Type: multipart/alternative; boundary="------------doRhQwVbPvRXZDPJxhNyaTVf" Message-ID: <866ba95f-86fb-fa9b-ecee-65281160cff9@rechte.fr> Date: Thu, 3 Mar 2022 09:59:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: fr-FR To: pgsql-performance@lists.postgresql.org From: =?UTF-8?Q?Marc_Recht=c3=a9?= Subject: OOM killer while pg_restore X-Ovh-Tracer-Id: 9464314620079905801 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddruddthedguddvkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurheptgfkffggfgfvhffusegrtderredtfeejnecuhfhrohhmpeforghrtggptfgvtghhthoruceomhgrrhgtgeesrhgvtghhthgvrdhfrheqnecuggftrfgrthhtvghrnhepueejgfekhfegieeiueevteeiudfhveejvdeugfdvteeiheeuvdegjeeggeduvedtnecukfhppedtrddtrddtrddtpdekvddrieehrddufeefrddufedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejudehrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepmhgrrhgtgeesrhgvtghhthgvrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehpghhsqhhlqdhpvghrfhhorhhmrghntggvsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------doRhQwVbPvRXZDPJxhNyaTVf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hello, We have a pg_restore which fails due to RAM over-consumption of the corresponding PG backend, which ends-up with OOM killer. The table has one PK, one index, and 3 FK constraints, active while restoring. The dump contains over 200M rows for that table and is in custom format, which corresponds to 37 GB of total relation size in the original DB. While importing, one can see the RSS + swap increasing linearly for the backend (executing the COPY) On my machine (quite old PC), it failed after 16 hours, while the disk usage was reaching 26 GB and memory usage was 9.1g (RSS+swap) If we do the same test, suppressing firstly the 5 constraints on the table, the restore takes less than 15 minutes ! This was tested on both PG 14.2 and PG 13.6 (linux 64-bit machines). It there a memory leak or that is normal that a bacend process may exhaust the RAM to such an extent ? Thanks Regards --------------doRhQwVbPvRXZDPJxhNyaTVf Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hello,

We have a pg_restore which fails due to RAM over-consumption of the corresponding PG backend, which ends-up with OOM killer.

The table has one PK, one index, and 3 FK constraints, active while restoring.
The dump contains over 200M rows for that table and is in custom format, which corresponds to 37 GB of total relation size in the original DB.

While importing, one can see the RSS + swap increasing linearly for the backend (executing the COPY)

On my machine (quite old PC), it failed after 16 hours, while the disk usage was reaching 26 GB and memory usage was 9.1g (RSS+swap)

If we do the same test, suppressing firstly the 5 constraints on the table, the restore takes less than 15 minutes !

This was tested on both PG 14.2 and PG 13.6 (linux 64-bit machines).

It there a memory leak or that is normal that a bacend process may exhaust the RAM to such an extent ?

Thanks

Regards

--------------doRhQwVbPvRXZDPJxhNyaTVf--