pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: pinker <pinker@onet.eu>
To: pgsql-general@postgresql.org
Subject: Re: core system is getting unresponsive because over 300 cpu load
Date: Wed, 11 Oct 2017 03:42:32 +0200
Message-ID: <3ae61505-1515-3b35-d48c-8d1de0330baf@2ndquadrant.com> (raw)
In-Reply-To: <1507681586390-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>
	<85580fec-9d9d-a551-156a-7bb1a66615ed@2ndquadrant.com>
	<1507681586390-0.post@n3.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>



On 10/11/2017 02:26 AM, pinker wrote:
> Tomas Vondra-4 wrote
>> I'm probably a bit dumb (after all, it's 1AM over here), but can you
>> explain the CPU chart? I'd understand percentages (say, 75% CPU used)
>> but what do the seconds / fractions mean? E.g. when the system time
>> reaches 5 seconds, what does that mean?
> 
> hehe, no you've just spotted a mistake, it suppose to be 50 cores :)
> out of 80 in total
> 

Ah, so it should say '50 cores' instead of '5s'? Well, that's busy
system I guess.

> 
> Tomas Vondra-4 wrote
>> Have you tried profiling using perf? That usually identifies hot spots
>> pretty quickly - either in PostgreSQL code or in the kernel.
> 
> I was always afraid because of overhead, but maybe it's time to start ...
> 

I don't follow. If you're not in trouble, a little bit of additional
overhead is not an issue (but you generally don't need profiling at that
moment). If you're already in trouble, then spending a bit of CPU time
on basic CPU profile is certainly worth it.

> 
> Tomas Vondra-4 wrote
>> What I meant is that if the system evicts this amount of buffers all the
>> time (i.e. there doesn't seem to be any sudden spike), then it's
>> unlikely to be the cause (or related to it).
> 
> I was actually been thinking about scenario where different sessions
> want to at one time read/write from or to many different relfilenodes,
> what could cause page swap between shared buffers and os cache?
Perhaps. If the sessions only do reads, that would not be visible in
buffer_backends I believe (not sure ATM, would have to check source).
But it'd be visible in buffers_alloc and certainly in blks_read.

> we see that context switches on cpu are increasing as well. kernel 
> documentation says that using page tables instead of Translation
> Lookaside Buffer (TLB) is very costly and on some blogs have seen
> recomendations that using huge pages (so more addresses can fit in
> TLB) will help here but postgresql, unlike oracle, cannot use it for
> anything else than page buffering (so 16gb) ... so process memory
> still needs to use 4k pages.
>

The context switches are likely due to large number of runnable
processes competing for the CPU.

Also, memory bandwidth is increasingly an issue on big boxes ...

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
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: <3ae61505-1515-3b35-d48c-8d1de0330baf@2ndquadrant.com>
Permalink:  ../3ae61505-1515-3b35-d48c-8d1de0330baf@2ndquadrant.com/
Also on:    postgresql.org/message-id/3ae61505-1515-3b35-d48c-8d1de0330baf@2ndquadrant.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: tomas.vondra@2ndquadrant.com, pinker@onet.eu
  Subject: Re: core system is getting unresponsive because over 300 cpu load
  In-Reply-To: <3ae61505-1515-3b35-d48c-8d1de0330baf@2ndquadrant.com>
  References: <1507668007464-0.post@n3.nabble.com> <4da39f8e-39b9-b4af-d879-72a44dde5fbd@2ndquadrant.com> <1507674532671-0.post@n3.nabble.com> <85580fec-9d9d-a551-156a-7bb1a66615ed@2ndquadrant.com> <1507681586390-0.post@n3.nabble.com> <3ae61505-1515-3b35-d48c-8d1de0330baf@2ndquadrant.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