Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9Wr8-0004lz-V6 for pgsql-admin@arkaria.postgresql.org; Mon, 08 Oct 2018 14:49:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9Wr6-0005bO-QG for pgsql-admin@arkaria.postgresql.org; Mon, 08 Oct 2018 14:49:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9Wr6-0005bH-6j for pgsql-admin@lists.postgresql.org; Mon, 08 Oct 2018 14:49:56 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9Wr3-0000WL-E8 for pgsql-admin@lists.postgresql.org; Mon, 08 Oct 2018 14:49:54 +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 w98EnnQf027081; Mon, 8 Oct 2018 10:49:49 -0400 From: Tom Lane To: Joel Benelli cc: pgsql-admin@lists.postgresql.org Subject: Re: effective_cache_size In-reply-to: References: Comments: In-reply-to Joel Benelli message dated "Mon, 08 Oct 2018 10:53:37 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27079.1539010189.1@sss.pgh.pa.us> Date: Mon, 08 Oct 2018 10:49:49 -0400 Message-ID: <27080.1539010189@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Joel Benelli writes: > We have a Linux server 16GB RAM and HD SSD with Postgres 9.5 and > configuration: > ... > effective_cache_size = 12GB > With these settings the memory usage is between 10 ~ 13GB and when running > a dump occur errors of "out of memory" preventing new requests. By changing > the effective_cache_size setting to 6GB, the memory usage is between 8 ~ > 12GB, without errors during the dump. That seems *very* odd. The only thing effective_cache_size actually affects is the planner's opinion of the cost of indexscans [1], so that it might choose different query plans after you change the setting. But there's no obvious reason why that would lead to memory problems in one case and not the other. I'd suggest looking in the postmaster log to discover exactly which query is failing, and then manually EXPLAIN'ing that query with both settings to see what plans we are talking about. That might yield some more insight. regards, tom lane