pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: pgsql-general@postgresql.org
Subject: Re: core system is getting unresponsive because over 300 cpu load
Date: Tue, 10 Oct 2017 15:41:26 -0700
Message-ID: <838d0ab3-6c4f-39d3-85a1-978402e07e01@hogranch.com> (raw)
In-Reply-To: <1507674532671-0.post@n3.nabble.com>
References: <1507668007464-0.post@n3.nabble.com>
	<4da39f8e-39b9-b4af-d879-72a44dde5fbd@2ndquadrant.com>
	<1507674532671-0.post@n3.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>

On 10/10/2017 3:28 PM, pinker wrote:
> It was exactly my first guess. work_mem is set to ~ 350MB and I see a lot of
> stored procedures with unnecessary WITH clauses (i.e. materialization) and
> right after it IN query with results of that (hash).

1000 connections all doing queries that need 1 work_mem each will 
consume 1000*350MB == 350GB of your ram.    many queries use several 
work_mem's.

if the vast majority of your operations are OLTP and only access a few 
rows, then large work_mem is NOT a good idea.   If you're doing large 
aggregate operations like OLAP for reporting or whatever, then thats 
another story, but generally doing that sort of thing does NOT use 1000 
connections.


-- 
john r pierce, recycling bits in santa cruz



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



view thread (20+ messages)  latest in thread

Message-ID: <838d0ab3-6c4f-39d3-85a1-978402e07e01@hogranch.com>
Permalink:  ../838d0ab3-6c4f-39d3-85a1-978402e07e01@hogranch.com/
Also on:    postgresql.org/message-id/838d0ab3-6c4f-39d3-85a1-978402e07e01@hogranch.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pierce@hogranch.com
  Subject: Re: core system is getting unresponsive because over 300 cpu load
  In-Reply-To: <838d0ab3-6c4f-39d3-85a1-978402e07e01@hogranch.com>
  References: <1507668007464-0.post@n3.nabble.com> <4da39f8e-39b9-b4af-d879-72a44dde5fbd@2ndquadrant.com> <1507674532671-0.post@n3.nabble.com> <838d0ab3-6c4f-39d3-85a1-978402e07e01@hogranch.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox