Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 375E05962FD for ; Sat, 23 Jun 2012 20:09:41 -0300 (ADT) Received: from nm9-vm0.bullet.mail.sp2.yahoo.com ([98.139.91.196]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SiZSV-0006sq-FC for pgsql-admin@postgresql.org; Sat, 23 Jun 2012 23:09:40 +0000 Received: from [72.30.22.93] by nm9.bullet.mail.sp2.yahoo.com with NNFMP; 23 Jun 2012 23:09:26 -0000 Received: from [72.30.22.202] by tm15.bullet.mail.sp2.yahoo.com with NNFMP; 23 Jun 2012 23:09:26 -0000 Received: from [127.0.0.1] by omp1064.mail.sp2.yahoo.com with NNFMP; 23 Jun 2012 23:09:26 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 147646.36868.bm@omp1064.mail.sp2.yahoo.com Received: (qmail 4178 invoked by uid 60001); 23 Jun 2012 23:09:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1340492965; bh=N5ffDOkEPCmyE/Lb66ZUh+jbiiPJ2V38lQeOFQ+TcYI=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=PH8X1sJL3mdnsvmCwEExRpZg0Vd2H1GX1tBj+9k2CFCBN3wmYpJ102h/54Q32oBX3NCUdpCXfvTls7iofGVwJrPm/ZDzH3hYl9PlVB+108QT9MbD89luMaf5YEunVa0ryNt5uuk1EQYgJnu1XAOi3tNiRNdzWkK//PCnR24hl2k= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=P5QuH7TKDRJhY+k97WC4IxDRO/5J+iT9EQZo8dcodb7MvViZWgsEntv/Qn7KzkIlPMsuilGN2ckVaGjFWjC+I7lBiL1MMD52kx2vqZXRwirSrkbNVf5eByQpio09SDQ+i+vBvaJ7pyuQj6eWbeZGFmw1iNd70rux8cpE9GLj15Y=; X-YMail-OSG: 66DwSq0VM1liPxg3ZtxYmHlE78N62TY.Iiuy5qJdzkbTufD tbmat8aqtw6T2GazboepP_N0Pq79PI.FamoZuajO3zvimoBm_jxHQcWJiuNo B3dHySLrbst6LOE3atDzre7uaOyh31bXBb4vv.ExiA2LncmGWWA0aljD6zGh gZyvYkkXLThZ1D0YILMJRSgW6cg7pHm2a4AOhlHkc0BV53T.voS0NsBZrEz. DDg9tkOEtOx16zBHW3iz5DNxsFTLanD4gkJgRkJEwp9KE2ZN6w8bNtOrXGmS a8C4sr12k1pTaw54z7xbXJ6JCudDd_YlQQtX8vkFrGOAQRwVew_2nG2lWCpq isLsHE6DL2lS1SeE46dDGz.T1Ym68pqeVTvagzu0yJ3XrQB5Td7LkjW1xyW2 rFZ6i5mWPEmN1dpEkMkLFNocjcbDd4BK2StfyTtMR7uC2lB249njQuU18NQ- - Received: from [98.210.146.78] by web46114.mail.sp1.yahoo.com via HTTP; Sat, 23 Jun 2012 16:09:25 PDT X-Mailer: YahooMailWebService/0.8.118.349524 References: <1340391499.61601.YahooMailNeo@web46101.mail.sp1.yahoo.com> <4FE47DA402000025000489E3@gw.wicourts.gov> <1340394089.27581.YahooMailNeo@web46103.mail.sp1.yahoo.com> Message-ID: <1340492965.4094.YahooMailNeo@web46114.mail.sp1.yahoo.com> Date: Sat, 23 Jun 2012 16:09:25 -0700 (PDT) From: Greg Williamson Reply-To: Greg Williamson Subject: Re: autovac hitting too many tables at once To: "pgsql-admin@postgresql.org" In-Reply-To: <1340394089.27581.YahooMailNeo@web46103.mail.sp1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -0.4 (/) X-Archive-Number: 201206/107 X-Sequence-Number: 39698 A follow up --=0A=0A=0A<...>=0A>>> =A0=A0 a) quickly relieve the immediate = pain=0A>> =0A>> Set autovacuum_cost_limit to a smaller value.=A0 (Change th= e=0A>> postgresql.conf file and do a reload.)=A0 I would start by cutting t= he=0A>> current value in half.=0A>>=A0>=0A=0A>Thanks -- would not have know= n how to start. But for now, in=0A>observance of your idea on XID wraparoun= d, I am letting=0A>everything run (this is actually a low point in regular = traffic for this=0A>site and I am not seeing direct proof that autovac is i= n fact doing=0A>anything out of the ordinary).=0A>=0A=0A=0AWhile sleuthing = logs for some data these 3 processes began to finish=0Aso the immediate iss= ue went away. We'll make these changes next=0Aweek I suspect.=A0 Lig search= es showed that the vast majority of our=0Aautovacs were on replication rela= ted tables in ordinary processing=0Aso reducing the max number autovacs was= not to be contemplated.=0A=0A>>>=A0 and=0A>>> =0A>>> =A0=A0 b) prevent suc= h issues in the future (other than going to manual=0A>>> =A0 =A0 =A0 vacuum= ing on a schedule).=0A>> =0A>> If it is suddenly doing this on lots of big = tables at once, it seems=0A>> somewhat likely that you've hit the transacti= on wraparound=0A>> protection threshold.=A0 Because the vacuum necessary fo= r this can be=0A>> painful, and they tend to come at the worst possible tim= e (the more=0A>> your workload looks like a really heavy OLTP workload at a= ny given=0A>> moment, the higher the probability that this is about to happ= en), I=0A>> always follow a bulk load (like from restoring pg_dump output) = with=0A>> a VACUUM FREEZE ANALYZE.=0A>> =0A>> You might also want to consid= er running off-hours vacuums to=0A>> supplement autovacuum.=A0 Upgrading to= a more recent version of=0A>> PostgreSQL is likely to help some, too.=0A>>= =0A>Duly noted. =0A=0A=0AThe autovac processes were not the core problem, = natch. Someone deleted=0A50000 rows from one table, generating larger delet= es in the two other tables,=0Awhich in turn provoked replication issues, al= l of which got autovac's attention.=0A=0AGiven time everything calmed down = and a lesson learned has been inscribed.=0A=0ADon't do mass deletes -- thro= ttle them back, one way or another. If you must=0Atread this path make some= adjustments to relevant tables and values first.=0A=0AThanks, Kevin, for t= he quick response. =0A=0A=0AGreg W.