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 1tudex-00AMyU-M7 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 20:35:35 +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 1tudew-004wKt-77 for pgsql-hackers@arkaria.postgresql.org; Tue, 18 Mar 2025 20:35:34 +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 1tudev-004wKK-Ty for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 20:35:33 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tudes-003d91-0g for pgsql-hackers@lists.postgresql.org; Tue, 18 Mar 2025 20:35:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2025010100; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=I9nI6nOTbjWO0Kmj+EiBjxKRwQjLTnxqsaCxfg0SHPY=; b=NgCcg Sfay5/uogGrkX6JJ1yUw16/5QMQInCqZK04mOtHpku1FIzJ5+PKZe3JSHVTvNeCF7WAAw2savamnU 8VGifIwpF3dF1dP4kCpugaLYNhLjBkdIenC3i0moPAUbQZzsSx/hMXg64nrZCqNN6TNqdqS9FBjgf wlD2JhYvFLaGbNJkeWdpr6LmkHmhhXp0d3sPreujbaE27qVchIr5bsEdbdPweVBtnh83MJavXKSaK tWLYVyXMoxpsAR4UjDVv/lqcDnVaPlZHBLu7ycH9QhaPVjJEAkhfW4d+VsFO9nLKXdXbdxJi7ZnlE SWVlNXcm08gqJo6xMlv7dNxU/wIFg==; Received: from bruce by momjian.us with local (Exim 4.96) (envelope-from ) id 1tuder-001me2-0v; Tue, 18 Mar 2025 16:35:29 -0400 Date: Tue, 18 Mar 2025 16:35:29 -0400 From: Bruce Momjian To: Andres Freund Cc: Melanie Plageman , PostgreSQL-development Subject: Re: Increase default maintenance_io_concurrency to 16 Message-ID: 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 On Tue, Mar 18, 2025 at 04:27:18PM -0400, Andres Freund wrote: > Hi, > > On 2025-03-18 16:22:45 -0400, Bruce Momjian wrote: > > On Tue, Mar 18, 2025 at 04:13:26PM -0400, Andres Freund wrote: > > > Hi, > > > > > > On 2025-03-18 16:08:22 -0400, Bruce Momjian wrote: > > > > This commit makes our default random_page_cost = 4 out of line with > > > > these new settings (assumes modern SSD/NAS/SAN hardware) and more out of > > > > line with reality. > > > > > > How so? That seems like an independent consideration to me. > > > > [thread moved to hackers] > > > > Uh, I think our old random_page_cost and *_io_concurrency assumed > > magnetic disks --- now *_io_concurrency assumes more modern hardware and > > random_page_cost assumes magnetic. > > The cost difference between random and non-random IO is actually still > reasonably accurate with NVMEs. You can argue that random_page_cost should be > 2.5, but that really depends on the specific hardware. Uh, the random_page_cost = 4 assumes caching, so it is assuming actual random I/O to be 40x slower, which I doubt is true for SSDs: https://www.postgresql.org/docs/current/runtime-config-query.html#RUNTIME-CONFIG-QUERY-CONSTANTS Random access to mechanical disk storage is normally much more expensive than four times sequential access. However, a lower default is used (4.0) because the majority of random accesses to disk, such as indexed reads, are assumed to be in cache. The default value can be thought of as modeling random access as 40 times slower than sequential, while expecting 90% of random reads to be cached. > Particularly for cloud style networked storage, you could even argue that the > difference between sequential and random IO has *grow* given recent changes in > PG (io combining in PG 17), as random IOs much more quickly lead to exhausting > IOPS quotas. > > I still don't think adjusting random_page_cost has any meaningful relation to > the change at hand. Okay, I was just asking. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.