pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Yi Sun <yinan81@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: How to know how much CPU, RAM is used by existing 1 database
Date: Wed, 26 Oct 2022 17:35:06 +0200
Message-ID: <ef3bb3d44a56ce7f54a8283fd2471449971c29c0.camel@cybertec.at> (raw)
In-Reply-To: <CABWY_HDNnPO23ajUj16_g6ror5R88gbPfaYoMZ82nHOnmgc+kQ@mail.gmail.com>
References: <CABWY_HAKzE8B8n-oOukkYE4LgHFX1U0j7cN4XXudf-HbZTnBRA@mail.gmail.com>
	<CABWY_HDNnPO23ajUj16_g6ror5R88gbPfaYoMZ82nHOnmgc+kQ@mail.gmail.com>

On Wed, 2022-10-26 at 13:37 +0800, Yi Sun wrote:
> Who can help me with this please? I researched but still no result yet, thank you
> 
> On Tue, 25 Oct 2022 at 16:30, Yi Sun <yinan81@gmail.com> wrote:
> > Hi,
> > 
> > There are many databases in our production patroni cluster and it seems it is overloaded,
> > so we decide to migrate the busiest database to a new patroni cluster. 
> > 
> > pgwatch2 is implemented, how to know how much CPU, RAM is used by the database please?
> > Then we can use it to prepare the new patroni cluster hardware. Thank you

You can look how much *private* memory the backends for a certain database
use by examining /proc/<pid>/smaps, you can use the pg_buffercache extension
to see how much of which database is in cache, but you don't know how much
of the kernel page cache is used to cache files for that database.

Yours,
Laurenz Albe





view thread (7+ messages)

Message-ID: <ef3bb3d44a56ce7f54a8283fd2471449971c29c0.camel@cybertec.at>
Permalink:  ../ef3bb3d44a56ce7f54a8283fd2471449971c29c0.camel@cybertec.at/
Also on:    postgresql.org/message-id/ef3bb3d44a56ce7f54a8283fd2471449971c29c0.camel@cybertec.at

 · 

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: laurenz.albe@cybertec.at, yinan81@gmail.com
  Subject: Re: How to know how much CPU, RAM is used by existing 1 database
  In-Reply-To: <ef3bb3d44a56ce7f54a8283fd2471449971c29c0.camel@cybertec.at>
  References: <CABWY_HAKzE8B8n-oOukkYE4LgHFX1U0j7cN4XXudf-HbZTnBRA@mail.gmail.com> <CABWY_HDNnPO23ajUj16_g6ror5R88gbPfaYoMZ82nHOnmgc+kQ@mail.gmail.com> <ef3bb3d44a56ce7f54a8283fd2471449971c29c0.camel@cybertec.at>

* 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