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 1nPmio-00022c-9w for pgsql-performance@arkaria.postgresql.org; Thu, 03 Mar 2022 14:46:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nPmim-0002nh-P0 for pgsql-performance@arkaria.postgresql.org; Thu, 03 Mar 2022 14:46:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nPmim-0002nY-CQ for pgsql-performance@lists.postgresql.org; Thu, 03 Mar 2022 14:46:24 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nPmie-0006Gv-Ik for pgsql-performance@lists.postgresql.org; Thu, 03 Mar 2022 14:46:23 +0000 Received: by mail-io1-xd30.google.com with SMTP id 195so6100820iou.0 for ; Thu, 03 Mar 2022 06:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=vdFf3r84YPT2sh/GXdG0k/8kdK1hX6nOo0KRV2Mdmhc=; b=8FyjGFRlKPLrvw4Y3YJ8wc/iHA+tPvereb+BEwufou/bCAxmpapacjZM+fAb2kd2pu T1jvS2tQKS/XWAkdK7eazN4H93EtDiugVAHqSWbLPRYl7KkGIRuXD2Crf7piWAAw80Fo QdKocqoL06uDamdSVnSmOe4Zbt3TowyLmcBwdQqzU1Ivzg9jz4GDy8qdp17WFk24/Z6/ dLANfL2iZnDrqC8vYekeBh04ExrJdpqEvr1BGd+RQqBADturzL5lu7MXYx0ht6f2QUWs pbG1j/Y+ZYGHvEk/McLG6D4TG2darR9gqBVhKbGvVaSM2xyeJAzNlvGfFAAUx8h2oGfC wIRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=vdFf3r84YPT2sh/GXdG0k/8kdK1hX6nOo0KRV2Mdmhc=; b=SYxn+cEHlsq4oqog3Swm1+fY/qDUQ9wRJmBJiGZRxCBG9FVa2nICUdRSS8tbHnFhnv NIfqrbiwZG/eKo9Flr5hzA1GPKvN7mbzssIFfHSWPXteZRnst5x8o179RvX3s9fcIoz3 aUbsiFbm4pQADpmp65OVENr+yLRl1HtCnezwoaBL3NhsUIMwIdqQItMAmu/DAD5A+1HX AiL8hKBvtkmoGtAy1v9NsaFg6Vza/3a8Rwfp1hNu38lbau2MghuUP7I8CK09pVrdPOUD tyDu8EsnweGaysp61wkwPMg/onOwtdz6aP0EznAivWKBjTUiDc6vtO0nmjg4Q80uZ/AW sdrQ== X-Gm-Message-State: AOAM530OnnqBm1RIG68MhejfIF8GIVh7D0PZFDOpgMg3I5UYiQk4LEWS ZXo3zYNWpVhTKdrV9h+wRUH+Z1nZr+fRVg== X-Google-Smtp-Source: ABdhPJymqhRN2vem4GFnjlVV4hsYj0NfVElCdO5DcyyRhSaMqQ8mxpU2/M8bBmCLp0qvTlPT5W3Vnw== X-Received: by 2002:a05:6602:2817:b0:640:d4f5:12b9 with SMTP id d23-20020a056602281700b00640d4f512b9mr27090593ioe.35.1646318774579; Thu, 03 Mar 2022 06:46:14 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id l13-20020a056e021c0d00b002c1efc8ac4bsm2858558ilh.21.2022.03.03.06.46.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Mar 2022 06:46:14 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 681008007F5; Thu, 3 Mar 2022 08:46:13 -0600 (CST) Date: Thu, 3 Mar 2022 08:46:13 -0600 From: Justin Pryzby To: Marc =?iso-8859-1?Q?Recht=E9?= Cc: pgsql-performance@lists.postgresql.org Subject: Re: OOM killer while pg_restore Message-ID: <20220303144613.GF27651@telsasoft.com> References: <866ba95f-86fb-fa9b-ecee-65281160cff9@rechte.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <866ba95f-86fb-fa9b-ecee-65281160cff9@rechte.fr> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 03, 2022 at 09:59:03AM +0100, Marc Rechté wrote: > 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. Send the schema for the table, index, and constraints (\d in psql). What are the server settings ? https://wiki.postgresql.org/wiki/Server_Configuration What OS/version ? > 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)