From: Justin Pryzby <pryzby@telsasoft.com>
To: tao tony <tonytao0505@outlook.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: checkpoint and recovering process use too much memory
Date: Thu, 2 Nov 2017 21:21:28 -0500
Message-ID: <20171103022128.GC2267@telsasoft.com> (raw)
In-Reply-To: <MWHPR13MB13894E7F131611EE294091E1AA5D0@MWHPR13MB1389.namprd13.prod.outlook.com>
References: <MWHPR13MB13894E7F131611EE294091E1AA5D0@MWHPR13MB1389.namprd13.prod.outlook.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>
On Fri, Nov 03, 2017 at 01:43:32AM +0000, tao tony wrote:
> I had an asynchronous steaming replication HA cluster.Each node had 64G memory.pg is 9.6.2 and deployed on centos 6.
>
> Last month the database was killed by OS kernel for OOM,the checkpoint process was killed.
If you still have logs, was it killed during a large query? Perhaps one using
a hash aggregate?
> I noticed checkpoint process occupied memory for more than 20GB,and it was growing everyday.In the hot-standby node,the recovering process occupied memory as big as checkpoint process.
"resident" RAM of a postgres subprocess is often just be the fraction of
shared_buffers it's read/written. checkpointer must necessarily read all dirty
pages from s-b and write out to disk (by way of page cache), so that's why its
RSS is nearly 32GB. And the recovery process is continuously writing into s-b.
> Now In the standby node,checkpoint and recovering process used more then 50GB memory as below,and I worried someday the cluster would be killed by OS again.
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 167158 postgres 20 0 34.9g 25g 25g S 0.0 40.4 46:36.86 postgres: startup process recovering 00000004000008550000004B
> 167162 postgres 20 0 34.9g 25g 25g S 0.0 40.2 17:58.38 postgres: checkpointer process
>
> shared_buffers = 32GB
Also, what is work_mem ?
Justin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
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: pryzby@telsasoft.com, tonytao0505@outlook.com
Subject: Re: checkpoint and recovering process use too much memory
In-Reply-To: <20171103022128.GC2267@telsasoft.com>
References: <MWHPR13MB13894E7F131611EE294091E1AA5D0@MWHPR13MB1389.namprd13.prod.outlook.com> <20171103022128.GC2267@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