[pve-devel] [PATCH manager 1/2] partially fix #5392: pveproxy: make number of workers configurable

Friedrich Weber f.weber at proxmox.com
Tue Jul 29 13:34:47 CEST 2025


The number of pveproxy 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 pveproxy.

Hence, allow specifying MAX_WORKERS in /etc/default/pveproxy to
override the number of workers.

Signed-off-by: Friedrich Weber <f.weber at proxmox.com>
---

Notes:
    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.

 PVE/Service/pveproxy.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
index c4bb54ea..ab455ff9 100755
--- a/PVE/Service/pveproxy.pm
+++ b/PVE/Service/pveproxy.pm
@@ -29,7 +29,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,
@@ -64,6 +64,7 @@ sub init {
 
     # we use same ALLOW/DENY/POLICY as pveproxy
     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/pveproxy.lck";
 
-- 
2.47.2





More information about the pve-devel mailing list