Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpF6r-000756-SL for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 15:50:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpF6q-0001Vj-AM for pgsql-general@arkaria.postgresql.org; Mon, 13 Aug 2018 15:50:20 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpF6p-0001VT-Rh for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 15:50:20 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fpF6m-0006Sf-Hu for pgsql-general@lists.postgresql.org; Mon, 13 Aug 2018 15:50:18 +0000 Received: by mail-wm0-x243.google.com with SMTP id n11-v6so9301233wmc.2 for ; Mon, 13 Aug 2018 08:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=SSYzrwIujMTYvVoiwnR4REgI8IK6Kfy5Nfw/wj+b/PI=; b=gCTGx+QI05mt3Gp5PBaG4Mbs4DKgxnVEA5Jsb82h49QYqPuyz7afLu2VEZk0NtUreu 8Wt8cr98AGG8Wm7e4V/w0V+tfj/GrlA9TPrI5lge3NflcWW/no1RsaTzHzDbCuCuOaO3 qSfHWngVBqG4j3WVPx1TyfdVfsf1EaVmP+tOVpz8jU6Jrbcuc2OI9oaTqJEd2WuvszgM 8pc7d1uTuFNbpkUj1LxWtvHkU0gEG9lGaSFZoXvjPr+2T6kFonMaqJUo8EibRpnnq9Ac zLo2OUjKsicmx5AXUmbizGcaz2KXgQIaVlJPI6pTyUdKhvB/mD8qgmuWiLRCWNfwxdBE GhVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SSYzrwIujMTYvVoiwnR4REgI8IK6Kfy5Nfw/wj+b/PI=; b=SoT5aLdVlVnaEh6dBNmhkqoYKTpKtrswUv8b3mC+TDeMQRhjMzw5vOU9bkxpFFgA+M hOKRgc6xT3zC5w0zVtHpLiFLC/z07VVY2xw+soazlKJz9Di0yNhh/zZb6yJlKwon/cUE XQS+0P7MMQSZpyccwT04xcdMSmDIsNwYD7h93S5WlFRnILbNbCW0xo+DXf7k0boFQM0f zyk48LzxoSqC4Hy23cEDcx2noHe2aH+my4+G1RoaXpWbOfGSX0vi+VaemgvCNLrWLMbi ePGdX/PZeaFXCvIkkPqOQcrTNMlKaomhCeRyc+mhLMVN+7NDup+7Dk13wcU0wcxpJ/N+ g76Q== X-Gm-Message-State: AOUpUlHXZcjgNnytZHTIvNMKM3xKxoWQ7e6f7qY7Z+RIp7CM5Evjduk+ rg1Oy1ME/DFLxJk02SyAAY/cSw3foidoYk64zKSWoJtDat/T/4uMrZEiGCW+A5apg5WZ2K0iZu4 JucvYFeqgSyZNhDx8IgsSEN9DH582qGsY3qwqhugPk/8hL7gS4bDA5bV4EZi6I0P7Mwn2/Tnp8s KUzXyxSVANmjgrK0kqrok= X-Google-Smtp-Source: AA+uWPygj4eYGcMiFFzmtqUDS1PaehDGmLkHT3C9+aymphWsbkQYm+eDDD6Dj23NFGoulDrKt4GF0A== X-Received: by 2002:a1c:6e07:: with SMTP id j7-v6mr8984869wmc.126.1534175413972; Mon, 13 Aug 2018 08:50:13 -0700 (PDT) Received: from [10.137.2.21] (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id k6-v6sm17443380wrv.92.2018.08.13.08.50.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 08:50:13 -0700 (PDT) Subject: Re: Fwd: is there any adverse effect on DB if I set autovacuum scale factor to zero? To: pgsql-general@lists.postgresql.org References: <64b01682-49bd-8577-45de-0114fd6af372@2ndquadrant.com> From: Tomas Vondra Message-ID: Date: Mon, 13 Aug 2018 17:50:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 08/13/2018 04:24 PM, Ashu Pachauri wrote: > + pgsql-general > > Thanks and Regards, > Ashu Pachauri > > > ---------- Forwarded message --------- > From: *Ashu Pachauri* > > Date: Mon, Aug 13, 2018 at 7:53 PM > Subject: Re: is there any adverse effect on DB if I set autovacuum scale > factor to zero? > To: > > > > The way I see *autovacuum_vacuum_scale_factor* is not in terms of > absolute number but as the percentage of any table that can consist of > updated / deleted tuples to make it eligible for vacuuming. A factor of > 0.1 ensures that your tables would be eligible for vacuuming if more > than 10% of the tuples are deleted/updated. > 1. If you think that 10% is too high for you in terms of storage cost, > you can decrease the number or set it to zero. But, I would advise to > increase the value of *autovacuum_vacuum_threshold* to something > reasonable if you do that, otherwise you pay the CPU cost frequent > vacuuming across all tables. > 2. However, if your issue is not the fixed 10% overhead but the lack of > throughput i.e. you see the number of deleted/updated tuples keeps > increasing in an unbounded fashion, the right way to deal with it is a) > Having higher value of *autovacuum_max_workers* b) lower value for > *autovacuum_naptime*. > Increasing autovacuum_max_workers is unlikely to solve the issue with throughput, because all the workers are throttled together - there's a limit on the amount of work that can be done per second. Increasing the number of workers is akin to allowing more cars on a highway, but also lowering the speed limit. You need to increase the limit on amount of work, and lowering naptime is one way to do that. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services