From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: How to know how much CPU, RAM is used by existing 1 database
Date: Wed, 26 Oct 2022 08:47:54 -0600
Message-ID: <f6ad12c9-1506-e309-b351-45ffe6a4d4ac@gmail.com> (raw)
In-Reply-To: <CABWY_HCrY01DnZPt3FpuJ88m09vJZ3xU_Tjr5qnJ9EvEYn9CAw@mail.gmail.com>
References: <CABWY_HAKzE8B8n-oOukkYE4LgHFX1U0j7cN4XXudf-HbZTnBRA@mail.gmail.com>
<CABWY_HDNnPO23ajUj16_g6ror5R88gbPfaYoMZ82nHOnmgc+kQ@mail.gmail.com>
<CACJufxHSs4Bd9Bksz-Odhoep9NPk-x_mqbSx=VeNt_bYWW=DRA@mail.gmail.com>
<CABWY_HCrY01DnZPt3FpuJ88m09vJZ3xU_Tjr5qnJ9EvEYn9CAw@mail.gmail.com>
On 10/26/22 08:26, Yi Sun wrote:
>
>
> On Wed, 26 Oct 2022 at 18:10, jian he <jian.universality@gmail.com> wrote:
>
>
>
> On Wed, Oct 26, 2022 at 11:07 AM Yi Sun <yinan81@gmail.com> wrote:
>
> Hi Guys,
>
> 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
>
> Best regards
> Dennis
>
>
> manual:
> https://www.postgresql.org/docs/current/runtime-config-resource.html|
> |
> |except |min_dynamic_shared_memory| (|integer|)|
> |all other parameters are used to cap the memory. almost all
> parameters mentioned "database server" which means it's on cluster
> level.
> |
> |
> |
> |
> |
> --
> I recommend David Deutsch's <<The Beginning of Infinity>>
>
> Jian
>
>
>
> Hi Jian he
>
> Thank you for your reply
>
> The parameters are on cluster level, so we still can not know how much
> memory is used in a specific database, for example, total memory is 64GB
> 1. How to get how much memory is used on cluster level? For example 40GB
> 2. How to get how much memory is used in a specific database? For
> example 30GB, then we can prepare the new patroni cluster 32GB is enough
>
> Thank you
> Dennis
You can see connection with pg*backend* functions. You can log
connections to see which db is most commonly accessed. You can log sql
to see which table are being touched. You'll have to assume a
correlation to CPU/disc usage. What have you tried?
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: robjsargent@gmail.com
Subject: Re: How to know how much CPU, RAM is used by existing 1 database
In-Reply-To: <f6ad12c9-1506-e309-b351-45ffe6a4d4ac@gmail.com>
References: <CABWY_HAKzE8B8n-oOukkYE4LgHFX1U0j7cN4XXudf-HbZTnBRA@mail.gmail.com> <CABWY_HDNnPO23ajUj16_g6ror5R88gbPfaYoMZ82nHOnmgc+kQ@mail.gmail.com> <CACJufxHSs4Bd9Bksz-Odhoep9NPk-x_mqbSx=VeNt_bYWW=DRA@mail.gmail.com> <CABWY_HCrY01DnZPt3FpuJ88m09vJZ3xU_Tjr5qnJ9EvEYn9CAw@mail.gmail.com> <f6ad12c9-1506-e309-b351-45ffe6a4d4ac@gmail.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