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 1h9GcR-0006w6-9a for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2019 22:01:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9GcO-0000JC-F9 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2019 22:01:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9GcO-0000J5-6X for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2019 22:01:56 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9GcK-0002ej-St for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2019 22:01:55 +0000 Received: by mail-qk1-x744.google.com with SMTP id k130so10937857qke.3 for ; Wed, 27 Mar 2019 15:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=nbYciew5wwQ2vxFBUfCJeWsaULgyqtjSd+THAHe14T4=; b=Poec7vJiakCH3MOpsuhk7CvIaZbmCjL4/LMj6sl4q/Bw0eKgGfzBERLwarbQxM/q7n RxHJaCIEXif8ow+MGejaP0xe+MULubJD8SgCINmruII8S3p4Lsc8DztASuY+5naufx3A IOfzZABmuIW1yCS9835NicIVpcLx6cr802kk6XqH0hcMTwOiv8uh9/4i8cucYsfi+bdx hutZlhkiEfJDBsDdEwxoUgHqg0jBDVtlabkmJsC68eYYDNqtQQGxz8hnSS2/CDHxPlZC 52x05Krv1M8orkTf6pPX16r02XmM7CIcAQ5Og9diTpoY6cAEr6U8c57k88t6pqVHqXcD eY9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=nbYciew5wwQ2vxFBUfCJeWsaULgyqtjSd+THAHe14T4=; b=HOxWxXIA/yUu3pUuPvzOm6qZOlt+gwfH1mXT3yL3vGYF1750OkNYJ+rSfOJ6YLXcjF VO2lZ4I8R5s3/1N7RiRNXbFrFSamnY0qmkvIheMmAoWr4mmHU3T4o4FbgouvqG1Rc9yp gOwggIXdEBjR3r85T2NygwIuuXdHN98ObbhBhf1zVYEGhxZTxchxivBsT2keD1RzjXac +CR+pDjXNPBtLymNgnRpE81zq+4/dNu0DIxmJAKDT47WjSROY6QiWGjlg24ANsA8z/Wi yYsIeJ0edjuPPa8eSUhNnwYw0LjHD3PhXb/XrfgoGNzZgkeUuXVoe1yWjScuezKyi50X 4xvg== X-Gm-Message-State: APjAAAWf73uZdKlZKJoIdThiofbdDxzmj9K90xlsA/EXLy+v6Cwfmcq6 CiTSlxeWMZGD/8sM8ZHwhhgYYQ== X-Google-Smtp-Source: APXvYqyNoZFTseSisbQjAfkIVN9O5mcRI2SV/rgxDYO0BtR4HhNyR8xwXMTuGq3BUz6oiq0p/Y0FPA== X-Received: by 2002:a37:9bc7:: with SMTP id d190mr27330595qke.348.1553724111167; Wed, 27 Mar 2019 15:01:51 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([201.186.80.67]) by smtp.gmail.com with ESMTPSA id b3sm12038949qti.33.2019.03.27.15.01.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 15:01:50 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 0335A120334; Wed, 27 Mar 2019 19:01:49 -0300 (-03) Date: Wed, 27 Mar 2019 19:01:48 -0300 From: Alvaro Herrera To: Darafei =?utf-8?B?IktvbdGPcGEi?= Praliaskouski Cc: PostgreSQL Developers Subject: Re: Berserk Autovacuum (let's save next Mandrill) Message-ID: <20190327220148.GA22422@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Mar-28, Darafei "Komяpa" Praliaskouski wrote: > чт, 28 мар. 2019 г. в 00:32, Alvaro Herrera : > > > On 2019-Mar-27, Darafei "Komяpa" Praliaskouski wrote: > > * certain tables would have some sort of partial scan that sets the > > visibility map. There's no reason to invoke the whole vacuuming > > machinery. I don't think this is limited to append-only tables, but > > rather those are just the ones that are affected the most. > > What other machinery runs on VACUUM invocation that is not wanted there? > Since Postgres 11 index cleanup is already skipped on append-only tables. Well, I think it would be useful to set all-visible earlier than waiting for a vacuum to be necessary, even for tables that are not append-only. So if you think about this just for the append-only table, you leave money on the table. > > * tables nearing wraparound danger should use the (yet to be committed) > > option to skip index cleaning, which makes the cleanup action faster. > > Again, no need for complete vacuuming. > > "Nearing wraparound" is too late already. In Amazon, reading table from gp2 > after you exhausted your IOPS burst budget is like reading a floppy drive, > you have to freeze a lot earlier than you hit several terabytes of unfrozen > data, or you're dead like Mandrill's Search and Url tables from the link I > shared. OK, then start freezing tuples in the cheap mode (skip index updates) earlier than that. I suppose a good question is when to start. I wonder if Mandrill's problem is related to Mailchimp raising the freeze_max_age to a point where autovac did not have enough time to react with an emergency vacuum. If you keep raising that value because the vacuums cause problems for you (they block DDL), there's something wrong. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services