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 1tUvNl-003s67-Fo for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 22:15:34 +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 1tUvNj-00Dy0I-MR for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 22:15:31 +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 1tUvNj-00Dy03-Bz for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 22:15:31 +0000 Received: from mail-yb1-xb31.google.com ([2607:f8b0:4864:20::b31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tUvNg-000Dxr-2N for pgsql-hackers@postgresql.org; Mon, 06 Jan 2025 22:15:30 +0000 Received: by mail-yb1-xb31.google.com with SMTP id 3f1490d57ef6-e54d268bc3dso632013276.1 for ; Mon, 06 Jan 2025 14:15:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736201728; x=1736806528; 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=O8MnPEAkj+6Rw70sqetGH9zjBh3emm2bi6/IEzH6glk=; b=imDVhAdSUaYc6NPLpkcx0YThcuhyhS5q1cWJVjSUqQ83CPOWL59KHrnLzCy2CEXwEN otpdKU7I9Lwk9uzh0VTRnimWuAnM9EylpTtM3o5YhcCKfWrAKNVOOsDpaNfMw4l1RBmy sDBn1JTxI5KoVHkIlGpelILvPBkFURciiiL30yyX2pAqI/9rOxs9UuX9V67qt+jgpyOr snqhRY1ZVZ1msAAaDVayxnZ/xWEle2ccvQBxZu/+hWIjrdw1sWowiga47AGhI3zFdJTg qfE0264F93PvaH43MB7YeDlhUr8W1NEA3E14DCSmUiGkj4z8d+3VfMDNp45bO0THgbf7 xpGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736201728; x=1736806528; 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=O8MnPEAkj+6Rw70sqetGH9zjBh3emm2bi6/IEzH6glk=; b=QOeIjaRwigct7Ry1KNI8g+0YJPe0xVjiVNrd9UvMD8iCZmx+Fy0ltR8znSvRmzc5G0 ZiGpyOlsup2xnVIuAI2+miyBOySEzNW1bQg+ESei0yCN4Gn9AiUh0Hily78HB5ipA15M 8b2JPy6OluWWPgvz8Y3+NCiw/sz9GfR4AJWM0vyc1huQ112WCguOfkKsr7cp5aM4GRi9 iLmO2yJfVhMdd9G2CCPpM2ZiDcswuhW+FKuxK/X3/fOLbQDXD3ZbOQrQfub2k/w9Jj0E bYgS1z58mHKrfss3Dvkvfb5U3TmP0/AGq4U85FcoFhslwDdmZUmHFBTllueh0GMU+zcg SJKQ== X-Forwarded-Encrypted: i=1; AJvYcCX2+UUN1zpx1c/yZAxsJloFwqAgMgRAgRaCmVZo63e789jVtWwptSFUZcE5CLR8jzuXvl1xY1P7wLrMPweV@postgresql.org X-Gm-Message-State: AOJu0YzqQR6gzQ/C2tZC5LRNHl0YnNXC3i5Kgc9Kbvq6FTrKF42vRouY rFum6KwbbxakYUc+h1YdR77Cx/cqXPY2uujkeZZt/dkHmmwyc53+ X-Gm-Gg: ASbGncvS95UijHco25g4oHXXPcKEmcSWZTu+F+D1ORCGngkgp1KlIxl3HUkdN1n7VvM 6RCzvFQu5q0hiuRaZ24SM7LbRYbYeE562n8D3tM8acHhpw/mrs/zxDtkTiXpQI1cRToiMbBndVn dKwKO27dhs3FyHFdKZ0G4MlAMl2ksZFw4HAKRUtwCQL/YSeTsxkLxYZYLlmBZFUNZkC9QQSwcsR riPSeF0zZ74WY45UcPd/nWfKO7L+ckElXTnwc2tC+JiH5EIti5JL4C89IiNEWglXUK0MewoKrk7 AEbkgaG3uI77sLJGwfWfD2+rTYqFDdJL/r/2wIuUE0FSz2s= X-Google-Smtp-Source: AGHT+IE/n1m3tTWQMXcIG7ZrI3OgXQuRkRBs21F19ee46QPcrvpndBxM0H0DQpJZ69d8MNEXgLl4+Q== X-Received: by 2002:a05:690c:6188:b0:6ef:820c:a752 with SMTP id 00721157ae682-6f3f814565fmr409192707b3.20.1736201728314; Mon, 06 Jan 2025 14:15:28 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 00721157ae682-6f3e77ee159sm86564167b3.87.2025.01.06.14.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 14:15:27 -0800 (PST) Date: Mon, 6 Jan 2025 16:15:25 -0600 From: Nathan Bossart To: Tom Lane Cc: Andres Freund , "Imseih (AWS), Sami" , Justin Pryzby , "pgsql-hackers@postgresql.org" Subject: Re: allow changing autovacuum_max_workers without restarting Message-ID: References: <1346002.1736198977@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="iBkHJFs49pTCTaNh" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --iBkHJFs49pTCTaNh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 06, 2025 at 03:50:24PM -0600, Nathan Bossart wrote: > I'm obviously biased, but I think it would be unfortunate to block features > like this one because of low settings that would otherwise be unsuitable > for any reasonable production workload. If we do want to at least support > check-world on these systems, another option could be to simply lower the > default of autovacuum_worker_slots to 7 (or maybe lower). Of course, that > only helps until the next time more semaphores are required, but that's not > a new problem. I've attached a patch to lower the default to 5. That at least gives a little bit of wiggle room for autovacuum_max_workers (and for a couple of new auxiliary processes). FWIW the reason I originally set the default to 16 was to prevent most users from ever needing to think about adjusting autovacuum_worker_slots (which requires a restart and is a completely new parameter that most will be unfamiliar with). -- nathan --iBkHJFs49pTCTaNh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-lower-default-of-autovacuum_worker_slots-to-5.patch" From 3f3c783c025e2a931bb766dc6d13c7186c957ebc Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Mon, 6 Jan 2025 16:09:49 -0600 Subject: [PATCH v1 1/1] lower default of autovacuum_worker_slots to 5 --- doc/src/sgml/config.sgml | 2 +- src/backend/utils/misc/guc_tables.c | 2 +- src/backend/utils/misc/postgresql.conf.sample | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 740ff5d5044..4fda5e6ae79 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -8639,7 +8639,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv; Specifies the number of backend slots to reserve for autovacuum worker - processes. The default is 16. This parameter can only be set at server + processes. The default is 5. This parameter can only be set at server start. diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index c9d8cd796a8..c75359b6bc4 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -3472,7 +3472,7 @@ struct config_int ConfigureNamesInt[] = NULL }, &autovacuum_worker_slots, - 16, 1, MAX_BACKENDS, + 5, 1, MAX_BACKENDS, NULL, NULL, NULL }, { diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index b2bc43383db..c7d3852c040 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -661,7 +661,7 @@ #autovacuum = on # Enable autovacuum subprocess? 'on' # requires track_counts to also be on. -autovacuum_worker_slots = 16 # autovacuum worker slots to allocate +autovacuum_worker_slots = 5 # autovacuum worker slots to allocate # (change requires restart) #autovacuum_max_workers = 3 # max number of autovacuum subprocesses #autovacuum_naptime = 1min # time between autovacuum runs -- 2.39.5 (Apple Git-154) --iBkHJFs49pTCTaNh--