Re: How to know how much CPU, RAM is used by existing 1 database

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Yi Sun <yinan81(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to know how much CPU, RAM is used by existing 1 database
Date: 2022-10-26 15:35:06
Message-ID: ef3bb3d44a56ce7f54a8283fd2471449971c29c0.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vijaykumar Jain 2022-10-26 16:34:16 Multi master disjoint cluster
Previous Message Atul Kumar 2022-10-26 14:52:27 Re: How to know how much CPU, RAM is used by existing 1 database