Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hENk5-0004MD-W5 for pgsql-general@arkaria.postgresql.org; Thu, 11 Apr 2019 00:39:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hENk4-0005FF-L8 for pgsql-general@arkaria.postgresql.org; Thu, 11 Apr 2019 00:39:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hENk4-0005F7-1J for pgsql-general@lists.postgresql.org; Thu, 11 Apr 2019 00:39:00 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hENk0-0001Xc-LG for pgsql-general@postgresql.org; Thu, 11 Apr 2019 00:38:58 +0000 Received: by mail-pg1-x543.google.com with SMTP id d31so2547848pgl.7 for ; Wed, 10 Apr 2019 17:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=TfNZFu9k00J9z6bxX/SMgfseO+Ia6QJ2EVf+u9JwkRU=; b=gP4cpboyPuln/jt6kR387cJo+Pd+m5NptksJA9d5bK3GYpmlaqBeyuhoRk6KCOA341 dlLz2k+AeT5zdxeeN1H1q0E2EfwSVdNSpjOThMWCChgUr+rbtcMS9Tb4s6V0YKb8z41u /k26CyLYk9R701FhcfuxaLVDZ97t8P85LZPQlfz4lJfGklwXaMSWpNG4MYIXxj1MkdUS Jy1KrLXOFGDt6OArbo+o52xK5sGlgZtxzcnk3qcheHkAJwwgkvRXpBjnO60lhEyaCAVa F2FoFi3Uaj4mHAEi+VhemziQondPm0n2AP1q3Shf3EZGpCnWVnLGrskAzCnJFyI+x1xv jmxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=TfNZFu9k00J9z6bxX/SMgfseO+Ia6QJ2EVf+u9JwkRU=; b=N4hVpUaxILTCfRHFdxLXoyZ6RGJ3ii7PsX3BedfiWNVLFElMvQDwLdTxBRzuGXurvD cXKzAP0y4cb1ZonLQsS8Nn8CxpD49rfNIsJIUvnA3OgUVnTBF3/Jo3mCdG1XwnfXtmkK 6djaGw4iWFyER/gNMG0h2znj/dKDXm3YaoraocpHSNyMMGfcQuoLNKhajejyfZkfoY+b J9q2wK93aNjdBQwGkyb44h1ormq58IIqfsKZuhr9E+jJ5mANkhN+TtZyF8l9La2h+J5D tez0VW9TGF3TjZrNpNVKZNp7zegHtUsJaVPe1q2H4psWXqR2jsDU9b9h7frsuN3Vha2B dCzw== X-Gm-Message-State: APjAAAVaDNJ/fW/cRbA0anlqvamWotNsnPKR81JlqzBweVg4f7GJcTNJ HZYaFmPk+SJmo3jZalz+U+t8/r1o X-Google-Smtp-Source: APXvYqyRSsg3zKa/TqjU5psCy3RGPdsus4CXxEatNviYyZBEkRqYBDHewS6NgYspRHSYGThxY/WunA== X-Received: by 2002:aa7:9389:: with SMTP id t9mr47379091pfe.60.1554943135242; Wed, 10 Apr 2019 17:38:55 -0700 (PDT) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id g73sm65928509pfd.185.2019.04.10.17.38.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 17:38:54 -0700 (PDT) Subject: Re: stale WAL files? To: Rene Romero Benavides Cc: "pgsql-general@postgresql.org" References: <10FF70E2-9F70-4469-A4F4-4081988F0204@gmail.com> <3dccbbe4-e115-11ab-2d78-74c3cc9e2e43@aklaver.com> <599C6022-1DA1-477D-895C-7E217D350B85@gmail.com> <20190328133005.GB2558@paquier.xyz> <973f0fdf-e20f-a8a1-86c8-7f145eb31b70@gmail.com> <20190329125811.GF1954@paquier.xyz> <989E476E-D798-4F80-ADDE-3DA4EB9CAA3C@gmail.com> <6F2111AD-1CD9-4077-AA8B-F6E1F7AD809D@gmail.com> <04f4bc5d-be30-c1da-4d5c-db0f71b20324@gmail.com> From: Rob Sargent Message-ID: Date: Wed, 10 Apr 2019 18:38:53 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------21C818E0E78F3AD0D1974960" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------21C818E0E78F3AD0D1974960 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 4/10/19 6:03 PM, Rene Romero Benavides wrote: > What's your current max_wal_size parameter? > SHOW max_wal_size; > If it's 8GB as your configuration's previous value, you would get a > constant share of 512 WAL files. If it's a development environment set > it to the desired size, the smaller the value, the more frequent the > checkpoints, but your checkpoint_timeout value is 300 (5 minutes) > which is likely to be happening first, and thus being the one > triggering checkpoints that often. > > On Wed, Apr 10, 2019 at 1:12 PM Rob Sargent > wrote: > > > >> As per your configuration : >> max_wal_size = 50GB >> this seems to be the cause for the WAL files piling up. >> >> this has been declared twice, the last one is taking effect. >> -- >> El genio es 1% inspiración y 99% transpiración. >> Thomas Alva Edison >> http://pglearn.blogspot.mx/ >> > I've manage to generate another 359 WAL files in a 10 minute span > yesterday (now only 357 remain and I suspect they will wither away > as before).  Are these being held simply because of the high > max_wal_size value? > > This is a development environment, wherein I'm loading 4M+ > records, first into 41 staging tables 100K rows per.  In a loop > over each staging table, the data is then placed into application > tables via selects. First select * into "matching table" then > select id into intersection record (id, fixed groupId).  Each such > iteration is in it's own transaction.  I have dropped and recreate > this same database numerous times working my way up from 100K to > 4M records, dialing in application parameters according to number > of primary records.  I have not, however, dropped the last > incarnation. > > We have not yet reconfigured the max_wal_size parameter, it is still 50GB postgres-# show max_wal_size postgres-# ;  max_wal_size --------------  50GB (1 row) I'm sorry, I  don't follow your thesis that this setting would lead to "a constant" 512 WAL files.  There was a distinct burst of WALs in a 10 minute period yesterday, and no accumulation since then (though a manual checkpoint does generate another WAL) --------------21C818E0E78F3AD0D1974960 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit


