From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B64F11FF16B for ; Tue, 29 Jul 2025 17:51:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0761217A09; Tue, 29 Jul 2025 17:52:41 +0200 (CEST) From: Friedrich Weber To: pve-devel@lists.proxmox.com Date: Tue, 29 Jul 2025 17:50:57 +0200 Message-ID: <20250729155227.157120-4-f.weber@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250729155227.157120-1-f.weber@proxmox.com> References: <20250729155227.157120-1-f.weber@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753804346285 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.011 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pvedaemon.pm] Subject: [pve-devel] [PATCH manager 2/2] partially fix #5392: pvedaemon: make number of workers configurable X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" The number of pvedaemon worker processes is currently hardcoded to 3. This may not be enough for automation-heavy workloads that trigger a lot of API requests that are synchronously handled by pvedaemon. Hence, read /etc/default/pvedaemon when starting pvedaemon and allow overriding the number of workers by specifying MAX_WORKERS in this file. All other values are only relevant for pveproxy/spiceproxy and thus ignored. Signed-off-by: Friedrich Weber --- Notes: I'm not sure if reading /etc/default/pvedaemon, which was not used until now, is a good solution here, but I decided to go for it because it seems relatively straightforward and analogous to pveproxy. Also here, I decided against setting max_workers directly directly in %daemon_options, to avoid having to call read_proxy_config already then. If I understand correctly, overriding $self->{max_workers} in init should be fine because it's only used in PVE::Daemon's $server_run after init was called. changes since rfc: none PVE/Service/pvedaemon.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PVE/Service/pvedaemon.pm b/PVE/Service/pvedaemon.pm index 9d7cbc0f..4493f234 100755 --- a/PVE/Service/pvedaemon.pm +++ b/PVE/Service/pvedaemon.pm @@ -15,7 +15,7 @@ use base qw(PVE::Daemon); my $cmdline = [$0, @ARGV]; my %daemon_options = ( - max_workers => 3, + max_workers => 3, # may be overridden in init restart_on_error => 5, stop_wait_time => 15, leave_children_open_on_reload => 1, @@ -26,6 +26,10 @@ my $daemon = __PACKAGE__->new('pvedaemon', $cmdline, %daemon_options); sub init { my ($self) = @_; + # all options other than MAX_WORKERS are ignored + my $proxyconf = PVE::APIServer::Utils::read_proxy_config($self->{name}); + $self->{max_workers} = $proxyconf->{MAX_WORKERS} if $proxyconf->{MAX_WORKERS}; + my $accept_lock_fn = "/var/lock/pvedaemon.lck"; my $lockfh = IO::File->new(">>${accept_lock_fn}") -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel