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.96) (envelope-from ) id 1wCaz1-0028xQ-1H for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2026 10:27:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wCayx-00BGmN-2d for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Apr 2026 10:27:00 +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.96) (envelope-from <9erthalion6@gmail.com>) id 1wCayx-00BGmE-1S for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2026 10:27:00 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from <9erthalion6@gmail.com>) id 1wCayw-000000010NU-0Eue for pgsql-hackers@lists.postgresql.org; Tue, 14 Apr 2026 10:27:00 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-6720c7968e4so198699a12.0 for ; Tue, 14 Apr 2026 03:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776162412; x=1776767212; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=VRaxQ75o8iMxRmaR3rcZMhVgpCJhYrQRz4tq8asvHz4=; b=EwF88/5fjNuvpNpiryOFnwyyH0B8k279IOAO7H4vZaowAQBM8XCx/xTiyHJYKG1mUj 21unZwGqGh9P+qACYyKLi1Ndxvmog049M49taF0g+CMrSZSxBl3jm3ibHVGv2wwCvqXz Xr9sc4OVsQIKGkQcf8sXH1SgXe4dNt2cSycLK77bfQOhJyW98/q3ueINSLbxz0Rt4vRN EjGn3lBe7Do7ePhxp6bWDSDmOWKVkXkapRgNcfl0oa1KvGMl+3bZa8UCqeoJ8kLDpdtJ QWC3CFB2OqhI8SRUz18ujDruif/dmtW0cGAFnrdWGDc0Mem1K87Iqg0oo1yuB+/tAsIj cr0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776162412; x=1776767212; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VRaxQ75o8iMxRmaR3rcZMhVgpCJhYrQRz4tq8asvHz4=; b=qpHC6aSzhBglvOEFWt0TvXNphCXzIfa5G8n20xhzm5RO83ZAiCE+iiEIenyJfO0Nj6 9UiJUak/RczNPSu5855LaibeTEFDz4QwesWXz6o9WT0kAGDAy5VPMUsQ5feTakMHx5Db Fo4CF2lcyklRsz/wvJPrh/YAOu3UW5Dll7hrSoRXfSe5XZaNBP0DsP175pfEQFa245qH 1nvv8a8IEcbQqUX6qRFKuJ8+tKtbfjCtISMU4zO5k9gd57slr2AlU2wY/s6UiRvFJRX7 Vd9O3OV8Kee8RBGyL7o+KV2K6M87SdM+QuHiUzhQLcMcD/jiw/Ae/OObZt8q8+5qDNOE Fn5g== X-Gm-Message-State: AOJu0YxFyhGrFsNcCuqh7RxmGJzgSo4BIlOKN+X3UT7GC/Px6jiWeJRC DgqwlBoTVTtDi2rt83D/th+ZXoJqEjDTp/zZzmzFOCAwii7cLSxCp+At X-Gm-Gg: AeBDieteWFu2DVJcp53tyQ8RITiRFZB33XxtCTEfv0jWJV8gd48nmxO/c/NoIwZTgoL FdEOFCeC/HNzNvMO0lbFzulFJtVRPDxjoz5z8SeNFkr7NbCLNMB3cPerGzM3G/vHEor+ot5UUzt h+s5EFs/Pae2O7AdVgg/TztFM2c0msowPXDP/ZzBl9rSKX1AiK9ZylLGzr2RHyTONWwrRcB8VS/ NV7vNNEr7Tw5zz1z+V3AHNsuIS6weslziAppcjIy3yW2dEnUIokCBVvRKZyGSPfFmXJKrKhHtz2 ri0FD1m7ZLH9F4sXoI4fUJY9RGNdlR4Y2dHLqTHrMUuPYQ/p8Sbgxdtap//64ApP2ZfI1JiWGSC L2q1ZzdVNgTAQfQLihbXJxP7glPGFsR/O6hHEzNvk/SjIKJ77Lq/INePikd8SMxwKxID67aGUC6 x3gDYbvnHgSDhTy2XWyXHGRIoNR0eOB7/9PRCZQLdG+djCEqSR3RXAtEy3s50DMW0jj5HVNCTah G5mhv+ZeT1TWMPhx2p0RBo2tpPh5CpCycqxIew6B/wVJHfI X-Received: by 2002:a05:6402:234c:b0:671:6a2f:29d0 with SMTP id 4fb4d7f45d1cf-6716a2f3659mr3824629a12.16.1776162411445; Tue, 14 Apr 2026 03:26:51 -0700 (PDT) Received: from ddolgov-thinkpadt14sgen1.rmtde.csb (dslb-084-056-106-044.084.056.pools.vodafone-ip.de. [84.56.106.44]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-670703f119dsm2957053a12.9.2026.04.14.03.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2026 03:26:49 -0700 (PDT) Date: Tue, 14 Apr 2026 12:26:46 +0200 From: Dmitry Dolgov <9erthalion6@gmail.com> To: Thomas Munro Cc: PostgreSQL Hackers Subject: Re: Automatically sizing the IO worker pool Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="y7euyuvj4dalpoin" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --y7euyuvj4dalpoin Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit > On Sat, Apr 11, 2026 at 06:35:18PM +1200, Thomas Munro wrote: > On Wed, Jul 30, 2025 at 10:15 PM Dmitry Dolgov <9erthalion6@gmail.com> wrote: > > As a side note, I was trying to experiment with this patch using > > dm-mapper's delay feature to introduce an arbitrary large io latency and > > see how the io queue is growing. > > FWIW, here's what I came up with while experimenting with that sort of thing: > > shared_preload_libraries=io_limit > io_limit.ios_per_second=6000 > > That differs from eg dm-mapper delays by making everything seem like > slow direct I/O, which seemed more interesting for this project. For > example if you run some continuous workload while you SET > io_limit.ios_per_second to various numbers, with > io_workers_idle_timeout set fairly low, you can monitor the pool > adjustments. Yeah, sounds like a good idea. Do you plan to introduce such an extension long term for testing, or is it just one off? As to me it looks worth keeping, maybe even use injections points to allow for more flexibility. And I know I sound like a broken record, but if I understand correctly the delays introduced via ios_per_seconds and others are constant in time -- I've experimented a bit and found some reference implementations in numpy for geometric distribution sampling, which allow to make the delay a random variable. Since the geometric distribution is a discrete analog of the exponential one, and the latter represents delays between events in Poisson distribution, such random variable would give an approximation for more real load. --y7euyuvj4dalpoin Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-contrib-io_limit-Simulation-of-slow-storage.patch"