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 1rjK61-004tC8-ST for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Mar 2024 14:24: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 1rjK60-004VH6-AD for pgsql-hackers@arkaria.postgresql.org; Sun, 10 Mar 2024 14:24:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjK60-004VGy-0f for pgsql-hackers@lists.postgresql.org; Sun, 10 Mar 2024 14:24:12 +0000 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rjK5w-003nWp-2N for pgsql-hackers@lists.postgresql.org; Sun, 10 Mar 2024 14:24:11 +0000 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-413216c3ea4so5699985e9.1 for ; Sun, 10 Mar 2024 07:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710080647; x=1710685447; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:subject:cc:to:from:date :sender:message-id:from:to:cc:subject:date:message-id:reply-to; bh=bf9z08SCRHIJHuGal8CPKNDfCjdeBn9a4Z4bpFRVApo=; b=BkHOhofH1M180ZtlOmCA65Bac32/Dknyeov0nYaTJuLyUxsaKsaUcUt6whSzEplbag IJTYn4gx5fCr7Y4sVX+CV1YXYkWIv5Pdsikmf7+KWqhnrTdcgIpMYTazyeFH3MdkP77E m3Kg89wc3lWWuhW302HYzrrQ6TLy1WYrlbxkie8YR2QFJqSea3Qre9YISeJlwgTXkhwb gpWjCxvvn6/2EIYAab7z2Ba44owB/FB3unXLAVIXFH1kAQXI/dNfDnrZr7fTLZVf6xCu +4HekIWlCIOMyRwQ6dCM/yUHU3SI7lfIzDQvH9M95hNQfHAm4nF+degRpBrmulXUsWLp wq2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710080647; x=1710685447; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:subject:cc:to:from:date :sender:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bf9z08SCRHIJHuGal8CPKNDfCjdeBn9a4Z4bpFRVApo=; b=X1MRoCBv9Ox6F0mE5zZVfpG5LSUWygPTlII1gHGrLiPCraHp09GqStcNTVMPVtza7u M4WbQytEfTrm1FE+PsZeemjMMHvg1zSsWWEEJ1r/SmWR1fmNxKF+DfZf3jpZ1KrXP+P6 P2sFBES9g+GBsTAy+aHMoI+Muwacp3/H1yurKM+ha+rgHcIgM6L8UcTAx5veDK5aqyft QRGaHOKETL7r2JO0gauoqTO3fbyca20JnURwRQybnfzP8qC7GAMnxv6ZfBtAQVHV3gl2 r3EzuVElsVi//sJALj/BM9w8ULYKUewPVC/ZRD9akd4s551pvJXIVcQcq1ptucDQld26 fhSw== X-Forwarded-Encrypted: i=1; AJvYcCWNcAZs29TbO45uEAjE2JTHI8aO3QRZdzDId+9lElhSQTKcSinwhmt9wsMqEbq++V1hUhrt334v55rYrCZI3e+LbOeg+DEHCGj19IPfIBg5dOs/ X-Gm-Message-State: AOJu0YykvgG9pPvWSviBg0Jk+JfSY1qnEWnpPifFzFLPeiR/WdFzV7WK f3c5uu5hJY1wabhjU5rcrX1uWqHanDzam1xfHrhTAcKyA/mloIDx X-Google-Smtp-Source: AGHT+IHsiom2P6eyKvHuAvyCPj46CRt7fsdxIsvuCkTByksdpCOBagRQSnbROVlKtDfErc4btyZSIw== X-Received: by 2002:a05:600c:4fce:b0:412:f4b4:2717 with SMTP id o14-20020a05600c4fce00b00412f4b42717mr3395329wmq.26.1710080646773; Sun, 10 Mar 2024 07:24:06 -0700 (PDT) Received: from lightning.caipicrew.dd-dns.de ([2001:a61:a0e:9401:f815:e42b:c961:9a62]) by smtp.gmail.com with ESMTPSA id je1-20020a05600c1f8100b00412c1d51a0dsm5867983wmb.45.2024.03.10.07.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 07:24:06 -0700 (PDT) Message-ID: <65edc286.050a0220.ab68f.397b@mx.google.com> X-Google-Original-Message-ID: <20240310142404.GM17618@caipicrew.dd-dns.de;lightning.caipicrew.dd-dns.de> Sender: Michael Banck Received: from mbanck by lightning.caipicrew.dd-dns.de with local (Exim 4.92) (envelope-from ) id 1rjK5t-0005Hu-HI; Sun, 10 Mar 2024 15:24:05 +0100 Date: Sun, 10 Mar 2024 15:24:05 +0100 From: Michael Banck To: Robert Treat Cc: Cary Huang , pgsql-hackers@lists.postgresql.org, Roberto Mello Subject: Re: [DOC] Add detail regarding resource consumption wrt max_connections References: <170509767861.1131.15083983626399995184.pgcf@coridan.postgresql.org> <65eb32e8.170a0220.fcc9.ff2f@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, Mar 10, 2024 at 09:58:25AM -0400, Robert Treat wrote: > On Fri, Mar 8, 2024 at 10:47 AM Michael Banck wrote: > > On Fri, Jan 12, 2024 at 10:14:38PM +0000, Cary Huang wrote: > > > 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. > > > > Right, and I think it might be useful to log (i.e. at LOG not DEBUG3 > > level, with a nicer message) the amount of memory we allocate on > > startup, that is just one additional line per instance lifetime but > > might be quite useful to admins. Or maybe two lines if we log whether we > > could allocate it as huge pages or not as well: > > > > |2024-03-08 16:46:13.117 CET [237899] DEBUG: invoking IpcMemoryCreate(size=145145856) > > |2024-03-08 16:46:13.117 CET [237899] DEBUG: mmap(146800640) with MAP_HUGETLB failed, huge pages disabled: Cannot allocate memory > > > > If we were going to add these details (and I very much like the idea), > I would advocate that we put it somewhere more permanent than a single > log entry at start-up. Given that database up-times easily run months > and sometimes years, it is hard to imagine we'd always have access to > the log files to figure this out on any actively running systems. Well actually, those two numbers are already available at runtime, via the shared_memory_size and (from 17 on) huge_pages_status GUCs. So this would be geared at admins that keeps in long-term storage and want to know what the numbers were a while ago. Maybe it is not that interesting, but I think one or two lines at startup would not hurt. Michael