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 1mZS2b-0002wX-TB for pgsql-admin@arkaria.postgresql.org; Sun, 10 Oct 2021 06:10:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mZS2Z-00053P-DQ for pgsql-admin@arkaria.postgresql.org; Sun, 10 Oct 2021 06:10:31 +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 1mZS2Z-00053F-0Y for pgsql-admin@lists.postgresql.org; Sun, 10 Oct 2021 06:10:31 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mZS2W-0001Tb-44 for pgsql-admin@lists.postgresql.org; Sun, 10 Oct 2021 06:10:30 +0000 Received: by mail-oo1-xc33.google.com with SMTP id t3-20020a4ad0a3000000b002b6d2394d1fso993885oor.12 for ; Sat, 09 Oct 2021 23:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=kEArHWEHHk05dQsYqgpLdtP6bjq0aJfi3o0evtG/+4w=; b=N77bap3x7t04OQaBmJ3KK7xwG7CDjOrpvQ1GQ9ubZkvsnpuaa6tyUcZ5yWvuoX2LgO 5gsHptVO9XN6hvMpeiN1cOxwgL2IWVbEBTgf8ts8xbHm0SVb7BPY6PGUtY7VwTJB8hax pOzzCJ9EZfV1o2vbVbbqmt9knIUv+iSYFuadSBUtiBKOFV0j6xqeUl4dJdezNAHhpajN gV2IhIbJTBPKk6OTp+Vd2yUboTmAojHUfQ14XFEMXeVCS7N/nNPMKS/xGtS4zZl3jRbT U3oxf7qP2AyxX1gQ2MXaaKA24ru3R1c5JQZisfi1SjF/JV8o1uXq3Q0JAk0YlmmKoUko AjLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=kEArHWEHHk05dQsYqgpLdtP6bjq0aJfi3o0evtG/+4w=; b=idkB1GClPnb6mmlV0smq6GnD6Oc0dyUqjTJA+NgTjIp2912hoKE6Keh1DBT3Q3+lAY 9775L9JhmcZ+34t1AgGYnkoEs8rfdk+wDxRduXXZo2/V2z8Mq/+nwhZO/qB0P1fKeX9z /kRmU6SEuzRxCkU2jx5hnOt1/XV8GplKunsNuLARUWI/3EDVDU/oPfKln0A3TtqfVpvb 71O4T/h3sCe3vMApHh4b44bdX/KHRiYmGh/MViLUB15P8GmgNzMN3ws2I/KDMnXvNG1g 7++9+e4Js20Ss9AacpHSwRhLkJLNnc20o5ME/qMd7bwkv+74uoo9BC6/BvakFVRDKEvb Vwew== X-Gm-Message-State: AOAM531m4GQte8j4dGXaCkn8/QKQM0bLk2rUdVbRnM6ylBEq+FV6uXfD OO7qmrLcOV3TF81H1yTSf9GmOhd57RY= X-Google-Smtp-Source: ABdhPJwBnxFoDsuK8pss+yPcH3YkrAXxDBYBGVQ9Hl2loP6hVsbfsxqy0VIWVkLY1Z/p044F4I61rg== X-Received: by 2002:a05:6820:1612:: with SMTP id bb18mr14405316oob.7.1633846225231; Sat, 09 Oct 2021 23:10:25 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id i205sm370897oih.54.2021.10.09.23.10.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 Oct 2021 23:10:24 -0700 (PDT) Subject: Re: 13.4 on RDS, SSL SYSCALL EOF on restore To: pgsql-admin@lists.postgresql.org References: <202110082245.4wq5lie5euyx@alvherre.pgsql> <202110082248.xmzxkwo5gup7@alvherre.pgsql> From: Ron Message-ID: <07ed72a9-52dc-2c26-596e-7e80315ceb11@gmail.com> Date: Sun, 10 Oct 2021 01:10:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------B3C1BCEEFF072F2793CB0F5A" Content-Language: en-US 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. --------------B3C1BCEEFF072F2793CB0F5A Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit What if you use a bigger instance (and maybe provisioned IO, too) just for the time it takes to restore the database, and then modify it down to a "production sized" instance? On 10/9/21 1:20 PM, Wells Oliver wrote: > Thanks all. Reducing maintenance_work_mem to 1GB and keeping > shared_buffers at 4GB did allow the restore to complete. It took ~770m > with 16 processes and that configuration, but only ~500m with > maintenance_work_mem at 2GB, shared_buffers at 4GB, and 8 processes. Of > course, with maintenance_work_mem at 2GB and 16 processes, we ran out of > memory and kaboom. > > If anyone has any more parameter values I should try to improve on that > restore time, I'd love to hear them. > > Thanks for the help here. > > > On Fri, Oct 8, 2021 at 3:48 PM Alvaro Herrera > wrote: > > On 2021-Oct-08, Alvaro Herrera wrote: > > > On 2021-Oct-08, Wells Oliver wrote: > > > > > Dug out some more logging: > > > > > 2021-10-08 20:35:08 UTC::@:[12682]:LOG:  server process (PID 3970) > was terminated by signal 9: Killed > > > 2021-10-08 20:35:08 UTC::@:[12682]:DETAIL:  Failed process was > running: CREATE INDEX ... > > > > So what's happening here is that the instance is running out of RAM > > while creating some index, and the kernel is killing the process.  I > > would probably blame the combination of shared_buffers=4GB with > > maintenance_work_mem=2GB, together with the instance's total RAM. > > Also, maybe RDS could be smarter about this situation. > > -- > Álvaro Herrera              Valdivia, Chile  — > https://www.EnterpriseDB.com/ > "La primera ley de las demostraciones en vivo es: no trate de usar el > sistema. > Escriba un guión que no toque nada para no causar daños." (Jakob Nielsen) > > > > -- > Wells Oliver > wells.oliver@gmail.com -- Angular momentum makes the world go 'round. --------------B3C1BCEEFF072F2793CB0F5A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit What if you use a bigger instance (and maybe provisioned IO, too) just for the time it takes to restore the database, and then modify it down to a "production sized" instance?

