From: Tobias Brox <tobias@nordicbet.com>
To: Edoardo Ceccarelli <eddy@axa.it>
Cc: pgsql-performance@postgresql.org
Subject: Re: autovacuum on a -mostly- r/o table
Date: Wed, 27 Sep 2006 18:53:36 +0200
Message-ID: <20060927165336.GA11191@oppetid.no> (raw)
In-Reply-To: <451AAB93.6010602@axa.it>
References: <451AA1FE.9050704@axa.it>
<1159374712.46586.47.camel@home>
<451AAB93.6010602@axa.it>
[Edoardo Ceccarelli - Wed at 06:49:23PM +0200]
> ...another thing is, how could autovacuum check for machine load, this
> is something I cannot imagine right now...
One solution I made for our application, is to check the
pg_stats_activity view. It requires some config to get the stats
available in that view, though. When the application is to start a
low-priority transaction, it will first do:
select count(*) from pg_stat_activity where current_query not like
'<IDL%' and query_start+?<now();
if the returned value is high, the application will sleep a bit and try
again later.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tobias@nordicbet.com, eddy@axa.it
Subject: Re: autovacuum on a -mostly- r/o table
In-Reply-To: <20060927165336.GA11191@oppetid.no>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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