mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-07 07:56:39 +00:00
status/metrics: make MTU configurable
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>
This commit is contained in:
parent
0b9e52ddc6
commit
0fc553eb1b
@ -50,6 +50,7 @@ sub options {
|
|||||||
return {
|
return {
|
||||||
server => {},
|
server => {},
|
||||||
port => { optional => 1 },
|
port => { optional => 1 },
|
||||||
|
mtu => { optional => 1 },
|
||||||
proto => { optional => 1 },
|
proto => { optional => 1 },
|
||||||
timeout => { optional => 1 },
|
timeout => { optional => 1 },
|
||||||
path => { optional => 1 },
|
path => { optional => 1 },
|
||||||
|
@ -28,6 +28,7 @@ sub options {
|
|||||||
return {
|
return {
|
||||||
server => {},
|
server => {},
|
||||||
port => {},
|
port => {},
|
||||||
|
mtu => { optional => 1 },
|
||||||
disable => { optional => 1 },
|
disable => { optional => 1 },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,14 @@ my $defaultData = {
|
|||||||
type => 'integer',
|
type => 'integer',
|
||||||
description => "server network port",
|
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.
|
# UDP cannot do more than 64k at once. Overwrite for different protocol limits.
|
||||||
sub _send_batch_size {
|
sub _send_batch_size {
|
||||||
my ($class, $cfg) = @_;
|
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
|
# call with the smalles $data chunks possible
|
||||||
|
Loading…
Reference in New Issue
Block a user