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 1gtb6J-0007ar-4T for pgsql-general@arkaria.postgresql.org; Tue, 12 Feb 2019 16:40:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gtb6H-0005G0-Hp for pgsql-general@arkaria.postgresql.org; Tue, 12 Feb 2019 16:40:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtb6F-0005Ft-QJ for pgsql-general@lists.postgresql.org; Tue, 12 Feb 2019 16:40:01 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtb6C-0007t1-IN for pgsql-general@lists.postgresql.org; Tue, 12 Feb 2019 16:39:59 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2CC0923116; Tue, 12 Feb 2019 11:39:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 12 Feb 2019 11:39:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=V x6Jwt14JK+R2JBbwpWx4vbeckgdWWzzYJRURjy75i0=; b=bFevuX6WbEHvxAps2 MtK0pyLP4Tkcg+0Z5H6+VorG0o1Tedpwfs5ZmzyvPHyd1Rxs1wrx2QNZNGj3lmmQ LsfeOwjLYnT4rTy/qncruLAku+VRpruZpgvw4JdpdWg+HeYEHkVTD53tTUrPaYEo uMwzhWtmYNaBUw9WnFUqwULE8Vox3PoV8r+u3uHj6c2UhNaBAuQRc9n57mgpKCti d1nFxrdisfzEJs7PHK1RwZw2FQ3UGBVuHSiuYGd9vBM4XEvUYeeH2PLS1LlFhFxx o8k9ivKc77QiRWRlrwWizS3bOo/8jGZXARi3rh1axcI7ctgcPj/jBMhgQ39E1EuS RpLjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=Vx6Jwt14JK+R2JBbwpWx4vbeckgdWWzzYJRURjy75 i0=; b=GKETRxcbeY+SBjcLW3MEqfBm1MOQbZI+TOSZGtvt2KhVDHbnXrQAfeEBR 3tLm+AYQlDrqrYqjCkdwJshbzXGMbciHCMw6nKl+Lcd0HnNJwDYFfV+cGESp/eFf 2/wLtwDahh1M+l9NKAQlJjgffRqbKPLFTd+ZveHDuE3EUBSdc6L5tWRQ4YIyu+zr yP0LqK84nxVHz5IAqq6SzTuaZAcF+WFdT6o1dbTIUpguJGA1CeMNn1Z7FIpTclvp SVXJvO5BEf8B66hFEiSB2I4HXMFi6PTmcMQ38BEmGgTVxJ75yKst2u7IOm8D4g9j OqCGCSaUFxKMxzyB8meo1Q6YSuhNw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtuddgledvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkff gfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceo rggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecukfhppeejuddrvd duvddrudehtddrvddtvdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 2A871E409D; Tue, 12 Feb 2019 11:39:53 -0500 (EST) Subject: Re: Out of memory: Kill process nnnn (postmaster) score nn or sacrifice child To: Vikas Sharma , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Tue, 12 Feb 2019 08:39:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/12/19 8:20 AM, Vikas Sharma wrote: > Hello All, > > I have a 4 node PostgreSQL 9.6 cluster with streaming replication.  we > encounter today the Out of Memory  Error on the Master which resulted in > All postres  processes restarted and cluster recovered itself. Please > let me know the best way to diagnose this issue. For a start look back further in the Postgres log then the below. What is shown below is the effects of the OOM killer. What you need to look for is the statement that caused Postgres memory to increase to the point that the OOM killer was invoked. > > > > The error seen in the postgresql log: > > 2019-02-12 10:55:17 GMT LOG:  terminating any other active server processes > 2019-02-12 10:55:17 GMT WARNING:  terminating connection because of > crash of another server process > 2019-02-12 10:55:17 GMT DETAIL:  The postmaster has commanded this > server process to roll back the current transaction and exit, because > another server process exited abnormally and possibly corrupted shared > memory. > 2019-02-12 10:55:17 GMT HINT:  In a moment you should be able to > reconnect to the database and repeat your command. > 2019-02-12 10:55:17 GMT WARNING:  terminating connection because of > crash of another server process > 2019-02-12 10:55:17 GMT DETAIL:  The postmaster has commanded this > server process to roll back the current transaction and exit, because > another server process exited abnormally and possibly corrupted shared > memory. > 2019-02-12 10:55:17 GMT HINT:  In a moment you should be able to > reconnect to the database and repeat your command. > 2019-02-12 10:55:17 GMT WARNING:  terminating connection because of > crash of another server process > ----- > > Error from dmesg on linux: > ----------------------------------- > [4331093.885622] Out of memory: Kill process nnnnn (postmaster) score nn > or sacrifice child > [4331093.890225] Killed process nnnnn (postmaster) total-vm:18905944kB, > anon-rss:1747460kB, file-rss:4kB, shmem-rss:838220kB > > Thanks & Best Regards > Vikas Sharma -- Adrian Klaver adrian.klaver@aklaver.com