Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rOhri-006RPB-0M for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jan 2024 17:32:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rOhrg-008ofP-Ox for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jan 2024 17:32:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rOhrg-008ofH-G1 for pgsql-hackers@lists.postgresql.org; Sat, 13 Jan 2024 17:32:12 +0000 Received: from mail-vs1-xe2e.google.com ([2607:f8b0:4864:20::e2e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rOhre-001acJ-RE for pgsql-hackers@lists.postgresql.org; Sat, 13 Jan 2024 17:32:11 +0000 Received: by mail-vs1-xe2e.google.com with SMTP id ada2fe7eead31-467e862de61so1357462137.3 for ; Sat, 13 Jan 2024 09:32:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705167128; x=1705771928; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bQj+rQb5bHVpKaJH8aXcm0AYdOkl6sN1SuckwLeP4wg=; b=M5UhpoZM8F5I7plIX614dtrB0RPjhpnZ4knzLZUHOc9rY6G8op1zdE/UVMRx45j0R9 pillO7ULwcgJLlWyrng51SEgBTHqv9zr1FCnCrUbOMWOfmdugB3mrPo/Pqsq+vMS3a7/ lVMgJmIysIRZyzSIL2/9ro8dFSV9e1NNh7D+hrpV6TJn/NXiTEwZ+ry+OCZlIqfaEgts DrbyaBFYnYOSaGGJLFc4pT8apPc2HFirOx4i4zvrOsGQvet459IHq7dZ+I5fm2Xvjszx szdPOrnu8s9OUiDHe+rJZD40Szv+ijzXoDzwf16Ajyk8m8G3DkmPTSsz1e2/CfXpRSvT AJAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705167128; x=1705771928; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bQj+rQb5bHVpKaJH8aXcm0AYdOkl6sN1SuckwLeP4wg=; b=ecPFHROCIhldy6+8j+v24YWlCngX0Xr3oEFjz2Ke+tsRtnPx+EdqDqkcrlnxwJPl/m qtJJmgR0x/OiW+UERMyEGUpbXt5KAkKFYAzE8B4O5we6ro+2b6vDNYs0o24dnOL7Acpm lIp1cnEiu1r2SHRbQQfxInEtrPU0wrVOr/67aqzCkCmsTB1xptOdiYkKaheD6csJRT2W XdED5MZDKxMGn7+xByl4C71TNlrxKbB2T6RX0KGZ6Py/I4doock0P765bG52gMpr3sz1 OerJd8l+eFQoBOus95jWlnpubqq8JqwwbUeQ45NXYz3X8Ofph7k+klwtRLiupxe64L+v VvLw== X-Gm-Message-State: AOJu0YwSfSFZI8zbayRxsBwkK9T7lPlquz7WRoP0+adceFKY1Nyr6Zo4 iI9ew/c2dFma0jjjkOw6eRQ8tKjBTp+0SeJtVm0= X-Google-Smtp-Source: AGHT+IEuG/sgOFh1DdOleFyTGUJYkliKP1Apu7FFVdD0VnwW0iZX0CQoDzK4QBSrHETR585MpYG5DWxPYtScBmjtAF4= X-Received: by 2002:a67:fc98:0:b0:467:7ac8:ad9e with SMTP id x24-20020a67fc98000000b004677ac8ad9emr1801762vsp.70.1705167128594; Sat, 13 Jan 2024 09:32:08 -0800 (PST) MIME-Version: 1.0 References: <170509767861.1131.15083983626399995184.pgcf@coridan.postgresql.org> In-Reply-To: <170509767861.1131.15083983626399995184.pgcf@coridan.postgresql.org> From: Roberto Mello Date: Sat, 13 Jan 2024 10:31:42 -0700 Message-ID: Subject: Re: [DOC] Add detail regarding resource consumption wrt max_connections To: Cary Huang Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000fb921d060ed72822" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fb921d060ed72822 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 12, 2024 at 3:15=E2=80=AFPM Cary Huang w= rote: > I think it is good to warn the user about the increased allocation of > memory for certain parameters so that they do not abuse it by setting it = to > a huge number without knowing the consequences. > > It is true that max_connections can increase the size of proc array and > other resources, which are allocated in the shared buffer, which also mea= ns > less shared buffer to perform regular data operations. I am sure this is > not the only parameter that affects the memory allocation. > "max_prepared_xacts" can also affect the shared memory allocation too so > the same warning message applies here as well. Maybe there are other > parameters with similar effects. > > Instead of stating that higher max_connections results in higher > allocation, It may be better to tell the user that if the value needs to = be > set much higher, consider increasing the "shared_buffers" setting as well= . > Appreciate the review, Cary. My goal was to inform the reader that there are implications to setting max_connections higher. I've personally seen a user mindlessly set this to 50k connections, unaware it would cause unintended consequences. I can add a suggestion for the user to consider increasing shared_buffers in accordance with higher max_connections, but it would be better if there was a "rule of thumb" guideline to go along. I'm open to suggestions. I can revise with a similar warning in max_prepared_xacts as well. Sincerely, Roberto --000000000000fb921d060ed72822 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Jan 12, 2024 at 3:15=E2=80=AFPM C= ary Huang <cary.huang@highgo.ca<= /a>> wrote:



--000000000000fb921d060ed72822--