public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Friedrich Weber <f.weber@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-cluster 1/2] corosync: create config: allow setting token coefficient
Date: Thu, 12 Feb 2026 12:57:55 +0100	[thread overview]
Message-ID: <20260212115928.148999-2-f.weber@proxmox.com> (raw)
In-Reply-To: <20260212115928.148999-1-f.weber@proxmox.com>

By default, corosync calculates several timeouts based on the cluster
size, in particular the token timeout, which is a fixed base value
plus the number of nodes (minus 2) multipled by a factor called the
"token coefficient" (with a default of 650ms) [1].

New clusters should be created with a lower token coefficient. Thus,
allow to pass a custom token coefficient when creating the
configuration for a new corosync cluster.

[1] https://manpages.debian.org/trixie/corosync/corosync.conf.5.en.html#token_coefficient

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
---
 src/PVE/Corosync.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/Corosync.pm b/src/PVE/Corosync.pm
index f5b10fa..aef0d31 100644
--- a/src/PVE/Corosync.pm
+++ b/src/PVE/Corosync.pm
@@ -274,6 +274,7 @@ sub create_conf {
     my $clustername = $param->{clustername};
     my $nodeid = $param->{nodeid} || 1;
     my $votes = $param->{votes} || 1;
+    my $token_coefficient = $param->{'token-coefficient'};
 
     my $local_ip_address = PVE::Cluster::remote_node_ip($nodename);
 
@@ -324,6 +325,8 @@ sub create_conf {
         $node->{"ring${lnum}_addr"} = $link->{address};
     }
 
+    $totem->{token_coefficient} = $token_coefficient if defined($token_coefficient);
+
     return { main => $conf };
 }
 
-- 
2.47.3





  reply	other threads:[~2026-02-12 11:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 11:57 [PATCH cluster/docs 0/3] create new corosync clusters with lower " Friedrich Weber
2026-02-12 11:57 ` Friedrich Weber [this message]
2026-02-12 11:57 ` [PATCH pve-cluster 2/2] api: cluster config: create new " Friedrich Weber
2026-02-16 16:00   ` Maximiliano Sandoval
2026-02-16 19:36     ` Thomas Lamprecht
2026-02-17 12:44       ` Maximiliano Sandoval
2026-02-17 12:50         ` Friedrich Weber
2026-02-16 16:09   ` Maximiliano Sandoval
2026-02-12 11:57 ` [PATCH pve-docs 1/1] pvecm: config: document how to change the " Friedrich Weber
2026-02-13 10:12   ` Friedrich Weber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260212115928.148999-2-f.weber@proxmox.com \
    --to=f.weber@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal