max_memory_per_backend GUC to limit backend's memory usage

Поиск
Список
Период
Сортировка
От Vladimir Sitnikov
Тема max_memory_per_backend GUC to limit backend's memory usage
Дата
Msg-id CAB=Je-FOuN4Z0itYxxMz3=RZi0BO8ZaJznB6eOfMQU9_TKhaMQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: max_memory_per_backend GUC to limit backend's memory usage  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Hi,

I've got a problem with PostgreSQL 9.6.5: backend gets killed by OOM killer, and it shuts the DB down.
Of course, the OOM case is to be investigated (MemoryContextStatsDetail, etc), however I wonder if DB can be more robust.
The sad thing is a single backend crash results in the DB shutdown, so it interrupts lots of transactions.

I wonder if a GUC can be implemented, so it could fail just a single backend by limiting its memory use.
For instance: max_mememory_per_backend=100MiB.
The idea is to increase stability by limiting each process. Of course it would result in "out of memory" in case a single query requires 100500MiB (e.g. it misunderestimates the hash join). As far as I understand, it should be safer to terminate just one bad backend rather than kill all the processes.

I did some research, and I have not found the discussion of this idea.

Vladimir Rusinov> FWIW, lack of per-connection and/or global memory limit for work_mem is major PITA

Vladimir

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] Surjective functional indexes
Следующее
От: Andres Freund
Дата:
Сообщение: Re: max_memory_per_backend GUC to limit backend's memory usage