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 1rwPOJ-001Pbl-6J for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Apr 2024 16:41:11 +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 1rwPOH-00EE9i-Ic for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Apr 2024 16:41:09 +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 1rwPLA-00EA8m-OR for pgsql-hackers@lists.postgresql.org; Mon, 15 Apr 2024 16:37:56 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rwPL7-0016mv-15 for pgsql-hackers@postgresql.org; Mon, 15 Apr 2024 16:37:56 +0000 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-36a205e0f16so14052155ab.1 for ; Mon, 15 Apr 2024 09:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713199071; x=1713803871; 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=UCGOvAxEmLEnTBExut2MgqWBS30gliBt7cvV265C9Os=; b=K4N+7YMJuTN0TVA3Za6U4oL/4LCVWicir45CfGSdQjRerpWo2/cbr6Yfn4Pz/AtmbV lLFn8T5ZeUdTSkizysAKmV7I3CrEMmr2uVfHLLT1USyVxiV1SPvS0e2KfWGYunxk98FQ VoQrIN5LBdTCUZihpW2KMZ0FwIvwps+iKIkVz9j6GwAMSp4DWIrlXnZl51PdL9Di/qlF YC7hrzrAAoPqnOm5k+u4zOKKy8tWrggq2WeHPtJ7QOwKQXAM3RKcZ8ynRFMRoaNBRFJX W79xCXiRACkRA3SfbCs/ic8B1da3ZyIe92TVh74Lgg6CQMtcoZak0prvx7c+oTPAPPNM vBwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713199071; x=1713803871; 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=UCGOvAxEmLEnTBExut2MgqWBS30gliBt7cvV265C9Os=; b=aMHGufdc4nBcFkT7Tbb9ItTeXu07eC0teV/U0JmoYq3IcFEdS4SQ4H5rEiZiyhpojA /9ieHbHOtzRKJCdBUSvDuQiUHdO/Qao3LDRBLAipYKKirnuU6iZgkREQjQXy8yZKkBlg kWa4g4FdldhPlMgXBgBPdjei5CCyb2wS1c1+ddv5yyagN1I/pwYzlLi67WEUZvHh9eKL +Sn+qTeQVpLB9NqtAwGnFvjM4UA3Ja+jHXi9Q94QJ1y4plgpr6SDomH2X6lJ9F7jFleO RZ/Ey3UC4MycXk/pToSvySqW8XGCo26d1AVPqUomxAxZlUoVvPmIcK0Tc9SjgfcJWutN VopA== X-Gm-Message-State: AOJu0YzghhjoaNnX6ViOyu+ACLR5k9dyoAlI0Of/CaxkCKS0nqdAHtqd AI+nrtArfQVXn27t0bnzDN9axLReUwXr727dxmetFonaRSbhzanHOeXIZg== X-Google-Smtp-Source: AGHT+IGj0C2o7u2vRLC4m+JE5LMhvH7jX88iJCZN6sZJk/ecVElUkb1APJvFCfCf/bKMtm1mdRI9KA== X-Received: by 2002:a05:6e02:20e2:b0:36b:10f4:4dc with SMTP id q2-20020a056e0220e200b0036b10f404dcmr10601007ilv.23.1713199071065; Mon, 15 Apr 2024 09:37:51 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id a3-20020a92c703000000b0036a1386cea0sm2686899ilp.42.2024.04.15.09.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:37:50 -0700 (PDT) Date: Mon, 15 Apr 2024 11:37:49 -0500 From: Nathan Bossart To: Justin Pryzby Cc: pgsql-hackers@postgresql.org Subject: Re: allow changing autovacuum_max_workers without restarting Message-ID: <20240415163749.GA2858464@nathanxps13> References: <20240410212344.GA1824549@nathanxps13> <20240415162833.GA2857238@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240415162833.GA2857238@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 15, 2024 at 11:28:33AM -0500, Nathan Bossart wrote: > On Mon, Apr 15, 2024 at 08:33:33AM -0500, Justin Pryzby wrote: >> On Wed, Apr 10, 2024 at 04:23:44PM -0500, Nathan Bossart wrote: >>> The proof-of-concept patch keeps autovacuum_max_workers as the maximum >>> number of slots to reserve for workers, but I think we should instead >>> rename this parameter to something else and then reintroduce >>> autovacuum_max_workers as the new parameter that can be adjusted without >>> restarting. That way, autovacuum_max_workers continues to work much the >>> same way as in previous versions. >> >> When I thought about this, I considered proposing to add a new GUC for >> "autovacuum_policy_workers". >> >> autovacuum_max_workers would be the same as before, requiring a restart >> to change. The policy GUC would be the soft limit, changable at runtime >> up to the hard limit of autovacuum_max_workers (or maybe any policy >> value exceeding autovacuum_max_workers would be ignored). >> >> We'd probably change autovacuum_max_workers to default to a higher value >> (8, or 32 as in your patch), and have autovacuum_max_workers default to >> 3, for consistency with historic behavior. Maybe >> autovacuum_policy_workers=-1 would mean to use all workers. > > This sounds like roughly the same idea, although it is backwards from what > I'm proposing in the v1 patch set. My thinking is that by making a new > restart-only GUC that would by default be set higher than the vast majority > of systems should ever need, we could simplify migrating to these > parameters. The autovacuum_max_workers parameter would effectively retain > it's original meaning, and existing settings would continue to work > normally on v18, but users could now adjust it without restarting. If we > did it the other way, users would need to bump up autovacuum_max_workers > and restart prior to being able to raise autovacuum_policy_workers beyond > what they previously had set for autovacuum_max_workers. That being said, > I'm open to doing it this way if folks prefer this approach, as I think it > is still an improvement. Another option could be to just remove the restart-only GUC and hard-code the upper limit of autovacuum_max_workers to 64 or 128 or something. While that would simplify matters, I suspect it would be hard to choose an appropriate limit that won't quickly become outdated. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com