From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] status/metrics: make MTU configurable
Date: Thu, 29 Oct 2020 08:32:30 +0100 [thread overview]
Message-ID: <20201029073230.1734462-1-f.gruenbichler@proxmox.com> (raw)
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 <f.gruenbichler@proxmox.com>
---
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
next reply other threads:[~2020-10-29 7:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-29 7:32 Fabian Grünbichler [this message]
2020-10-29 8:12 ` [pve-devel] applied: " Thomas Lamprecht
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=20201029073230.1734462-1-f.gruenbichler@proxmox.com \
--to=f.gruenbichler@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