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 1gxsZr-0001xU-CE for pgsql-general@arkaria.postgresql.org; Sun, 24 Feb 2019 12:08:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gxsZq-0002lg-0w for pgsql-general@arkaria.postgresql.org; Sun, 24 Feb 2019 12:08:14 +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 1gxsZp-0002lZ-LK for pgsql-general@lists.postgresql.org; Sun, 24 Feb 2019 12:08:13 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gxsZj-000656-84 for pgsql-general@lists.postgresql.org; Sun, 24 Feb 2019 12:08:12 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 45BDF241E; Sun, 24 Feb 2019 13:08:04 +0100 (CET) Date: Sun, 24 Feb 2019 13:08:04 +0100 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Size estimation of postgres core files Message-ID: <20190224120804.mfqk2scjzbitbbv7@hjp.at> References: <20190215163655.GA16325@alvherre.pgsql> <87d0nslxju.fsf@news-spur.riddles.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="odeit2vg745wdplj" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --odeit2vg745wdplj Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2019-02-15 13:01:50 -0600, Jeremy Finzel wrote: > It doesn't write out all of RAM, only the amount in use by the > particular backend that crashed (plus all the shared segments attached > by that backend, including the main shared_buffers, unless you disable > that as previously mentioned). > Based on the Alvaro's response, I thought it is reasonably possible that = that > *could* include nearly all of RAM, because that was my original question.= =A0 If > shared buffers is say 50G and my OS has 1T, shared buffers is a small por= tion > of that.=A0 But really my question is what should we reasonably assume is > possible The size of the core dump will be roughly the same as the VM used by the process - so that will be the initial size of the process plus shared buffers plus a (usually small) multiple of work_mem or maintenance_work_mem plus whatever memory the process allocates. The big unknown is that "(usually small) multiple of work_mem". I've seen a process use 8 times work_mem for a moderately complex query, so depending on what you do it might be worse. The extra memory allocated by processes is usually small (after all, if some datastructure were expected to be potentially large it would probably be limited by work_mem), but if there is a bug (and that's what you are looking for) it might really grow without bounds. If you know some upper bound for a reasonable size of your processes you could set the address space limit - not only will this limit the core dump size, but it will also prevent a single process from consuming all RAM and triggering the OOM killer. You probably don't want to limit the core dump size directly (another process limit you can set) as that will result in a truncated (and possibly useless) core dump. For similar reasons I'm not convinced that omitting the shared memory is a good idea. hp --=20 _ | Peter J. Holzer | we build much bigger, better disasters now |_|_) | | because we have much more sophisticated | | | hjp@hjp.at | management tools. __/ | http://www.hjp.at/ | -- Ross Anderson --odeit2vg745wdplj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAlxyiR8ACgkQ8g5IURL+ KF2bRhAAnVa8csYcOix4VpzyZ2NvFYgk91he3Xk3k5Spze7NhYfXZJ6AyLuJLSCx v2wcoN/CcyKk09ck/mccac3dXsGww6UX4mTRvPhmrPTflyguVCN7GRX19kmEvEuN RrjOLXEGzxhdw0bWWTvD4sWVLKotHTFYLP4fflFlxyhBFjxbH/YiZJ1YxLIZiY7i xf4FYZQuKgPA1HoxX2wMzK6071rKB6rr5Fv52UKih9q14Id0vPY9JXikKUyCT28y ZT6PHwbVChANaGYxK4EZkRRHcHjveQ9UOeZ0l5RUyLAztR/l67AydMXtdc9dQGxP 8SXKYbvetCL4aTXY7d8xG09MDn3GMqCnBFrEK79rn5kaGY7XVXK22Z7mJseV+CGZ oJQ0Zqw4GV77jGGa5sBZXLtrvcSZnQvKJgw0FU2bAgz7lPAjYeB4zVlBOlaGcOOv 96ULm1dFalCMbhYgWmVdVteOIT/UCQP90yHw4zHxLaWn+BkgsP0PySYYfhq9SalD X6pNUhYv/xwl9m8xnTm9au9WKCGaYWhAiTto0hbG/ls7etdXk+i3N/ghEZUNeEr3 5/4bHKFhBWlrh8qXFsu/aCnsg9h9icNJqMt8uUSYtJ3E4r/2lkIL1ao4JmAPUOSh ixrbQaGAGDFJ1K7AhIQkjMEeYVuL6O51/QA0oSQw+S614k0rEYw= =CAXe -----END PGP SIGNATURE----- --odeit2vg745wdplj--