From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id A7BD863DE7 for ; Thu, 29 Oct 2020 08:33:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 9878525B2D for ; Thu, 29 Oct 2020 08:32:37 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 94F5325B22 for ; Thu, 29 Oct 2020 08:32:36 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 63ACD45F6D for ; Thu, 29 Oct 2020 08:32:36 +0100 (CET) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pve-devel@lists.proxmox.com Date: Thu, 29 Oct 2020 08:32:30 +0100 Message-Id: <20201029073230.1734462-1-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [influxdb.pm, proxmox.com, graphite.pm, plugin.pm] Subject: [pve-devel] [PATCH manager] status/metrics: make MTU 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: , X-List-Received-Date: Thu, 29 Oct 2020 07:33:07 -0000 since some users don't even have a full 1500 (and some systems might have links with bigger MTU and not require as much fragmentation). Signed-off-by: Fabian Grünbichler --- As reported in https://forum.proxmox.com/threads/error-message-too-long-in-external-metric.64642/ tested by configuring various values and looking at tcpdump output PVE/Status/Graphite.pm | 1 + PVE/Status/InfluxDB.pm | 1 + PVE/Status/Plugin.pm | 13 ++++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/PVE/Status/Graphite.pm b/PVE/Status/Graphite.pm index 41839a43..1b196c24 100644 --- a/PVE/Status/Graphite.pm +++ b/PVE/Status/Graphite.pm @@ -50,6 +50,7 @@ sub options { return { server => {}, port => { optional => 1 }, + mtu => { optional => 1 }, proto => { optional => 1 }, timeout => { optional => 1 }, path => { optional => 1 }, diff --git a/PVE/Status/InfluxDB.pm b/PVE/Status/InfluxDB.pm index c7bc15a9..589a4936 100644 --- a/PVE/Status/InfluxDB.pm +++ b/PVE/Status/InfluxDB.pm @@ -28,6 +28,7 @@ sub options { return { server => {}, port => {}, + mtu => { optional => 1 }, disable => { optional => 1 }, }; } diff --git a/PVE/Status/Plugin.pm b/PVE/Status/Plugin.pm index d6fba529..7b27d8fc 100644 --- a/PVE/Status/Plugin.pm +++ b/PVE/Status/Plugin.pm @@ -33,6 +33,14 @@ my $defaultData = { type => 'integer', description => "server network port", }, + mtu => { + type => 'integer', + description => "MTU for metrics transmission over UDP", + default => 1500, + min => 512, + maximum => 64*1024, + optional => 1, + }, }, }; @@ -69,7 +77,10 @@ sub _disconnect { # UDP cannot do more than 64k at once. Overwrite for different protocol limits. sub _send_batch_size { my ($class, $cfg) = @_; - return 1450; # assume 1500 MTU, empty IPv6 UDP packet needs 48 bytes overhead + + # default to 1500 MTU, empty IPv6 UDP packet needs 48 bytes overhead + my $mtu = $cfg->{mtu} // 1500; + return $mtu - 50; } # call with the smalles $data chunks possible -- 2.20.1