Re: Properly handle OOM death? - Mailing list pgsql-general

From Joe Conway
Subject Re: Properly handle OOM death?
Date
Msg-id 7bdf809f-c6f0-6fd0-c606-9ee9ed01885a@joeconway.com
Whole thread Raw
In response to Re: Properly handle OOM death?  (Tomas Pospisek <tpo2@sourcepole.ch>)
List pgsql-general
On 3/18/23 18:02, Tomas Pospisek wrote:
> On 13.03.23 21:25, Joe Conway wrote:
> 
>> Hmm, well big +1 for having swap turned on, but I recommend setting 
>> "vm.overcommit_memory=2" even so.
> 
> I've snipped out the context here, since my advice is very unspecific:
> do use swap only as a safety net. Once your system starts swapping
> performance goes down the toilet.


While I agree with this statement in principle, it is exactly the notion 
that "once your system starts swapping performance goes down the toilet" 
that leads people to conclude that having lots of memory and disabling 
swap will solve all their problems.

Because of how the Linux kernel works, you should, IMHO, always have 
some swap available. For more on why, see:

https://chrisdown.name/2018/01/02/in-defence-of-swap.html

-- 
Joe Conway
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com




pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Getting error while upgrading postgres from version 12 to 13
Next
From: abdulsayeed24@gmail.com
Date:
Subject: Re[2]: Getting error while upgrading postgres from version 12 to 13