Re: How to monitor Postgres real memory usage

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: 徐志宇徐 <xuzhiyuster(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: How to monitor Postgres real memory usage
Date: 2022-05-27 17:56:47
Message-ID: 20220527175647.GG19626@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2022-05-27 18:02:11 Re: rows selectivity overestimate for @> operator for arrays
Previous Message 徐志宇徐 2022-05-27 17:40:14 Re: How to monitor Postgres real memory usage