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 1lr3uz-0007Eg-Tq for pgsql-admin@arkaria.postgresql.org; Wed, 09 Jun 2021 19:31:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lr3uy-00077P-Qa for pgsql-admin@arkaria.postgresql.org; Wed, 09 Jun 2021 19:31:12 +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 1lr3uy-00077G-Hk for pgsql-admin@lists.postgresql.org; Wed, 09 Jun 2021 19:31:12 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lr3us-0006aN-4B for pgsql-admin@postgresql.org; Wed, 09 Jun 2021 19:31:11 +0000 Received: by mail-ej1-x62e.google.com with SMTP id c10so40113146eja.11 for ; Wed, 09 Jun 2021 12:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hagander-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rfu6DmBF3gqJIM1p3Mt34lmSrIA+rcTVuq+WosFDguw=; b=VJ/I8kXZCT89lFhE4z2+u+uzRi4gBiIQxbvGvX/90TzYaSUPl7NkPKb63YfntxRe5g T/+26xdEm08it0eN0aqOIDL5FnJKoLyJHMLy44ho19TxKFXIA6gr1vzz7Jg46n93zWD/ MJwX8i7eSUBUxCPT41rQNqDBY8SUGAtw7o80Ro+xMUeqdtDPhtzYQyrq07aMKufebWuV P+KgSv0Kc39DV1GBWhF36EmatUXptpxXTkwwYo2JlfsqWv3Q+e59Lb+VvJ1z4/PaJwi/ Fz3H6p0pgYKKDfc2Z5EPsMW276aBFKog3nQWl1j8OQnEMEGVoTRYYaQpXVB6/ysAMrX+ 23CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rfu6DmBF3gqJIM1p3Mt34lmSrIA+rcTVuq+WosFDguw=; b=QJaQGfgvHo+N73qmHA+SJCBIQ0vpvz8D9JzgmaSkxFKQsJwdax1UIjmhNduRv8tCPJ hd8+HKIjVlEOmb2hof3HT8vmj2P+a7JYTncxvVDafIdDBCntAuNTTcZxr9HPzmOeiaYB lWKmE02YJIgv65TFcvLSMG3FsVkRMXt2vvg7xV6uOyiTei4jcFygHO8Nn5I8woIIqP/k uBY4lQ7uXZ2q0cdKxKVFCCc0WFXD5hqA1YRJ3pclP05POwSv0I1aNCQuT646/Eb2OAHn +SdiqPuwCmnNslukxy8LWFvN6QW5Jp85Wik4Bz9mOia3chcrKQpbg18KsRR6RU1ck2lq 17pw== X-Gm-Message-State: AOAM531eHO4nlJOe/55FCtmN3gsUDJyHnngeVfcQs0YU/klRn7l3ykhQ fWiO8z0GaVVLmqOSpCrdV4wgv27tQRRnK4nubHy6Lw== X-Google-Smtp-Source: ABdhPJwpA/G/a8tlsLtx/tQcXxgGRWcnTdwmpTt55CbeK6pJ0qFAuXsKp8pZK9XL79zG0uHl5upmZaJHzRzkN96ksTQ= X-Received: by 2002:a17:906:9143:: with SMTP id y3mr1236032ejw.465.1623267064334; Wed, 09 Jun 2021 12:31:04 -0700 (PDT) MIME-Version: 1.0 References: <1428485.1623266137@sss.pgh.pa.us> <1429225.1623266925@sss.pgh.pa.us> In-Reply-To: <1429225.1623266925@sss.pgh.pa.us> From: Magnus Hagander Date: Wed, 9 Jun 2021 21:30:52 +0200 Message-ID: Subject: Re: Estimating HugePages Requirements? To: Tom Lane Cc: Julien Rouhaud , Don Seiler , pgsql-admin Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jun 9, 2021 at 9:28 PM Tom Lane wrote: > > Magnus Hagander writes: > > On Wed, Jun 9, 2021 at 9:15 PM Tom Lane wrote: > >> Just try to start the server and see if it complains. > > > Well, I have to *stop* the existing one first, most likely, otherwise > > there won't be enough huge pages (or indeed memory) available. > > I'm not following. If you have a production server running, its > pg_shmem_allocations total should already be a pretty good guide > to what you need to configure HugePages for. You need to know to > round that up, of course --- but if you aren't building a lot of > slop into the HugePages configuration anyway, you'll get burned > down the road. I'm talking about the case when you want to *change* the value for shared_buffers (or other parameters that would change the amount of required huge pages), on a system where you're using huge pages. pg_shmem_allocations will tell you what you need with the current value, not what you need with the new value. But yes, you can do some math around it and make a well educated guess. But it would be very convenient to have the system able to do that for you. -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/