Re: VACUUM

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: "Dmitry E(dot) Oboukhov" <unera(at)debian(dot)org>
Cc: pgsql-ru-general <pgsql-ru-general(at)postgresql(dot)org>
Subject: Re: VACUUM
Date: 2013-08-06 02:11:29
Message-ID: CAL_0b1vEt4zxf_Sk_q_dZpmkCDWd4igHSimB1Kn3qN6tSTpTBw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ru-general

2013/8/5 Dmitry E. Oboukhov <unera(at)debian(dot)org>:
> настройки про автовакуум у постгри дефолтные.
> pgtop показывает что автовакуум процесс появляется/пропадает.
>
> все бы ничего, но VACUUM команад кладет сервак на большое время.

VACUUM или VACUUM FULL. Просто VACUUM не должен по идее так делать.

> что покрутить?

1. Обновиться до последнего минорного релиза версий 9+, т.к. там есть
вот такой очень полезный фикс:

Fix performance problems with autovacuum truncation in busy workloads
(Jan Wieck)

Truncation of empty pages at the end of a table requires exclusive
lock, but autovacuum was coded to fail (and release the table lock)
when there are conflicting lock requests. Under load, it is easily
possible that truncation would never occur, resulting in table bloat.
Fix by performing a partial truncation, releasing the lock, then
attempting to re-acquire the lock and continue. This fix also greatly
reduces the average time before autovacuum releases the lock after a
conflicting request arrives.

2. Настроить autovacuum более агрессивно, например

autovacuum_max_workers = 5
autovacuum_naptime = 1s
autovacuum_vacuum_scale_factor = 0.05
autovacuum_analyze_scale_factor = 0.05
autovacuum_vacuum_cost_delay = 5ms

3. Если ничего выше не поможет посмотреть в строну
https://code.google.com/p/pgtoolkit/ или
https://github.com/reorg/pg_repack

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

Profile: http://www.linkedin.com/in/grayhemp
Phone: USA +1 (415) 867-9984, Russia +7 (901) 903-0499, +7 (988) 888-1979
Skype: gray-hemp
Jabber: gray(dot)ru(at)gmail(dot)com

In response to

  • VACUUM at 2013-08-05 19:29:46 from Dmitry E. Oboukhov

Responses

  • Re: VACUUM at 2013-08-06 05:26:10 from Alex Gorbachenko

Browse pgsql-ru-general by date

  From Date Subject
Next Message Alex Gorbachenko 2013-08-06 05:26:10 Re: VACUUM
Previous Message Dmitry E. Oboukhov 2013-08-05 19:29:46 VACUUM