Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPObr-004OnP-Us for pgsql-general@arkaria.postgresql.org; Thu, 04 Jul 2024 15:43:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sPObo-000qER-Du for pgsql-general@arkaria.postgresql.org; Thu, 04 Jul 2024 15:42:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPObn-000qBy-E2 for pgsql-general@lists.postgresql.org; Thu, 04 Jul 2024 15:42:56 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPObl-000OHh-28 for pgsql-general@postgresql.org; Thu, 04 Jul 2024 15:42:54 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 3C45F13800AF; Thu, 4 Jul 2024 11:42:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 04 Jul 2024 11:42:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1720107772; x=1720194172; bh=vPSEN4WiQJcKbmJQpyF0ujYO6spVLxK7wypOYsfjTUA=; b= IPk5rdkf/nwgehiKKdfglczNvGDGsqRHVHIghhsssHkJY5sqoTqC62JqEegB9AWZ jt4+cTDxWGtRNh7y00Y/gzYWiKAADxRYjJFISjoYhqRTMINjpbKUnBpjUkY5mXOD iVG5JpLkZDDa8pBSRHWMWwlNqpWhNOdCAXGQo9uQ18SMwV6vXHL2T9z4R+wekqy9 uzkkzpaktXXz7GextR7MDjMvE8x94jSt7Jv8XTYioXxG/ObZ5fr3WrLWjgWinVQ8 In4qscLVbaIjGdsv3Y5vw8fn9QmJyD49pwTnemHgHMQGldUNVIm0Wa70pq22bngn 4BqqCU9VaWcbYhNf+kTd1A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720107772; x= 1720194172; bh=vPSEN4WiQJcKbmJQpyF0ujYO6spVLxK7wypOYsfjTUA=; b=V El6LjlTBIq7cjbfP6vRdoAnZcH2e9DDhjP5f129Wtz4h14/9bUZVx4hmFt9cbzqp 5HE9MxKbMu7nZivV5a2yrthC/QDnQGDGgl1aT2WZKqiXMtxB241gOdIeFBHzCn+a AGERSXBeSZpPGa4FP6NtPoRwfoCUzmbnXNrycWGsvRi3MaPhlDkY0ajRIPD67p7m J9nu7XY/iT9tkmJukhmQ4eeR2/75fyZb/tkUzFWqxiIwKY9r12evJx6vGspKVIY7 m1Q7pYYAhVZ4cq9OGD9l0NpRDkXci5VrjeGHzSoikTv3zt8UkYOKQv97nxQYbMiu u/oZcqHWnfI4VP4vUyFVw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudelgdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepffelgeeifefgveduhedthfekuedtffejveegffegjeev tdehgfduieetfeehjeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Jul 2024 11:42:51 -0400 (EDT) Message-ID: <3f683e09-d229-42dd-b299-986d61c201aa@aklaver.com> Date: Thu, 4 Jul 2024 08:42:50 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Configure autovacuum To: "Shenavai, Manuel" , pgsql-general References: <8d268806-6162-4c31-a516-e3b1c13024b5@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/4/24 08:16, Shenavai, Manuel wrote: > We see that our DB keeps increasing under high load (many updates). We see that our DB has a size of 200GB and we got 199GB bloat, 0 dead tuple. And when the DB is put on high load (many updates), we still see that the DB size grows. We try to find parameters to avoid DB growth. Show your work: 1) How did you determine the bloat number? 2) How did you determine there are 0 dead tuples? 3) Define high load. 4) Postgres version? 5) What are your autovacuum settings? > > I think we need to tweak the autovacuum settings and maybe limit the volume of data that can be written to the DB. That will need to happen on client end. > > Is there any setting in postgres that would allow to write only certain volume? For example, limit the amount of data that can be written to a table to 100MB/minute. > > Best regards, > Manuel > > -----Original Message----- > From: Adrian Klaver > Sent: 14 June 2024 16:32 > To: Shenavai, Manuel ; pgsql-general > Subject: Re: Configure autovacuum > > On 6/13/24 23:20, Shenavai, Manuel wrote: >> Hi everyone, >> >> I would like to configure the autovacuum in a way that it runs very >> frequently (i.e. after each update-statement). I tried the following > > Why? > > What is the problem you are trying to solve? > >> settings on my table: >> >> alter table mytable set (autovacuum_vacuum_scale_factor  = 0.0); >> >> alter table mytable set (autovacuum_vacuum_cost_delay  = 0.0); >> >> alter table mytable set (autovacuum_vacuum_cost_limit  = 10000); >> >> alter table mytable set (autovacuum_vacuum_threshold  = 1); >> >> I do a lot of updates on a single tuple and I would expect that the >> autovacuum would start basically after each update (due to >> autovacuum_vacuum_threshold=1). But the autovacuum is not running. >> >> Is it possible to configure postgres to autovacuum very aggressively >> (i.e. after each update-statement)? >> >> Thanks in advance & >> >> Best regards, >> >> Manuel >> > -- Adrian Klaver adrian.klaver@aklaver.com