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 1thw9O-008oi5-4o for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Feb 2025 19:42:30 +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 1thw9L-00EqkH-QO for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Feb 2025 19:42:27 +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 1thw9K-00Eqk8-Vp for pgsql-hackers@lists.postgresql.org; Tue, 11 Feb 2025 19:42:27 +0000 Received: from fout-b2-smtp.messagingengine.com ([202.12.124.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1thw9H-000J7H-21 for pgsql-hackers@postgresql.org; Tue, 11 Feb 2025 19:42:26 +0000 Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id AEFC6114012B; Tue, 11 Feb 2025 14:42:22 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Tue, 11 Feb 2025 14:42:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1739302942; x=1739389342; bh=q4y8TF+nmS 20YOB1OnG76Xcq61gfduq83JFM9VRa9DI=; b=UYo3AGijrq1rDOr/vPtGvpglMG pVeZ+/x5HmAAwM5+mtFZywhaAGF8xLRESq++yhdt+sUho5fXmcS82cXbihIpWtL0 C/PO0vD204VT8UFP7Bsc7CTh1PiH77er4zzNpeNbsVvl6zS6819fOK/z35k3TFEA q5FpXb7ReK1a5mWKNUNGZsvgQTWaz0OxCn7E1/Nb5fXu4JyTTP/1qHKAi1D0vxxC iDRC08RS8Ne152mGYvWUMmtwlbIuMu61uMZCRMPsKBJbVS0GwDAQwn08LHNacY3b XyiUEUX+R97ze015CQTmYPD6axyCQpqpZ2dy55Y4FADrjCX9pQ133pXQhgsQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1739302942; x=1739389342; bh=q4y8TF+nmS20YOB1OnG76Xcq61gfduq83JF M9VRa9DI=; b=IQB+QR2qu37D8qwFMOzVvI1LLXSgZBIIBS6qQp4Aye+F3431P4e vCv66yBovVJ5G+ipGl6nUKNLfmf2fH783rk/Ootg08gGuRwbLv3VMVNFo0jxebjY sZlnQxzeII/If9vofuw/JUiwQ5UNqr/Yqg9slrqSEa4FuWZW78L90y/QMaQHeHOw GEtu097CMMjgJjkTZHVQ2b8fauFGk6AjJDbr3Dil4nx5/6UUrB7PFG+qRP3/ZrrX F6iXpgNA/3vBOEPBPTfklT7oiBuO9T1D+ZfXHxBY2KDNSYT2xgghfqFbyr3NK5zM KmXYv8lxTXEi7M+efdur17i8G9AHup/xKsA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegudekjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvf evuffkfhggtggujgesthdtsfdttddtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhn ugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrthhtvghrnhepfe ffgfelvdffgedtveelgfdtgefghfdvkefggeetieevjeekteduleevjefhueegnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghsse grnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehpohhsthhgrhgvshesjhgvlhhtvghfrdhnlhdprhgtphhtthhope hpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Feb 2025 14:42:22 -0500 (EST) Date: Tue, 11 Feb 2025 14:42:21 -0500 From: Andres Freund To: Jelte Fennema-Nio Cc: PostgreSQL-development Subject: Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup Message-ID: <4qacnswlyykgj6p2gon4pvv7r2cb4adtedguer6pmaktr4xdve@om6ej7u4qw7p> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2025-02-11 19:52:34 +0100, Jelte Fennema-Nio wrote: > So this starts bumping postmaster and pgbench its soft open file limit > to the hard open file limit. Not sure that's quite the right thing to do for postmaster. What I'd start with is to increase the soft limit to "already used files" + max_files_per_process. That way we still limit "resource" usage, but react better to already used FDs. If io_uring, listen_addresses, whatnot use FDs max_files_per_process would be added ontop. Then we can separately discuss increasing max_files_per_process more aggressively. I don't see a downside to just increasing the soft limit for pgbench. It avoids the stupid cycle of getting "need at least %d open files, but system limit is %ld", increase ulimit, retry, without any non-theoretical downsides. > Doing so is especially useful for the AIO work that Andres is doing, because > io_uring consumes a lot of file descriptors. Yep. One more reason this is a good idea is that we'll also need this for threading, since there all client connections obviously will eat into the "normal file descriptor" budget. Greetings, Andres Freund