pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Tomas Pospisek <tpo2@sourcepole.ch>
To: pgsql-general@lists.postgresql.org
Subject: Re: Properly handle OOM death?
Date: Sun, 19 Mar 2023 09:41:25 -0400
Message-ID: <7bdf809f-c6f0-6fd0-c606-9ee9ed01885a@joeconway.com> (raw)
In-Reply-To: <579584ee-3980-499a-ffdb-40f45f0e80f3@sourcepole.ch>
References: <E1525E23-A751-41C6-AD65-B3BF6C982B06@alaska.edu>
	<20230313174301.23n6crb5dpttozup@hjp.at>
	<B24D8C1B-E275-4E96-8D35-DFA494ECB0F2@alaska.edu>
	<03239776-b0c6-94a8-7bb3-a1af363d745f@joeconway.com>
	<9616AB47-E78B-49FD-81AE-41015E13AADC@alaska.edu>
	<b9b8d1df-08e2-2863-a2d6-48aec9e457f7@joeconway.com>
	<3E19F901-6C7D-44C1-BBFE-11F78F9EE38C@alaska.edu>
	<ec109215-9538-7e13-14a7-dc220d17c44d@joeconway.com>
	<7B4AC414-F5C9-46E8-969E-B629414719FA@alaska.edu>
	<ccdc78ad-5cd4-6d27-5e90-1f46aad28c36@joeconway.com>
	<579584ee-3980-499a-ffdb-40f45f0e80f3@sourcepole.ch>

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






view thread (22+ messages)  latest in thread

Message-ID: <7bdf809f-c6f0-6fd0-c606-9ee9ed01885a@joeconway.com>
Permalink:  ../7bdf809f-c6f0-6fd0-c606-9ee9ed01885a@joeconway.com/
Also on:    postgresql.org/message-id/7bdf809f-c6f0-6fd0-c606-9ee9ed01885a@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: mail@joeconway.com, tpo2@sourcepole.ch
  Subject: Re: Properly handle OOM death?
  In-Reply-To: <7bdf809f-c6f0-6fd0-c606-9ee9ed01885a@joeconway.com>
  References: <E1525E23-A751-41C6-AD65-B3BF6C982B06@alaska.edu> <20230313174301.23n6crb5dpttozup@hjp.at> <B24D8C1B-E275-4E96-8D35-DFA494ECB0F2@alaska.edu> <03239776-b0c6-94a8-7bb3-a1af363d745f@joeconway.com> <9616AB47-E78B-49FD-81AE-41015E13AADC@alaska.edu> <b9b8d1df-08e2-2863-a2d6-48aec9e457f7@joeconway.com> <3E19F901-6C7D-44C1-BBFE-11F78F9EE38C@alaska.edu> <ec109215-9538-7e13-14a7-dc220d17c44d@joeconway.com> <7B4AC414-F5C9-46E8-969E-B629414719FA@alaska.edu> <ccdc78ad-5cd4-6d27-5e90-1f46aad28c36@joeconway.com> <579584ee-3980-499a-ffdb-40f45f0e80f3@sourcepole.ch> <7bdf809f-c6f0-6fd0-c606-9ee9ed01885a@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox