pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: 徐志宇徐 <xuzhiyuster@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: How to monitor Postgres real memory usage
Date: Fri, 27 May 2022 12:56:47 -0500
Message-ID: <20220527175647.GG19626@telsasoft.com> (raw)
In-Reply-To: <CAOCebiKNvnf0XCmLMMv6FrpOtLOsNiJaGweVxZV6uBpTUCRXXg@mail.gmail.com>
References: <CAOCebi+i=HPofBSdvs1RftcZpAHg81R9jqmr5xTJm0dGSDUMNQ@mail.gmail.com>
	<20220524174050.GI19626@telsasoft.com>
	<CAOCebiLgKWe1Erbt-mqWrg6fhv_bBF-O4atZvWQaYoi+rTDvEQ@mail.gmail.com>
	<20220526160519.GB19626@telsasoft.com>
	<CAOCebiJN2TGQ_me=XE3Z6L-rdfZNf=rCh+QtJpExf0VCb8wfcg@mail.gmail.com>
	<20220526233528.GD19626@telsasoft.com>
	<CAOCebiKNvnf0XCmLMMv6FrpOtLOsNiJaGweVxZV6uBpTUCRXXg@mail.gmail.com>

On Sat, May 28, 2022 at 01:40:14AM +0800, 徐志宇徐 wrote:
> vm.swappiness=0

I think this is related to the problem.

swappiness=0 means to *never* use swap, even if that means that processes are
killed.

If you really wanted that, you should remove the swap space.

Swap is extremely slow and worth avoiding, but this doesn't let you use it at
all.  You can't even look at your swap usage as a diagnostic measure to tell if
things had been paged out at some point.

I *suspect* the problem will go away if you set swappiness=1 in /proc (and in
sysctl.conf).

-- 
Justin





view thread (9+ messages)

Message-ID: <20220527175647.GG19626@telsasoft.com>
Permalink:  ../20220527175647.GG19626@telsasoft.com/
Also on:    postgresql.org/message-id/20220527175647.GG19626@telsasoft.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: pryzby@telsasoft.com, xuzhiyuster@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: How to monitor Postgres real memory usage
  In-Reply-To: <20220527175647.GG19626@telsasoft.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