From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id A929F1FF0B3 for ; Wed, 14 Oct 2026 14:23:40 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 70F9021457; Wed, 14 Oct 2026 14:23:38 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 14 Oct 2026 14:23:32 +0200 Message-Id: To: "Michael Ryom" , Subject: Re: [PATCH ha-manager 3/7] manager: auto rebalance: require a minimum absolute imbalance improvement From: "Daniel Kral" X-Mailer: aerc 0.22.0-10-g6373ac9d2179-dirty References: <20260920162220.574802-1-Michael@RyomHerold.dk> <20260920162220.574802-4-Michael@RyomHerold.dk> In-Reply-To: <20260920162220.574802-4-Michael@RyomHerold.dk> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1791980612504 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.796 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VHUPEGYLWX3JQ3M2R45D6VMC2FEKMZAQ X-Message-ID-Hash: VHUPEGYLWX3JQ3M2R45D6VMC2FEKMZAQ X-MailFrom: d.kral@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Sun Sep 20, 2026 at 6:22 PM CEST, Michael Ryom wrote: > The automatic load balancer only requires a relative improvement of the > node imbalance (default 10%). When a single resource dominates the > cluster load, the relative margin provides almost no hysteresis: with > two nodes, a resource load v and a node base load difference d, the > relative improvement of moving the resource is 2d / (v + d), so it > exceeds a margin m as soon as d > v * m / (2 - m). For a mid-size VM > that is a base load difference of about half a percentage point, well > within the normal fluctuation of e.g. the ZFS ARC or Ceph daemons, and > each fluctuation then qualifies a motion (and, after it was carried > out, its reverse). > > Additionally require the imbalance improvement to exceed a minimum > absolute value of 5 percentage points. This creates a dead band for > motions that shuffle load without meaningfully improving the cluster > balance. No expected motion of an existing regression test is affected; > the smallest occurring improvement there is 9.6 percentage points. > > Like the backoff and cooldown constants, this could be exposed as a > ha-auto-rebalance-* option later. I think the absolute minimum imbalance improvement is a good idea. The relative 'margin' was only introduced to compensate for the initially unbound imbalance value for different cluster sizes, which was changed to be in [0,1] for all cluster sizes only in a later revision. Though I'd prefer if this can be configured by users from the get-go. For simplicity, I'd merge it with the ha-auto-rebalance-margin option, and add a flag which can switch the value's semantic meaning between 'relative' (the default, because of backwards compatibility) and 'absolute'. Except if there really are use cases which require both a relative and an absolute minimum imbalance improvement? Of course, 'absolute' should still mean decreasing it and not increasing it, the same way it was for 'relative' ;). > > Signed-off-by: Michael Ryom