Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jy1zt-0001Ga-Nx for pgsql-admin@arkaria.postgresql.org; Tue, 21 Jul 2020 23:48:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jy1zs-0001b7-Ci for pgsql-admin@arkaria.postgresql.org; Tue, 21 Jul 2020 23:48:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jy1zr-0001av-9F for pgsql-admin@lists.postgresql.org; Tue, 21 Jul 2020 23:48:32 +0000 Received: from mail-mw2nam10olkn2100.outbound.protection.outlook.com ([40.92.42.100] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jy1ze-0004rF-SZ for pgsql-admin@postgresql.org; Tue, 21 Jul 2020 23:48:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TF9TiOmxxx2B+Z4XyAcK+dFiJEw1C4+u0k3JMxcEOPCBW82B0ZrurTsY4AEyUweY4esV0oRlzkTUdHe/jYOfgPIas4VwlCPzy9+/5Tp7NEGbDryh7XKM3UMo1H/x0uXBYgygGFHvUavukVqjIfWOXhvVemy7/JD1LGugutkhyX+eZu01kmW7LHIBT9t8jGuEUJCs2vcVr6gHl/oA6GbRYRfZIpURxNczepBFADliO2Y3QfYWBetpTmTLfUEU7UUCu8sQ1nNd7gy2440tBNbJinh9tVh9RIYrH6shcE8J0FQt8jPkaYcitXWfa6oj3k5wqNjuPAYkZok9/LUo8N0FSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HOprbYpVvdO+vTZiWi9DyRcKy1ak3y3BWoPUfWZURps=; b=i2TEbIHKNr7IAU1IDw0bTv1AL8lByMNAXUpSKry4S/J71pP6FvKrDRDr8ZyrVMsfzUCa4sDnFjBwiPfdrqgQ7wsHSSYFmnf1u+Tvobbq3//Slw9/h87gcDUTf7HsDSMIQ3MS2LVeZqdjmQfOd1eQlLmgN559TF1tTA8oh02NYeoLdGe9X27P1jJTKArj20Q+jEhnG07lGs9QrUB6+Xj/VxUc4fH/JtDgt3Q1qZBGcWCQV5dcAeLAwk49DHs2zrZ/u3aunOkRtwhwyUTvOLEuLXuDvORkabrOWqamLjSqpJP4ssKDNTJezUqEZ6Bt54vsHYQN8baHufx6T1JdyOoyhQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HOprbYpVvdO+vTZiWi9DyRcKy1ak3y3BWoPUfWZURps=; b=YrfORyJYPVZABT8kDdVTZcCe9quiZnBfvY7USMf6QitiGhxCTSlQ4sZ40T8IjpjTXVcS73EQqst09h2xHQeJENRk8ozUydrg7+jNvHcsai1eg2/IXF1qdCbttP82OjQ8vUrU3H9rsVc/Mt0MJ3ORh5+Dp8l36fu3waAFxfd894YGR4F8KNR4IB77Dp4AaPNYpIxKAGuTffaH93W365tT4p9O6ozJDf3WO5+4wGz/x8GXdjSl2ECySyEPrI6K3aR/agEkGfXPP2zj3uhHVRF8HBelccj3olrVlqC9bb1qEDzSZGROAG4ek22aRY04v3JpRA02w4dAXqSLE4AR3292/A== Received: from DM6NAM10FT010.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::42) by DM6NAM10HT190.eop-nam10.prod.protection.outlook.com (2a01:111:e400:7e86::151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18; Tue, 21 Jul 2020 23:48:14 +0000 Received: from MN2PR05MB6832.namprd05.prod.outlook.com (2a01:111:e400:7e86::52) by DM6NAM10FT010.mail.protection.outlook.com (2a01:111:e400:7e86::472) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.18 via Frontend Transport; Tue, 21 Jul 2020 23:48:14 +0000 Received: from MN2PR05MB6832.namprd05.prod.outlook.com ([fe80::3907:1224:1e82:6]) by MN2PR05MB6832.namprd05.prod.outlook.com ([fe80::3907:1224:1e82:6%7]) with mapi id 15.20.3216.020; Tue, 21 Jul 2020 23:48:14 +0000 From: jian xu To: Tom Lane CC: MichaelDBA , Scott Ribe , Laurenz Albe , "pgsql-admin@postgresql.org" Subject: Re: checkpoint process use too much memory Thread-Topic: checkpoint process use too much memory Thread-Index: AQHWFk8iTaYCH7OBbkS24fNI9UG+wKiBuW8AgACSlvSAAAmagIAADKKqgAADXQCAAAQbAIABlHoPgI2Ngv2AABOEgIAA94DLgACt6Kg= Date: Tue, 21 Jul 2020 23:48:14 +0000 Message-ID: References: <5193b00d175f2e06a171ba375f1ef723e1700de4.camel@cybertec.at> ,, ,<736811.1595284465@sss.pgh.pa.us>, In-Reply-To: Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:2E02123CBAD2EDEE50E297AE3D9C1B1377BB75AC69037A7AAAA91881FB10F356;UpperCasedChecksum:EB8930ADD2AD056107D1A50ADAD11FBCF484032FA187378DA96720643267077B;SizeAsReceived:7784;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [v/qH9rmsWigY4DwQeplZLw9N3yu+y37+] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: f97025b0-f39e-4af1-dcab-08d82dd08904 x-ms-traffictypediagnostic: DM6NAM10HT190: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 73xzH+9deZfKTNsxeFnn29yeDwvGV6HDy2BmjZMvUabMGrQTlNhcM9kt5PRXVVfsmO4bKmxkNRrrfPa7I2vKW0Sb6tRmsvSwRBG+6SM0F5RF/rp4yjFNCIdEDZ8KApxIWxR5bdf6QXINbiw+RQDANnHBtz/tPOcjE1jgtK0PGoxMhwoWHx6KVAZuSkKE2Jmqfkif0YWp+0HKGe5GsPb6iE7QgYtfx+b011+uWhbJj3QtVo3xwS4D8JQzOH+7uZ6f x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR05MB6832.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: P5mLde2Mk2bQwpY4Qz/5s2KtkF3WgdZDLmWTeYdpvBrq5hevdCGPm+iDlSDXBIVzlLPJkDmFQN8SbC0MQXqU0HLu4kThH+4rRlWh39HA29DPK3P4EJFrSVZ5n5i1QECA2Jnb4yZL2DkpeHIeVxCMcg== x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_MN2PR05MB683257DAD723CF8BDBB4149DA1780MN2PR05MB6832namp_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: DM6NAM10FT010.eop-nam10.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: f97025b0-f39e-4af1-dcab-08d82dd08904 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jul 2020 23:48:14.6960 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM10HT190 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --_000_MN2PR05MB683257DAD723CF8BDBB4149DA1780MN2PR05MB6832namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable btw, I checked /proc//smaps. it looks like postgres process took most = of the memory, the output is like: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D 564415881000-56441588f000 rw-p 00857000 08:04 17682620 pos= tgresql/10/3/dist/bin/postgres Size: 56 kB KernelPageSize: 4 kB MMUPageSize: 4 kB Rss: 56 kB Pss: 56 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 56 kB Referenced: 56 kB Anonymous: 56 kB LazyFree: 0 kB AnonHugePages: 0 kB ShmemPmdMapped: 0 kB Shared_Hugetlb: 0 kB Private_Hugetlb: 0 kB Swap: 0 kB SwapPss: 0 kB Locked: 0 kB VmFlags: rd wr mr mw me dw ac sd 5644162cf000-565d4c645000 rw-p 00000000 00:00 0 [h= eap] Size: 105745880 kB KernelPageSize: 4 kB MMUPageSize: 4 kB Rss: 105745692 kB Pss: 105745692 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 105745692 kB Referenced: 104768404 kB Anonymous: 105745692 kB LazyFree: 0 kB AnonHugePages: 0 kB ShmemPmdMapped: 0 kB Shared_Hugetlb: 0 kB Private_Hugetlb: 0 kB Swap: 0 kB SwapPss: 0 kB Locked: 0 kB VmFlags: rd wr mr mw me ac sd =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D however, the shared_buffers size is only 4GB.. postgres=3D# show shared_buffers ; shared_buffers ---------------- 4GB thanks, James ________________________________ From: jian xu Sent: Tuesday, July 21, 2020 9:20 To: Tom Lane Cc: MichaelDBA ; Scott Ribe ; Laurenz Albe ; pgsql-admin@postgresql.org= Subject: Re: checkpoint process use too much memory Thanks Tom and Alvaro. I will upgrade it to 10.13 first. James ________________________________ From: Tom Lane Sent: Monday, July 20, 2020 18:34 To: jian xu Cc: MichaelDBA ; Scott Ribe ; Laurenz Albe ; pgsql-admin@postgresql.org= Subject: Re: checkpoint process use too much memory jian xu writes: > we are seeing this issue again, the checkpoint process is eating up= all the memory, > based on the htop, the checkpointer process has > VIRT: 103G > RES: 103G > SHR: 4099M hmmm ... > my pg version is 10.3 , Really the *first* thing you ought to do is update to current (10.13) and see if the problem is still there. But if it is, maybe collecting a memory context map in that process would be informative: https://wiki.postgresql.org/wiki/Developer_FAQ#Examining_backend_memory_use Note you may need a debug build for that recipe to work. regards, tom lane --_000_MN2PR05MB683257DAD723CF8BDBB4149DA1780MN2PR05MB6832namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
btw, I checked /proc/<PID>/smaps. it looks like postgres process took most of the memory, the output is like= :
=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
564415881= 000-56441588f000 rw-p 00857000 08:04 17682620            &nbs= p;     postgresql/10/3/dist/bin/postgres
Size:                 56 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:                  56 = kB
Pss:                  56 = kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:        56 kB
Referenced:           56 kB
Anonymous:            56 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 = kB
SwapPss:               0 kB
Locked:                0 kB
VmFlags: rd wr mr mw me dw ac sd
5644162cf000-565d4c645000 rw-p 00000000 00:00 0   &= nbsp;                    =  [heap]
Size:           105745880 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Rss:            105745692 kB
Pss:            105745692 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:  105745692 kB
Referenced:     104768404 kB
Anonymous:      105745692 kB
LazyFree:              0 kB
AnonHugePages:         0 kB
ShmemPmdMapped:        0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 = kB
SwapPss:               0 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac sd
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
however, the shared_buffers size is only 4GB..
postgres=3D# show shared_buffers ;
 shared_buffers
----------------
 4GB

thanks,

James

From: jian xu <jamesxu@o= utlook.com>
Sent: Tuesday, July 21, 2020 9:20
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: MichaelDBA <MichaelDBA@sqlexec.com>; Scott Ribe <scott_= ribe@elevated-dev.com>; Laurenz Albe <laurenz.albe@cybertec.at>; p= gsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: checkpoint process use too much memory
 
Thanks Tom and Alvaro. I will upgrade it to 10.13 first. =
James


From: Tom Lane <tgl@ss= s.pgh.pa.us>
Sent: Monday, July 20, 2020 18:34
To: jian xu <jamesxu@outlook.com>
Cc: MichaelDBA <MichaelDBA@sqlexec.com>; Scott Ribe <scott_= ribe@elevated-dev.com>; Laurenz Albe <laurenz.albe@cybertec.at>; p= gsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: checkpoint process use too much memory
 
jian xu <jamesxu@outlook.com> writes:
>       we are seeing this issue again, th= e checkpoint process is eating up all the memory,
> based on the htop, the checkpointer process has
> VIRT: 103G
> RES: 103G
> SHR: 4099M

hmmm ...

> my pg version is 10.3 ,

Really the *first* thing you ought to do is update to current (10.13)
and see if the problem is still there.  But if it is, maybe collecting=
a memory context map in that process would be informative:

https://wiki.postgresql.org/wiki/Developer_FAQ#Examining_backe= nd_memory_use

Note you may need a debug build for that recipe to work.

            &nb= sp;           regards, to= m lane
--_000_MN2PR05MB683257DAD723CF8BDBB4149DA1780MN2PR05MB6832namp_--