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 1thzJh-009dlC-7I for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Feb 2025 23:05:21 +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 1thzIh-001ip1-3W for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Feb 2025 23:04:19 +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 1thzIg-001iot-Q6 for pgsql-hackers@lists.postgresql.org; Tue, 11 Feb 2025 23:04:19 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1thzIf-000Iwn-2h for pgsql-hackers@postgresql.org; Tue, 11 Feb 2025 23:04:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 51BN4FXc3228047; Tue, 11 Feb 2025 18:04:15 -0500 From: Tom Lane To: Tomas Vondra cc: Jelte Fennema-Nio , PostgreSQL-development , Andres Freund Subject: Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup In-reply-to: References: <3203865.1739301613@sss.pgh.pa.us> <94798ef1-0f13-416a-983a-88447e434a7f@vondra.me> <3209989.1739305120@sss.pgh.pa.us> Comments: In-reply-to Tomas Vondra message dated "Tue, 11 Feb 2025 23:33:45 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3228045.1739315055.1@sss.pgh.pa.us> Date: Tue, 11 Feb 2025 18:04:15 -0500 Message-ID: <3228046.1739315055@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Vondra writes: > On 2/11/25 21:18, Tom Lane wrote: >> I think what we actually would like to know is how often we have to >> close an open FD in order to make room to open a different file. >> Maybe that's the same thing you mean by "cache miss", but it doesn't >> seem like quite the right terminology. Anyway, +1 for adding some way >> to discover how often that's happening. > We can count the evictions (i.e. closing a file so that we can open a > new one) too, but AFAICS that's about the same as counting "misses" > (opening a file after not finding it in the cache). After the cache > warms up, those counts should be about the same, I think. Umm ... only if the set of files you want access to is quite static, which doesn't seem like a great bet in the presence of temporary tables and such. I think if we don't explicitly count evictions then we'll be presenting misleading results. regards, tom lane