postgres vacuum memory limits

Поиск
Список
Период
Сортировка
От Ayub M
Тема postgres vacuum memory limits
Дата
Msg-id CAOS0qEtNxAaG9gR+WATt8p2JgyjmfucgQD-ccoXPYgd0syD50w@mail.gmail.com
обсуждение исходный текст
Ответы Re: postgres vacuum memory limits  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: postgres vacuum memory limits  (Vijaykumar Jain <vijaykumarjain.github@gmail.com>)
Список pgsql-general

Hello, when maintenance_work_mem and autovacuum_work_mem are set, my understanding is that the vacuum and autovacuum sessions should be limited to use the memory limits set by these parameters. But I am seeing more memory being used than these limits by autovacuum sessions, any reason why this would happen?

Please see below examples, where maintenance_work_mem is set to 20mb and shared_buffers is 128mb. When I see the memory for this session in top, it shows 162mb. But when default_statistics_target is increased to 3000, the session usage is 463mb, which is way more than 20mb maintenance_work_mem and 128mb shared_buffer. Shouldn't the process memory be capped to 20+128mb?


postgres=# show maintenance_work_mem ; maintenance_work_mem 
---------------------- 20MB
(1 row)
postgres=# vacuum analyze mdm_context;
VACUUM
postgres=# show shared_buffers; shared_buffers 
---------------- 128MB
(1 row)
   PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                                                                             62246 postgres  20   0  422892 165996 139068 R 57.1 15.7  25:06.34 postgres: postgres postgres [local] VACUUM    


postgres=# show default_statistics_target; default_statistics_target 
--------------------------- 100
(1 row)
postgres=# set default_statistics_target=3000;
SET
postgres=# vacuum analyze mdm_context;
VACUUM
    PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                                                                             62246 postgres  20   0  876132 474384   2976 R 62.9 47.6  25:11.41 postgres: postgres postgres [local] VACUUM     

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Help with writing a generate_series(tsmultirange, interval)
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: postgres vacuum memory limits