Re: Out of Memory

Поиск
Список
Период
Сортировка
От Christoph Moench-Tegeder
Тема Re: Out of Memory
Дата
Msg-id 20180927063039.n5ea4xuefxtrbusa@squirrel.exwg.net
обсуждение исходный текст
Ответ на Re: Out of Memory  (Laurenz Albe <laurenz.albe@cybertec.at>)
Ответы Re: Out of Memory
Список pgsql-general
## Laurenz Albe (laurenz.albe@cybertec.at):

> vm.overcommit_memory = 2
> vm_overcommit_ratio = 100
> 
> Linux commits (swap * overcommit_ratio * RAM / 100),
                      ^
                      That should be a "+".

See Documentation/sysctl/vm.txt and Documentation/vm/overcommit-accounting.rst
in your kernel tree.

> so without any swap the correct value would be 100.
> 
> I don't know how safe it is to got entirely without swap.

That's completely safe. Even more: if your production machine ever needs
swap, it's already mostly dead in the water. So there's also no benefit in
having the kernel copy stuff to swap "just in case" (read: set sysctl
vm.swappiness to 0) and use the swap disk space for something more
productive. If your memory usage ever exceeds available memory, something
already went horribly wrong, and you want to know about it right now.
A good way to know about this kind of mistakes is having stuff fail
hard, obviously and loudly (i.e. Out Of Memory). Do not try to save
some day by swapping: stuff is "sometimes slow" and if you really need
the swap, everything crawls to a halt anyway.
Of course, this does not hold for personal workstations and
the like where you might want to use the swap space for suspend to
disk, or have some buffer in case of runaway processes.

Regards,
Christoph

-- 
Spare Space.


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

Предыдущее
От: jimmy
Дата:
Сообщение: how to know that one query use the data in the os cache
Следующее
От: Deepti Sharma S
Дата:
Сообщение: RE: [GENERAL] Postgre compatible version with RHEL 7.5