On 10/9/21 1:20 PM, Wells Oliver wrote:
Thanks all. Reducing maintenance_work_mem to 1GB and keeping shared_buffers at 4GB did allow the restore to complete. It took ~770m with 16 processes and that configuration, but only ~500m with maintenance_work_mem at 2GB, shared_buffers at 4GB, and 8 processes. Of course, with maintenance_work_mem at 2GB and 16 processes, we ran out of memory and kaboom.

If anyone has any more parameter values I should try to improve on that restore time, I'd love to hear them.

Thanks for the help here.


On Fri, Oct 8, 2021 at 3:48 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
On 2021-Oct-08, Alvaro Herrera wrote:

> On 2021-Oct-08, Wells Oliver wrote:
>
> > Dug out some more logging:
>
> > 2021-10-08 20:35:08 UTC::@:[12682]:LOG:  server process (PID 3970) was terminated by signal 9: Killed
> > 2021-10-08 20:35:08 UTC::@:[12682]:DETAIL:  Failed process was running: CREATE INDEX ...
>
> So what's happening here is that the instance is running out of RAM
> while creating some index, and the kernel is killing the process.  I
> would probably blame the combination of shared_buffers=4GB with
> maintenance_work_mem=2GB, together with the instance's total RAM.

Also, maybe RDS could be smarter about this situation.

--
Álvaro Herrera              Valdivia, Chile  —  https://www.EnterpriseDB.com/
"La primera ley de las demostraciones en vivo es: no trate de usar el sistema.
Escriba un guión que no toque nada para no causar daños." (Jakob Nielsen)


--

--
Angular momentum makes the world go 'round.
--------------B3C1BCEEFF072F2793CB0F5A--