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 1sEDPB-000Ft2-HM for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jun 2024 19:31:42 +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 1sEDP9-00CZab-Ee for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jun 2024 19:31:39 +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 1sEDLy-00CUCZ-6k for pgsql-hackers@lists.postgresql.org; Mon, 03 Jun 2024 19:28:22 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sEDLs-003II5-8Y for pgsql-hackers@postgresql.org; Mon, 03 Jun 2024 19:28:20 +0000 Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-3737b70a74aso15261305ab.0 for ; Mon, 03 Jun 2024 12:28:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717442895; x=1718047695; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4iQZcmIUoqYnNMlPVqt4gKCg5mXFFucOSUsPZmAvRxc=; b=mhEIdDjnhfcIuQMUsuzZU8Mkv/FEoBouv26oQfyMIZiAeUyM/rnKJ3xEx4kdPViJG2 PT0EpH3U9NRyMmNelHU5aRD9Tz4q6tZp8RUuHF8SSovFKS6xbXMTrpEfeGcPa/UJp5+9 mSbUv4VWnILmbu4gw1RG4QnphXcAENkpoN9DmRCZIZjzDsw4TxtGcjxXhpYpxESQw/b6 JwU2d1q6WyjR8NJoUapWV3Vmm1OKtSxUfoIWqwk9i/EqKk4yUDN+5Qepn/4EA0MMmND0 szIuNjI+hRTUeuqrkuSK8uIiWHv2TrPJaKx4OvxCvQiICYlTCjNlKRx9KVtks04gv3Za WsSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717442895; x=1718047695; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4iQZcmIUoqYnNMlPVqt4gKCg5mXFFucOSUsPZmAvRxc=; b=LCEvBEhcpOwoC8ICUnqSk6/nwXFYaAbg9h/TVqxPUVh7pHCYUwY52lQhzxsZNutWk6 qdZgD2+FmB7/6/R3Uzs9rrVgiRL75dYY/UpzG9I3ErSWDGBHd4zbkNNTWJEX71Y/jsOY OkE5BV8dlK1szquCPT1a7mwhd+2p+MyUE/ChximoSoN4UaWBDQnzY7a2BVzilyEJ5Ndy i1OgTGbCDlctSkUXjOlGTkSBi8lKObPp0PbMjEzfC5qgwmLktyXJv6MW0RR1JmolEEgG magxJsBRxkJfFzR3YnzoZiac2Q21OEvZe4+c7uZ28+AvXcJIVWFcyBsang3mGw/MMryT S/Cw== X-Forwarded-Encrypted: i=1; AJvYcCXfg0V51N0zyq5criwtEHcIRNf2rMJgX+C3BB+AtpWeMlC4gBpuOEggVqHclKhEGeAS8QWf510714e1XrGdjn3bqL3WwcUqKAL62W/m X-Gm-Message-State: AOJu0YxyEWxYPX5gITGP0VLJjil/Jist9A0FThC+DZQ4G1QOITaK2rxg ikowOngN/cBBttuv3HOJCDViZ30eAJD2Y89fcMWqdQ5MXwuKiPqN X-Google-Smtp-Source: AGHT+IGcGuxdSqRyfaOg56HmKzldVurTMpwisTT6VzOmUYMFRnwxXFbxZueaiZLeiiK/MB4ft5UAVA== X-Received: by 2002:a05:6e02:154c:b0:371:40b4:5769 with SMTP id e9e14a558f8ab-374a84ec3b9mr4690235ab.7.1717442895459; Mon, 03 Jun 2024 12:28:15 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-374a6bbf302sm2093775ab.22.2024.06.03.12.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 12:28:15 -0700 (PDT) Date: Mon, 3 Jun 2024 14:28:13 -0500 From: Nathan Bossart To: Andres Freund Cc: "Imseih (AWS), Sami" , Justin Pryzby , "pgsql-hackers@postgresql.org" Subject: Re: allow changing autovacuum_max_workers without restarting Message-ID: References: <20240415162833.GA2857238@nathanxps13> <20240415163749.GA2858464@nathanxps13> <96B4FC7B-A919-4F93-80A3-BA3EA4F8479A@amazon.com> <20240503010415.GA1008894@nathanxps13> <2780DB08-DCA6-4E57-B823-303A0E7E17D7@amazon.com> <20240507160605.GA2523153@nathanxps13> <011CA929-4933-40EA-B1D3-29131FEFBCF0@amazon.com> <20240517021646.GA1745636@nathanxps13> <20240603190852.jcibstxflb33hjvu@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240603190852.jcibstxflb33hjvu@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jun 03, 2024 at 12:08:52PM -0700, Andres Freund wrote: > I don't have time to read through the entire thread right now - it'd be good > for the commit message of a patch like this to include justification for why > it's ok to make such a change. Even before actually committing it, so > reviewers have an easier time catching up. Sorry about that. I think the main question (besides "should we do this?") is whether we ought to make the upper limit configurable. My initial idea was to split autovacuum_max_workers into two GUCs: one for the upper limit that only be changed at server start and another for the effective limit that can be changed up to the upper limit without restarting the server. If we can just set a sufficiently high upper limit and avoid the extra GUC without causing problems, that might be preferable, but I sense that you are about to tell me that it will indeed cause problems. :) > Why do we think that increasing the number of PGPROC slots, heavyweight locks > etc by 256 isn't going to cause issues? That's not an insubstantial amount of > memory to dedicate to something that will practically never be used. I personally have not observed problems with these kinds of bumps in resource usage, although I may be biased towards larger systems where it doesn't matter as much. > ISTM that at the very least we ought to exclude the reserved slots from the > computation of things like the number of locks resulting from > max_locks_per_transaction. It's very common to increase > max_locks_per_transaction substantially, adding ~250 to the multiplier can be > a good amount of memory. And AV workers should never need a meaningful number. This is an interesting idea. > Increasing e.g. the size of the heavyweight lock table has consequences > besides the increase in memory usage, the size increase can make it less > likely for the table to fit largely into L3, thus decreasing performance. IMHO this might be a good argument for making the upper limit configurable and setting it relatively low by default. That's not quite as nice from a user experience perspective, but weird, hard-to-diagnose performance issues are certainly not nice, either. -- nathan