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 1qGQQn-0007QN-AN for pgsql-admin@arkaria.postgresql.org; Mon, 03 Jul 2023 20:45:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qGQQl-0006Zx-P3 for pgsql-admin@arkaria.postgresql.org; Mon, 03 Jul 2023 20:45:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qGQQl-0006Zn-Dh for pgsql-admin@lists.postgresql.org; Mon, 03 Jul 2023 20:45:55 +0000 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qGQQi-0021BF-BZ for pgsql-admin@lists.postgresql.org; Mon, 03 Jul 2023 20:45:54 +0000 Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-bad0c4f6f50so7139479276.1 for ; Mon, 03 Jul 2023 13:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688417150; x=1691009150; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=MYtYPymM41fVAKQ4wGENSuT4+gJXNBUFFExpJlYVcfk=; b=AxqZkcSv7JKZwWiCIGMll/TOVKgnC5aelg/4+03JWlnIQhfLjpKjJsy/17gAuPvWfe Gko/1sFQX5IDYkzOk6ui4ZJ8BoE+1ashERSBCbPOHV+RkoWLly3Ojz7KxtJ66k3wHahS 8z7Q7r7p7rvIu8NOJdsVBUyvNAj8/UnesmcK/VXiAPCworZBhS/M9T+XcLjdqyn6EyFO dzbIM6qUnIUEW09tAsaZcsa5MChuBVNXd+CcvReCfWZXRbFuM/3YW5FObn7b6dLY8uis IbivS9y87DlkFuAc8JegBb903urSD0BrKkm6rM6cWXj1399GhpyXv1yxWjpD16xwYuIZ wbbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688417150; x=1691009150; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=MYtYPymM41fVAKQ4wGENSuT4+gJXNBUFFExpJlYVcfk=; b=RwymS54AdqlZ/8L4gO+tbu94K+TOkHS6+eK8vmVteo5zEMcwD/MKD/Bl9+RlavGgwi +7qYaN3xvtgkC1yZjYG01hMeye5k//d1Rx1JKfFORGwY15LQyylxqOwgOZbOsXxiNfat QaFJEotCZ2Z9nzTNMjdMUJEYe5O0b5nt58EkFs79UmAfeNKfNykiqrLV80dlwUijoBrZ VMvqLZrEOUfYljyDm7q16xyst2vbFz+x3v+Eoz2FMUWsg+XZggyXs3v8+Zj2/a3wTzDZ 9FS3iHd7BmZ9JRmMkgtUTBxqGc9qtUGyjyU2b4Z88quhEA+StglAk/qvWX2/QsOGyNL3 IxCg== X-Gm-Message-State: ABy/qLYsrZdG+FXTIjNo7mPkqEqXhAUmCuRHdOJgg94VZ3isRmWfRkmu qTOU9sTyp2Eu8NKhXil9wYcOqlHR+TI= X-Google-Smtp-Source: APBJJlHvQpGNcYWTKipwFuDzAk5IyyMZzWC8CVly07YXqpZn6sPcz/9cGNbmP9eC2mrHL+gZIp4wSA== X-Received: by 2002:a25:ac1b:0:b0:bc3:7ee1:8d4e with SMTP id w27-20020a25ac1b000000b00bc37ee18d4emr10488284ybi.24.1688417150444; Mon, 03 Jul 2023 13:45:50 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:14c:97f7:8118:3fbf? ([2600:1700:bd2c:b810:14c:97f7:8118:3fbf]) by smtp.googlemail.com with ESMTPSA id q6-20020a258e86000000b00c5cac376dffsm32206ybl.22.2023.07.03.13.45.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Jul 2023 13:45:49 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------w7OJR4wRkuXsdjSQ1BTYtug1" Message-ID: <3767d58c-54fd-f608-bc48-99a905af71bc@gmail.com> Date: Mon, 3 Jul 2023 15:45:48 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Sanity check of shared_buffers value Content-Language: en-US To: pgsql-admin@lists.postgresql.org References: <4b1c1747-85ff-f174-a43b-482e580fe6a2@gmail.com> From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------w7OJR4wRkuXsdjSQ1BTYtug1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Being AWS RDS is the kind of thing you need to mention. Anyway, plain old bash bc does it for you.  Explicitly: (24*1024^3)/1024/8 Powershell, too: 24*[bigint]::pow(1024,3)/1024/8 On 7/3/23 14:57, Wells Oliver wrote: > Yeah. Unfortunately in AWS RDS the parameter group settings accept input > only in stricter format, so shared_buffers requires an integer value in KiB. > > On Mon, Jul 3, 2023 at 12:56 PM Ron wrote: > > On 7/3/23 14:45, Wells Oliver wrote: >> Sorry, this is dumb, but I wanted to double check that I'm doing the >> shared_buffers calc correctly given it's in 8kb blocks (block_size is >> set to 8192). >> >> Want 24GB, which I think is 25165824 KiB so divided by 8 we get 3145728. >> >> Do I have this correct? Usually can test these but wanted to run it >> by someone before having to restart the server. >> >> Is there some calc web service out there that idiots such as myself >> can use for this? > > https://www.postgresql.org/docs/15/runtime-config-resource.html > > "If this value is specified *without **units*, it is taken as blocks," > > My interpretation of this (and what I do in my postgresql.conf file, > without error) is to use a unit name, as such: > shared_buffers = 24GB > > -- > Born in Arizona, moved to Babylonia. > > > > -- > Wells Oliver > wells.oliver@gmail.com -- Born in Arizona, moved to Babylonia. --------------w7OJR4wRkuXsdjSQ1BTYtug1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Being AWS RDS is the kind of thing you need to mention.

Anyway, plain old bash bc does it for you.  Explicitly:
(24*1024^3)/1024/8

Powershell, too:
24*[bigint]::pow(1024,3)/1024/8

On 7/3/23 14:57, Wells Oliver wrote:
Yeah. Unfortunately in AWS RDS the parameter group settings accept input only in stricter format, so shared_buffers requires an integer value in KiB.

On Mon, Jul 3, 2023 at 12:56 PM Ron <ronljohnsonjr@gmail.com> wrote:
On 7/3/23 14:45, Wells Oliver wrote:
Sorry, this is dumb, but I wanted to double check that I'm doing the shared_buffers calc correctly given it's in 8kb blocks (block_size is set to 8192).

Want 24GB, which I think is 25165824 KiB so divided by 8 we get 3145728.

Do I have this correct? Usually can test these but wanted to run it by someone before having to restart the server.

Is there some calc web service out there that idiots such as myself can use for this?

https://www.postgresql.org/docs/15/runtime-config-resource.html

"If this value is specified without units, it is taken as blocks,"

My interpretation of this (and what I do in my postgresql.conf file, without error) is to use a unit name, as such:
shared_buffers = 24GB

--
Born in Arizona, moved to Babylonia.


--

--
Born in Arizona, moved to Babylonia.
--------------w7OJR4wRkuXsdjSQ1BTYtug1--