Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oniQy-000533-Mf for pgsql-general@arkaria.postgresql.org; Wed, 26 Oct 2022 15:35:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oniQx-0003p1-Fd for pgsql-general@arkaria.postgresql.org; Wed, 26 Oct 2022 15:35:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oniQx-0003os-1m for pgsql-general@lists.postgresql.org; Wed, 26 Oct 2022 15:35:11 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oniQu-0000RH-On for pgsql-general@postgresql.org; Wed, 26 Oct 2022 15:35:10 +0000 Received: by mail-ed1-x52d.google.com with SMTP id a5so29037915edb.11 for ; Wed, 26 Oct 2022 08:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=oHwL+KjFYytbEqfCtul8aGqbXLrEX1i74pAbXxJ1q6Y=; b=aRv1H65qTLX0Hwk9nlNEcN55zJQeCAFISWeMpIuOnM0Jh2b88QniSejdxn5ZryyH71 Wn0JdQj3bcVOGekJNDksgP5V5Sgro1gZQt3PuCINOrF4PEilgnhHqAaonJHDs7o0cnsO G7CKDMNb6pJ6iKvBxtuWY6LnfOi5c6g87mE4Xdes3INVkt4UlHve+39Wb8Nd/Xciu8gI z0ntDZWLEN2WZ53wBFVpAQCaMSPwsBAToRiN/dVB/lElwmahBhZWQvP0Nz5N0ahCG6vJ Fc8kHneUFlFc2k1SrpIc9ZvU7WfkMN9/0jiXJPIRpnUYKZi5uFnUZTcNLc05YZBd0Uch JS+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oHwL+KjFYytbEqfCtul8aGqbXLrEX1i74pAbXxJ1q6Y=; b=Hefg50haofGYrcrUkudpsREFsDniVAnAlTsXIcxeYtMqAvPiqCq2MVLJqLGvnTg6VC S/i9jqxvpsAkEwuzuXp6UMamycRyYTk7QOcobVuYc/m6TZYYo8LOYgBCffv2s8Gf5UK0 iMVQnY7c56vWB+cSGUAUPTapl3k+qWU5JqaJ7Zv6HbfNJJ9Cw2hUu8TF9J7Xbwnpwn5X PeFn00UCIUxJX8wgdd8R17Fr1eu1PRFr4XCQT55y3TMOQEZngjn2IYSod/0xc557L75G bfLXFk4YTJu2zpflMlel+v+NggS/zUWzqXn543UieRY8zeIqwuT+FjQuu2Xxn0L1aynp 5GUw== X-Gm-Message-State: ACrzQf2Sesi0URkzq95aXBpIs5YYwvml3+hrcel+/xTCv4EsyO++J2Om fgmXF3+LAg0p7DXtZPXbolIZ0Q== X-Google-Smtp-Source: AMsMyM7RVeqmdyC0JIj/poGEVMfDm3eJZevce0EzHUTAZOI+QDwTKTpDd2//+xP9ssjypRVjCcK3ow== X-Received: by 2002:a05:6402:4441:b0:454:8a74:5459 with SMTP id o1-20020a056402444100b004548a745459mr40616338edb.155.1666798507274; Wed, 26 Oct 2022 08:35:07 -0700 (PDT) Received: from localhost.localdomain ([213.182.142.66]) by smtp.gmail.com with ESMTPSA id g18-20020a17090604d200b00782539a02absm3100311eja.194.2022.10.26.08.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 08:35:07 -0700 (PDT) Message-ID: Subject: Re: How to know how much CPU, RAM is used by existing 1 database From: Laurenz Albe To: Yi Sun , pgsql-general@postgresql.org Date: Wed, 26 Oct 2022 17:35:06 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 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//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