On 4/10/19 6:03 PM, Rene Romero Benavides wrote:
What's your current max_wal_size parameter?
SHOW max_wal_size; 
If it's 8GB as your configuration's previous value, you would get a constant share of 512 WAL files. If it's a development environment set it to the desired size, the smaller the value, the more frequent the checkpoints, but your checkpoint_timeout value is 300 (5 minutes) which is likely to be happening first, and thus being the one triggering checkpoints that often.   

On Wed, Apr 10, 2019 at 1:12 PM Rob Sargent <robjsargent@gmail.com> wrote:



As per your configuration :
max_wal_size = 50GB
this seems to be the cause for the WAL files piling up.

this has been declared twice, the last one is taking effect.
--
El genio es 1% inspiración y 99% transpiración.
Thomas Alva Edison
http://pglearn.blogspot.mx/

I've manage to generate another 359 WAL files in a 10 minute span yesterday (now only 357 remain and I suspect they will wither away as before).  Are these being held simply because of the high max_wal_size value?

This is a development environment, wherein I'm loading 4M+ records, first into 41 staging tables 100K rows per.  In a loop over each staging table, the data is then placed into application tables via selects. First select * into "matching table" then select id into intersection record (id, fixed groupId).  Each such iteration is in it's own transaction.  I have dropped and recreate this same database numerous times working my way up from 100K to 4M records, dialing in application parameters according to number of primary records.  I have not, however, dropped the last incarnation.


We have not yet reconfigured the max_wal_size parameter, it is still 50GB

postgres-# show max_wal_size
postgres-# ;
 max_wal_size
--------------
 50GB
(1 row)

I'm sorry, I  don't follow your thesis that this setting would lead to "a constant" 512 WAL files.  There was a distinct burst of WALs in a 10 minute period yesterday, and no accumulation since then (though a manual checkpoint does generate another WAL)



--------------21C818E0E78F3AD0D1974960--