Re: [HACKERS] pg_terminate_backend can terminate background workersand autovacuum launchers

Поиск
Список
Период
Сортировка
От Yugo Nagata
Тема Re: [HACKERS] pg_terminate_backend can terminate background workersand autovacuum launchers
Дата
Msg-id 20170624000156.74ca9485.nagata@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: [HACKERS] pg_terminate_backend can terminate background workersand autovacuum launchers  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [HACKERS] pg_terminate_backend can terminate background workersand autovacuum launchers  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On Thu, 22 Jun 2017 14:08:30 +0900
Michael Paquier <michael.paquier@gmail.com> wrote:

> On Thu, Jun 22, 2017 at 1:52 PM, Yugo Nagata <nagata@sraoss.co.jp> wrote:
> > On Thu, 22 Jun 2017 12:05:19 +0900
> > Michael Paquier <michael.paquier@gmail.com> wrote:
> >> signal-able). Different thought, but I'd love to see a SQL function
> >> that allows triggering SIGHUP on a specific process, like an
> >> autovacuum worker to change its cost parameters. There is
> >> pg_reload_conf() to do so but that's system-wide.
> >
> > For example, is that like this?
> >
> > =# alter system set autovacuum_vacuum_cost_delay to 10;
> > =# select pg_reload_conf(<PID of autovacuum worker)>);
> > =# alter system reset autovacuum_vacuum_cost_delay;
> 
> No need to reset the parameter afterwards as this makes it sensible to
> updates afterwards, but you have the idea. Note that this is rather
> recent, as autovacuum listens to SIGHUP only since a75fb9b3.

I tried to make it. Patch attached. 

It is easy and simple. Although I haven't tried for autovacuum worker,
I confirmed I can change other process' parameters without affecting others.
Do you want this in PG?


[session A (PID:18375)]
=# show autovacuum_vacuum_cost_delay;
 autovacuum_vacuum_cost_delay 
------------------------------
 20ms
(1 row)


[session B]
postgres=# alter system set autovacuum_vacuum_cost_delay to 10;
ALTER SYSTEM
postgres=# select pg_reload_conf(18375);
 pg_reload_conf 
----------------
 t
(1 row)

postgres=# show autovacuum_vacuum_cost_delay;
 autovacuum_vacuum_cost_delay 
------------------------------
 20ms
(1 row)


[session A again]
postgres=# show autovacuum_vacuum_cost_delay;
 autovacuum_vacuum_cost_delay 
------------------------------
 10ms
(1 row)



> -- 
> Michael


-- 
Yugo Nagata <nagata@sraoss.co.jp>

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Broken hint bits (freeze)
Следующее
От: Yugo Nagata
Дата:
Сообщение: Re: [HACKERS] Same expression more than once in partition key