Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gProN-0003OJ-V4 for pgsql-admin@arkaria.postgresql.org; Thu, 22 Nov 2018 16:26:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gProM-0007X1-O0 for pgsql-admin@arkaria.postgresql.org; Thu, 22 Nov 2018 16:26:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gProM-0007W7-CY for pgsql-admin@lists.postgresql.org; Thu, 22 Nov 2018 16:26:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gProJ-0005Bw-Ro for pgsql-admin@lists.postgresql.org; Thu, 22 Nov 2018 16:26:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wAMGQVVR005456; Thu, 22 Nov 2018 11:26:31 -0500 From: Tom Lane To: Sebastian Gabbert cc: pgsql-admin@lists.postgresql.org Subject: Re: backend proccess memory accumulates In-reply-to: <6E65FD77-6FA1-485E-AEF2-318B56964255@huehnerhose.de> References: <6E65FD77-6FA1-485E-AEF2-318B56964255@huehnerhose.de> Comments: In-reply-to Sebastian Gabbert message dated "Thu, 22 Nov 2018 16:15:28 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <5454.1542903991.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 22 Nov 2018 11:26:31 -0500 Message-ID: <5455.1542903991@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Sebastian Gabbert writes: > Postgres is running on a dedicated FreeBSD 11.2 server with 32GB of RAM,= there is a second server in hot standby / wal replication. My =E2=80=9Cwo= rker=E2=80=9D processes, mainly php processes, connect through pgbouncer (= session mode). > What I observed is that there are, at any time, around 10-15 postgres ba= ckend processes on my main db server consuming around 4GB of memory (RES i= n glances) each. These processes keep this footprint until pgbouncer close= s the connection. = That is, most likely, almost entirely shared space (shared buffers and so on). Sorting out how much is shared and how much is actually per-process memory can be tricky, because most Unix process monitoring tools aren't very good about showing the difference. I don't use FreeBSD enough to be sure how to tell the difference with its tools --- but you can't get anywhere with diagnosing PG's true memory consumption until you've got a handle on that. It would be interesting to know what you've got shared_buffers set to on this server, though. regards, tom lane