Re: too many clog files

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: too many clog files
Дата
Msg-id Pine.GSO.4.64.0809020117030.6014@westnet.com
обсуждение исходный текст
Ответ на Re: too many clog files  (Duan Ligong <duanlg@nec-as.nec.com.cn>)
Ответы Re: too many clog files  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: too many clog files  (Guillaume Lelarge <guillaume@lelarge.info>)
Re: too many clog files  (Duan Ligong <duanlg@nec-as.nec.com.cn>)
Список pgsql-performance
On Tue, 2 Sep 2008, Duan Ligong wrote:

> - Does Vacuum delete the old clog files?

Yes, if those transactions are all done.  One possibility here is that
you've got some really long-running transaction floating around that is
keeping normal clog cleanup from happening.  Take a look at the output
from "select * from pg_stat_activity" and see if there are any really old
transactions floating around.

> - Can we controll the maximum number of the clog files?

The reference Alvaro suggested at
http://www.postgresql.org/docs/8.3/interactive/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND
goes over that.  If you reduce autovacuum_freeze_max_age, that reduces the
expected maximum size of the clog files.  "The default, 200 million
transactions, translates to about 50MB of pg_clog storage."  If you've got
significantly more than 50MB of files in there, normally that means that
either you're not running vacuum to clean things up usefully, or there's
an old open transaction still floating around.

> - When, or in what case is  a new clog file produced?

Every 32K transactions.  See http://wiki.postgresql.org/wiki/Hint_Bits for
some clarification about what the clog files actually do.  I recently
collected some notes from this list and from the source code README files
to give a high-level view there of what actually goes on under the hood in
this area.

> - Is there a mechanism that the clog files are recycled? If there is ,
> what is the mechanism?

The old ones should get wiped out by vacuum's freezing mechanism.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

В списке pgsql-performance по дате отправления:

Предыдущее
От: Russell Smith
Дата:
Сообщение: Re: limit clause breaks query planner?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: too many clog files