pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to avoid Force Autovacuum
13+ messages / 4 participants
[nested] [flat]
* How to avoid Force Autovacuum
@ 2013-08-07 09:46 Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
0 siblings, 3 replies; 13+ messages in thread
From: Vishalakshi Navaneethakrishnan @ 2013-08-07 09:46 UTC (permalink / raw)
To: pgsql-general@postgresql.org
Hi All,
We have one production database server , having 6 DBs, Postgres 9.2.1
version.
This is my vacuum settings in Production database
#autovacuum = on # Enable autovacuum subprocess?
'on'
# requires track_counts to also be
on.
log_autovacuum_min_duration = 0
autovacuum_vacuum_threshold = 50000 # min number of row updates before
# vacuum
autovacuum_analyze_threshold = 50000
maintenance_work_mem = 2GB # min 1MB
#################
Daily once we are executing "Vacuum Freeze analyze" -- To prevent
transaction id wraparound
using this command
vacuumdb -F -z -h localhost -U postgres dbname
Even sometimes autovacuum running on the databases and increase the load
(Above 200) very much and the server was unresponsive
I have seen the autovacum worker process in top command,
While i executing pg_stat_activity as postgres user, i have seen the pid of
autovacuum process in the result but the query filed is "Empty"
while i check in Pg_class table i got the value as last_autoanalyze_field
is not null in one of the table.
So i am guessing this is the auto analyze query.
But why it increased the load very high?
How can i avoid the autovacuum process ? And also autovacuum executed in
the template0 database also. But I cant connect the database , since it has
"datallowconn=F"
If i update the value to true and then execute "vacuum freeze analyze" will
make any problems?
since template0 has no activities why the age(datfrozenxid) increasing
heavily and reach the thresold value?
Do i need to disable autovacuum for particular tables to avoid force
autovacuum ?
Can you please suggest me in this case?
--
Best Regards,
Vishalakshi.N
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-08 01:29 Sergey Konoplev <gray.ru@gmail.com>
parent: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
2 siblings, 1 reply; 13+ messages in thread
From: Sergey Konoplev @ 2013-08-08 01:29 UTC (permalink / raw)
To: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>; +Cc: pgsql-general <pgsql-general@postgresql.org>
On Wed, Aug 7, 2013 at 2:46 AM, Vishalakshi Navaneethakrishnan
<nvishalakshi@sirahu.com> wrote:
> Daily once we are executing "Vacuum Freeze analyze" -- To prevent
> transaction id wraparound
> using this command
> vacuumdb -F -z -h localhost -U postgres dbname
It is not necessary to do. Autovacuum does it itself where and when needed.
> Even sometimes autovacuum running on the databases and increase the load
> (Above 200) very much and the server was unresponsive
>
> I have seen the autovacum worker process in top command,
> While i executing pg_stat_activity as postgres user, i have seen the pid of
> autovacuum process in the result but the query filed is "Empty"
Was autovacuum the only process that you saw in pg_stat_activity?
What OS do you use?
Do you use huge pages?
--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA
http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-08 04:32 Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
parent: Sergey Konoplev <gray.ru@gmail.com>
0 siblings, 1 reply; 13+ messages in thread
From: Vishalakshi Navaneethakrishnan @ 2013-08-08 04:32 UTC (permalink / raw)
To: Sergey Konoplev <gray.ru@gmail.com>; +Cc: pgsql-general <pgsql-general@postgresql.org>
Hi,
> vacuumdb -F -z -h localhost -U postgres dbname
It is not necessary to do. Autovacuum does it itself where and when needed.
If we did not do this, then autovacuum will occur, Load was very high at
that time and the server was unresponsive, To avoid this we are executing
vacuum freeze analyze everyday.
We are using Centos
cat /etc/issue
CentOS release 6.3 (Final)
cat /proc/meminfo |grep Hugepagesize
Hugepagesize: 2048 kB
On Thu, Aug 8, 2013 at 6:59 AM, Sergey Konoplev <gray.ru@gmail.com> wrote:
> On Wed, Aug 7, 2013 at 2:46 AM, Vishalakshi Navaneethakrishnan
> <nvishalakshi@sirahu.com> wrote:
> > Daily once we are executing "Vacuum Freeze analyze" -- To prevent
> > transaction id wraparound
> > using this command
> > vacuumdb -F -z -h localhost -U postgres dbname
>
> It is not necessary to do. Autovacuum does it itself where and when needed.
>
> > Even sometimes autovacuum running on the databases and increase the load
> > (Above 200) very much and the server was unresponsive
> >
> > I have seen the autovacum worker process in top command,
> > While i executing pg_stat_activity as postgres user, i have seen the pid
> of
> > autovacuum process in the result but the query filed is "Empty"
>
> Was autovacuum the only process that you saw in pg_stat_activity?
>
> What OS do you use?
>
> Do you use huge pages?
>
> --
> Kind regards,
> Sergey Konoplev
> PostgreSQL Consultant and DBA
>
> http://www.linkedin.com/in/grayhemp
> +1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
> gray.ru@gmail.com
>
--
Best Regards,
Vishalakshi.N
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-08 05:27 Sergey Konoplev <gray.ru@gmail.com>
parent: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
0 siblings, 1 reply; 13+ messages in thread
From: Sergey Konoplev @ 2013-08-08 05:27 UTC (permalink / raw)
To: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>; +Cc: pgsql-general <pgsql-general@postgresql.org>
On Wed, Aug 7, 2013 at 9:32 PM, Vishalakshi Navaneethakrishnan
<nvishalakshi@sirahu.com> wrote:
> cat /etc/issue
> CentOS release 6.3 (Final)
>
> cat /proc/meminfo |grep Hugepagesize
> Hugepagesize: 2048 kB
Please show what commands below print.
cat /proc/meminfo | grep -i huge
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag
--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA
http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-08 05:54 Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
parent: Sergey Konoplev <gray.ru@gmail.com>
0 siblings, 0 replies; 13+ messages in thread
From: Vishalakshi Navaneethakrishnan @ 2013-08-08 05:54 UTC (permalink / raw)
To: Sergey Konoplev <gray.ru@gmail.com>; +Cc: pgsql-general <pgsql-general@postgresql.org>
cat /proc/meminfo | grep -i huge
AnonHugePages: 31576064 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
[always] never
cat /sys/kernel/mm/redhat_transparent_hugepage/defrag
[always] never
On Thu, Aug 8, 2013 at 10:57 AM, Sergey Konoplev <gray.ru@gmail.com> wrote:
> On Wed, Aug 7, 2013 at 9:32 PM, Vishalakshi Navaneethakrishnan
> <nvishalakshi@sirahu.com> wrote:
> > cat /etc/issue
> > CentOS release 6.3 (Final)
> >
> > cat /proc/meminfo |grep Hugepagesize
> > Hugepagesize: 2048 kB
>
> Please show what commands below print.
>
> cat /proc/meminfo | grep -i huge
> cat /sys/kernel/mm/transparent_hugepage/enabled
> cat /sys/kernel/mm/transparent_hugepage/defrag
>
> --
> Kind regards,
> Sergey Konoplev
> PostgreSQL Consultant and DBA
>
> http://www.linkedin.com/in/grayhemp
> +1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
> gray.ru@gmail.com
>
--
Best Regards,
Vishalakshi.N
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-08 18:18 Kevin Grittner <kgrittn@ymail.com>
parent: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
2 siblings, 1 reply; 13+ messages in thread
From: Kevin Grittner @ 2013-08-08 18:18 UTC (permalink / raw)
To: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com> wrote:
> We have one production database server , having 6 DBs, Postgres
> 9.2.1 version.
There were some fixes for autovacuum problems in 9.2.3. Some other
fixes will be coming when 9.2.5 is released. Many of your problems
are likely to go away by staying up-to-date on minor releases.
http://www.postgresql.org/support/versioning/
> autovacuum_vacuum_threshold = 50000
By setting this so high, you are increasing the amount of work
autovacuum will need to do when it does work on a table. A smaller
value tends to give less "bursty" performance. Also, any small,
frequently-updated tables may bloat quite a bit in 50000
transactions.
> maintenance_work_mem = 2GB
Each autovacuum worker will allocate this much RAM. If all of your
autovacuum workers wake up at once, would losing 2GB for each one
from your cache cause a significant performance hit? (Since you
didn't say how much RAM the machine has, it's impossible to tell.)
> How can i avoid the autovacuum process ?
Vacuuming is a necessary part of PostgreSQL operations, and
autovacuum is almost always part of a good vacuum plan. The bug
fixes in 9.2.3 will help avoid some of the most extreme problems,
but you might also want to reduce the threshold so that it has less
work to do each time it wakes up, reducing the impact.
> And also autovacuum executed in the template0 database also.
What does running this in psql this show?:
\x on
select * from pg_database where datname = 'template0';
select * from pg_stat_database where datname = 'template0';
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-08 23:51 Sergey Konoplev <gray.ru@gmail.com>
parent: Kevin Grittner <kgrittn@ymail.com>
0 siblings, 1 reply; 13+ messages in thread
From: Sergey Konoplev @ 2013-08-08 23:51 UTC (permalink / raw)
To: Kevin Grittner <kgrittn@ymail.com>; +Cc: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>
On Thu, Aug 8, 2013 at 11:18 AM, Kevin Grittner <kgrittn@ymail.com> wrote:
> There were some fixes for autovacuum problems in 9.2.3. Some other
> fixes will be coming when 9.2.5 is released. Many of your problems
> are likely to go away by staying up-to-date on minor releases.
>
> By setting this so high, you are increasing the amount of work
> autovacuum will need to do when it does work on a table. A smaller
> value tends to give less "bursty" performance. Also, any small,
> frequently-updated tables may bloat quite a bit in 50000
> transactions.
>
> Each autovacuum worker will allocate this much RAM. If all of your
> autovacuum workers wake up at once, would losing 2GB for each one
> from your cache cause a significant performance hit? (Since you
> didn't say how much RAM the machine has, it's impossible to tell.)
>
> What does running this in psql this show?:
>
> \x on
> select * from pg_database where datname = 'template0';
> select * from pg_stat_database where datname = 'template0';
In addition to Kevin's notes, I think it is also worth to look at the
result of the query below.
select name, setting from pg_settings
where name ~ 'vacuum' and setting <> reset_val;
--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA
http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-09 05:59 Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
parent: Sergey Konoplev <gray.ru@gmail.com>
0 siblings, 2 replies; 13+ messages in thread
From: Vishalakshi Navaneethakrishnan @ 2013-08-09 05:59 UTC (permalink / raw)
To: Sergey Konoplev <gray.ru@gmail.com>; +Cc: Kevin Grittner <kgrittn@ymail.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Hi All,
select * from pg_database where datname = 'template0';
-[ RECORD 1 ]-+------------------------------------
datname | template0
datdba | 10
encoding | 6
datcollate | en_US.UTF-8
datctype | en_US.UTF-8
datistemplate | t
datallowconn | f
datconnlimit | -1
datlastsysoid | 12865
datfrozenxid | 2025732249
dattablespace | 1663
datacl | {=c/postgres,postgres=CTc/postgres}
select * from pg_stat_database where datname = 'template0';
-[ RECORD 1 ]--+------------------------------
datid | 12865
datname | template0
numbackends | 0
xact_commit | 320390
xact_rollback | 7
blks_read | 3797
blks_hit | 9458783
tup_returned | 105872028
tup_fetched | 1771782
tup_inserted | 10
tup_updated | 457
tup_deleted | 10
conflicts | 0
temp_files | 0
temp_bytes | 0
deadlocks | 0
blk_read_time | 0
blk_write_time | 0
stats_reset | 2013-04-19 19:22:39.013056-07
select name, setting from pg_settings where name ~ 'vacuum';
name | setting
---------------------------------+-----------
autovacuum | on
autovacuum_analyze_scale_factor | 0.1
autovacuum_analyze_threshold | 50000
autovacuum_freeze_max_age | 200000000
autovacuum_max_workers | 3
autovacuum_naptime | 60
autovacuum_vacuum_cost_delay | 20
autovacuum_vacuum_cost_limit | -1
autovacuum_vacuum_scale_factor | 0.2
autovacuum_vacuum_threshold | 50000
log_autovacuum_min_duration | 0
vacuum_cost_delay | 0
vacuum_cost_limit | 200
vacuum_cost_page_dirty | 20
vacuum_cost_page_hit | 1
vacuum_cost_page_miss | 10
vacuum_defer_cleanup_age | 0
vacuum_freeze_min_age | 50000000
vacuum_freeze_table_age | 150000000
(19 rows)
*Our Physical RAM size is 256GB*
*
*
Please note : we are executing standard vacuum daily (Manual Vacuum) --
Vacuum freeze analyze..
*But during manual vacuum -- the load is normal* -- for all databases (
load is in 1 to 2)
*Load increased to 200 during autovacuum process..*
*
*
[Previously i had set maintenance_work_mem as 256MB at that time manual
vacuum increased the load to 300. Then only i have increased the
maintenance work memory to 2GB, Now manual vacuum is fine, Load is normal
during vacuum process, so our application is fine during vacuum process
also ]
*
*
*Now the problem is autovacuum.. why it was invoked and increased the load?
How to avoid this? *
*
*
On Fri, Aug 9, 2013 at 5:21 AM, Sergey Konoplev <gray.ru@gmail.com> wrote:
> On Thu, Aug 8, 2013 at 11:18 AM, Kevin Grittner <kgrittn@ymail.com> wrote:
> > There were some fixes for autovacuum problems in 9.2.3. Some other
> > fixes will be coming when 9.2.5 is released. Many of your problems
> > are likely to go away by staying up-to-date on minor releases.
> >
> > By setting this so high, you are increasing the amount of work
> > autovacuum will need to do when it does work on a table. A smaller
> > value tends to give less "bursty" performance. Also, any small,
> > frequently-updated tables may bloat quite a bit in 50000
> > transactions.
> >
> > Each autovacuum worker will allocate this much RAM. If all of your
> > autovacuum workers wake up at once, would losing 2GB for each one
> > from your cache cause a significant performance hit? (Since you
> > didn't say how much RAM the machine has, it's impossible to tell.)
> >
> > What does running this in psql this show?:
> >
> > \x on
> > select * from pg_database where datname = 'template0';
> > select * from pg_stat_database where datname = 'template0';
>
> In addition to Kevin's notes, I think it is also worth to look at the
> result of the query below.
>
> select name, setting from pg_settings
> where name ~ 'vacuum' and setting <> reset_val;
>
> --
> Kind regards,
> Sergey Konoplev
> PostgreSQL Consultant and DBA
>
> http://www.linkedin.com/in/grayhemp
> +1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
> gray.ru@gmail.com
>
--
Best Regards,
Vishalakshi.N
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-09 06:24 Sergey Konoplev <gray.ru@gmail.com>
parent: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
1 sibling, 0 replies; 13+ messages in thread
From: Sergey Konoplev @ 2013-08-09 06:24 UTC (permalink / raw)
To: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>; +Cc: Kevin Grittner <kgrittn@ymail.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>
On Thu, Aug 8, 2013 at 10:59 PM, Vishalakshi Navaneethakrishnan
<nvishalakshi@sirahu.com> wrote:
> Now the problem is autovacuum.. why it was invoked and increased the load?
> How to avoid this?
Upgrade to the latest minor version 9.2.4 first.
--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA
http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-09 16:06 Kevin Grittner <kgrittn@ymail.com>
parent: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
1 sibling, 1 reply; 13+ messages in thread
From: Kevin Grittner @ 2013-08-09 16:06 UTC (permalink / raw)
To: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>; Sergey Konoplev <gray.ru@gmail.com>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com> wrote:
> select * from pg_database where datname = 'template0';
> -[ RECORD 1 ]-+------------------------------------
> datname | template0
> datdba | 10
> encoding | 6
> datcollate | en_US.UTF-8
> datctype | en_US.UTF-8
> datistemplate | t
> datallowconn | f
> datconnlimit | -1
> datlastsysoid | 12865
> datfrozenxid | 2025732249
> dattablespace | 1663
> datacl | {=c/postgres,postgres=CTc/postgres}
>
>
> select * from pg_stat_database where datname = 'template0';
> -[ RECORD 1 ]--+------------------------------
> datid | 12865
> datname | template0
> numbackends | 0
> xact_commit | 320390
> xact_rollback | 7
> blks_read | 3797
> blks_hit | 9458783
> tup_returned | 105872028
> tup_fetched | 1771782
> tup_inserted | 10
> tup_updated | 457
> tup_deleted | 10
> conflicts | 0
> temp_files | 0
> temp_bytes | 0
> deadlocks | 0
> blk_read_time | 0
> blk_write_time | 0
> stats_reset | 2013-04-19 19:22:39.013056-07
Well, that's why template0 is getting vacuumed. At some point
someone must have set it to allow connections; otherwise you would
have zero for commits, rollbacks, and all those block and tuple
counts. I'm not sure whether you can get past that now by allowing
connctions, running VACUUM FREEZE ANALYZE on it, and disabling
connections again, but it might be wroth a try.
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-09 18:37 Jeff Janes <jeff.janes@gmail.com>
parent: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
2 siblings, 0 replies; 13+ messages in thread
From: Jeff Janes @ 2013-08-09 18:37 UTC (permalink / raw)
To: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>; +Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
On Wed, Aug 7, 2013 at 2:46 AM, Vishalakshi Navaneethakrishnan
<nvishalakshi@sirahu.com> wrote:
> Hi All,
>
> We have one production database server , having 6 DBs, Postgres 9.2.1
> version.
>
You should probably upgrade to 9.2.4.
...
> log_autovacuum_min_duration = 0
That is good for debugging. But what are you seeing in the log as the
result of this?
>
> Even sometimes autovacuum running on the databases and increase the load
> (Above 200) very much and the server was unresponsive
>
> I have seen the autovacum worker process in top command,
How certain are you that the autovacuum is causing the high load? The
simple fact that you see it show up in top is not very compelling
evidence. It seems at least as likely to me that autovacuum is just
another victim, and not the cause
> While i executing pg_stat_activity as postgres user, i have seen the pid of
> autovacuum process in the result but the query filed is "Empty"
I've never seen that. I always see a query of something like
"autovacuum: VACUUM public.pgbench_accounts (to prevent wraparound)".
I don't know what part of the vacuuming process you might be stuck at
which would not have such a query--I would think it would have to be
either during the start-up phase or the shut-down phase. Could you
attach to the worker with gdb when this is going on, and get a
backtrace?
>
> since template0 has no activities why the age(datfrozenxid) increasing
> heavily and reach the thresold value?
Time marches on. If datfrozenxid is not changed, but the current xid
advances, then the age of the datfrozenzid must increase.
Cheers,
Jeff
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-09 18:53 Jeff Janes <jeff.janes@gmail.com>
parent: Kevin Grittner <kgrittn@ymail.com>
0 siblings, 1 reply; 13+ messages in thread
From: Jeff Janes @ 2013-08-09 18:53 UTC (permalink / raw)
To: Kevin Grittner <kgrittn@ymail.com>; +Cc: Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>; Sergey Konoplev <gray.ru@gmail.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>
On Fri, Aug 9, 2013 at 9:06 AM, Kevin Grittner <kgrittn@ymail.com> wrote:
> Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com> wrote:
>
>> select * from pg_database where datname = 'template0';
>> -[ RECORD 1 ]-+------------------------------------
>> datname | template0
>> datdba | 10
>> encoding | 6
>> datcollate | en_US.UTF-8
>> datctype | en_US.UTF-8
>> datistemplate | t
>> datallowconn | f
>> datconnlimit | -1
>> datlastsysoid | 12865
>> datfrozenxid | 2025732249
>> dattablespace | 1663
>> datacl | {=c/postgres,postgres=CTc/postgres}
>>
>>
>> select * from pg_stat_database where datname = 'template0';
>> -[ RECORD 1 ]--+------------------------------
>> datid | 12865
>> datname | template0
>> numbackends | 0
>> xact_commit | 320390
>> xact_rollback | 7
>> blks_read | 3797
>> blks_hit | 9458783
>> tup_returned | 105872028
>> tup_fetched | 1771782
>> tup_inserted | 10
>> tup_updated | 457
>> tup_deleted | 10
>> conflicts | 0
>> temp_files | 0
>> temp_bytes | 0
>> deadlocks | 0
>> blk_read_time | 0
>> blk_write_time | 0
>> stats_reset | 2013-04-19 19:22:39.013056-07
>
> Well, that's why template0 is getting vacuumed. At some point
> someone must have set it to allow connections; otherwise you would
> have zero for commits, rollbacks, and all those block and tuple
> counts.
Non-zero values are normal. There is no mechanism to prevent
template0 from getting vacuumed. template0 will get vacuumed once
every autovacuum_freeze_max_age even if no one has ever connected to
it, and that vacuum will cause block reads and writes to happen. (But
I'm not sure why it would contribute xact_rollback or tup_updated, and
the tup_returned seems awfully high to be due to only anti-wrap-around
vacs.)
Cheers,
Jeff
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
^ permalink raw reply [nested|flat] 13+ messages in thread
* Re: How to avoid Force Autovacuum
@ 2013-08-13 11:37 Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
parent: Jeff Janes <jeff.janes@gmail.com>
0 siblings, 0 replies; 13+ messages in thread
From: Vishalakshi Navaneethakrishnan @ 2013-08-13 11:37 UTC (permalink / raw)
To: Jeff Janes <jeff.janes@gmail.com>; +Cc: Kevin Grittner <kgrittn@ymail.com>; Sergey Konoplev <gray.ru@gmail.com>; pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Hi Team,
Today also we faced issue in autovacuum.. Is there any workaround for this
instead of upgrading,, If yes means can you please give me tuning
parameters..
> log_autovacuum_min_duration = 0
That is good for debugging. But what are you seeing in the log as the
result of this?
There is nothing logged during autovacuum
This is the Pid in Pg_stat_activity
postgres=# select * from pg_stat_activity where pid=25769;
datid | datname | pid | usesysid | usename | application_name |
client_addr | client_hostname | client_port | backend_start
| xact_start | query_start | state_change | waiting |
state | query
-------+---------+-------+----------+----------+------------------+-------------+-----------------+-------------+-------------------------------+-------------------------------+-------------+--------------+---------+-------+-------
16408 | db1 | 25769 | 10 | postgres | |
| | | 2013-08-13 04:00:14.767093-07 |
2013-08-13 04:00:14.765484-07 | | | f |
|
(1 row)
This is the top command:
postgres 25769 30705 93 03:54 ? 00:01:45 postgres: autovacuum worker
process db1
postgres 24680 30705 84 03:55 ? 00:00:33 postgres: autovacuum worker
process db2
postgres 24692 30705 79 03:55 ? 00:00:26 postgres: autovacuum worker
process db3
On Sat, Aug 10, 2013 at 12:23 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
> On Fri, Aug 9, 2013 at 9:06 AM, Kevin Grittner <kgrittn@ymail.com> wrote:
> > Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com> wrote:
> >
> >> select * from pg_database where datname = 'template0';
> >> -[ RECORD 1 ]-+------------------------------------
> >> datname | template0
> >> datdba | 10
> >> encoding | 6
> >> datcollate | en_US.UTF-8
> >> datctype | en_US.UTF-8
> >> datistemplate | t
> >> datallowconn | f
> >> datconnlimit | -1
> >> datlastsysoid | 12865
> >> datfrozenxid | 2025732249
> >> dattablespace | 1663
> >> datacl | {=c/postgres,postgres=CTc/postgres}
> >>
> >>
> >> select * from pg_stat_database where datname = 'template0';
> >> -[ RECORD 1 ]--+------------------------------
> >> datid | 12865
> >> datname | template0
> >> numbackends | 0
> >> xact_commit | 320390
> >> xact_rollback | 7
> >> blks_read | 3797
> >> blks_hit | 9458783
> >> tup_returned | 105872028
> >> tup_fetched | 1771782
> >> tup_inserted | 10
> >> tup_updated | 457
> >> tup_deleted | 10
> >> conflicts | 0
> >> temp_files | 0
> >> temp_bytes | 0
> >> deadlocks | 0
> >> blk_read_time | 0
> >> blk_write_time | 0
> >> stats_reset | 2013-04-19 19:22:39.013056-07
> >
> > Well, that's why template0 is getting vacuumed. At some point
> > someone must have set it to allow connections; otherwise you would
> > have zero for commits, rollbacks, and all those block and tuple
> > counts.
>
> Non-zero values are normal. There is no mechanism to prevent
> template0 from getting vacuumed. template0 will get vacuumed once
> every autovacuum_freeze_max_age even if no one has ever connected to
> it, and that vacuum will cause block reads and writes to happen. (But
> I'm not sure why it would contribute xact_rollback or tup_updated, and
> the tup_returned seems awfully high to be due to only anti-wrap-around
> vacs.)
>
> Cheers,
>
> Jeff
>
--
Best Regards,
Vishalakshi.N
^ permalink raw reply [nested|flat] 13+ messages in thread
end of thread, other threads:[~2013-08-13 11:37 UTC | newest]
Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-08-07 09:46 How to avoid Force Autovacuum Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
2013-08-08 01:29 ` Sergey Konoplev <gray.ru@gmail.com>
2013-08-08 04:32 ` Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
2013-08-08 05:27 ` Sergey Konoplev <gray.ru@gmail.com>
2013-08-08 05:54 ` Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
2013-08-08 18:18 ` Kevin Grittner <kgrittn@ymail.com>
2013-08-08 23:51 ` Sergey Konoplev <gray.ru@gmail.com>
2013-08-09 05:59 ` Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
2013-08-09 06:24 ` Sergey Konoplev <gray.ru@gmail.com>
2013-08-09 16:06 ` Kevin Grittner <kgrittn@ymail.com>
2013-08-09 18:53 ` Jeff Janes <jeff.janes@gmail.com>
2013-08-13 11:37 ` Vishalakshi Navaneethakrishnan <nvishalakshi@sirahu.com>
2013-08-09 18:37 ` Jeff Janes <jeff.janes@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox