Re: Per table autovacuum vacuum cost limit behaviour strange

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Per table autovacuum vacuum cost limit behaviour strange
Date: 2014-02-14 01:19:56
Message-ID: CAJrrPGeDEYpvHoR4m-cs2Ct9wTC3bqurreHNyVGC8smS7eig+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 13, 2014 at 3:31 PM, Mark Kirkwood wrote:

> On 13/02/14 17:13, Haribabu Kommi wrote:
>
>> When I go through the code for checking the same, I got the following
>> behavior.
>>
>> The default values of vacuum parameters - cost_limit - 200 and cost_delay
>> -
>> 0
>> The default values of auto vacuum parameters - cost_limit - (-1) and
>> cost_delay - 20ms.
>>
>> 1. User is not provided any vacuum parameters to the table, so the vacuum
>> options for the table are cost_limit - 200 and cost_delay - 20
>> 2. User is provided cost_limit as 1000 to the table, so the vacuum options
>> for the table are cost_limit - 1000 and cost_delay - 20
>>
>> For the above two cases, the "autovac_balance_cost" function sets the cost
>> parameters as cost_limit - 200 and cost_delay - 20.
>>
>> 3. User is provided cost_limit as 1000 and cost_delay as 10 to the table,
>> so the vacuum options for the table are cost_limit - 1000 and cost_delay -
>> 10
>>
>> This case the cost_limit - 100 and cost_delay - 10.
>>
>> 4. User is provided cost_limit as 1000 and cost_delay as 100 to the table,
>> so the vacuum options for the table are cost_limit - 1000 and cost_delay -
>> 100
>>
>> This case the cost_limit - 1000 and cost_delay - 100
>>
>> From the above observations, The cost parameters of vacuum are not
>> working
>> as they specified.
>> please correct me if anything wrong in my observation.
>>
>>
> FWIW - I can confirm these calculations in 9.4devel. I found the attached
> patch handy for logging what the balanced limit and delay was.
>

I changed the balance cost calculations a little bit to give priority to
the user provided per table autovacuum parameters.
If any user specified per table vacuum parameters exists and those are
different with guc vacuum parameters then the
balance cost calculations will not include that worker in calculation. Only
the cost is distributed between other workers
with specified guc vacuum cost parameter.

The problem in this calculation is if the user provides same guc values to
the per table values also then it doesn't consider them in calculation.
Patch is attached in the mail. please provide you suggestions or
corrections in this approach.

Regards,
Hari Babu
Fujitsu Australia

Attachment Content-Type Size
per_table_vacuum_para_v1.patch application/octet-stream 3.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message digoal 2014-02-14 01:55:07 Re: BUG #9210: PostgreSQL string store bug? not enforce check with correct characterSET/encoding
Previous Message Tom Lane 2014-02-14 01:11:10 Re: narwhal and PGDLLIMPORT