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>
The data passed to this closure was never free'd, depending on the
count of VM/CTs one could get >1 MB of RSS (!) memory leaked per
statd status cycle update run...
We could also use Scalar::Util's weaken, to weak a copy of this
variable, but as a simple undef works lets do that with a comment..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
in preparation of doing real transactions, with one batch connect +
send + disconnect, and not hundreds of those per update cycle..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Instead of doing multiple sends, for each status metric line one,
assemble it all in a string and send it out in a single go.
Per VM/CT/Node we had >10 lines to send, so this is quite the
reduction. But, also note that thanks to Nagler's delay algorithm
this may not had a big effect for TCP, as it buffered those small
writes anyhow.
For UDP it can reduce the packet count on the line dramatically,
though.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
after rethinking this it felt weird, sockets already can to this
themself, so I checked out the IO::Socket::Timeout module, and yeah,
it's just a OOP wrapper for this, hiding the "scary" struct pack.
So instead of adding that as dependency lets do it ourself.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This is for TCP only, and TCP needs roughly 1.5 time of the Round
Trip Time for connection setup, So, with 1 second timeout we're still
good for connections with 660 ms latency in-between.
The assumption is that most of the time the status server is
relatively near (same datacenter, or region), and connections to it
are datacenter grade, and not like a spotty GPRS modem.
So, reduce this timeout to ensure that we do not block to long.
If anybody needs higher timeouts they can just change the default
anyway.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This change allows sending statistics to graphite over TCP.
So far only UDP is possible, which is not available in some environments, like behind a loadbalancer.
Configuration example:
~ $ cat /etc/pve/status.cfg
graphite:
server 10.20.30.40
port 2003
path proxmox
proto tcp
timeout 3
Signed-off-by: Martin Verges <martin.verges@croit.io>
the graphite daemons which accept the data (carbon), only
accepts numeric values, and logs all invalid lines
since that were about 5 values per vm/ct this generated lot of noise
in the carbon log
so we check with a regex if a value is numeric, and
additionally we have a blacklist of keys which seem to be numeric but
are either boolean (e.g. template) or a state (e.g. pid)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This allows filtering by node in InfluxDB queries, so the statistics
of all virtual guests on a specific nodes can be queried.
While for InfluxDB this is only a tag which does changes where the
data is stored, Graphite - our other status plugin - has no such
mechanics available. If we would add it to the object hierarchy,
e.g.: "qemu.$vmid.$nodename" a migration of a VM would result in two
different datasets.
So avoid breaking setups and omit it for Graphite for now.
Suggested-by: Daniel1108 <danielgallegosanchez@gmail.com>
CC: Daniel1108 <danielgallegosanchez@gmail.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
If the socket couldn't be created (e.g. FQDN not resolvable) we
continued witouth any hint, when actualy writing the data we then
die'd. The user then does not really know why, so report errors
if the socket creation failed.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
We only allowed servers with the dns-name format, as such status
server may often be in internal networks and with no hostname
(testing, small network so no dns, ...) do not limit the
configuration possibilities with no reason.
Also move the base property part to the base Status class, all
current plugins use server and port so no need for double
declaration of format/descriptions.
If a future plugin doesn't need them it can omit them by not
returning the respective properties in the options method
inherited by SectionConfig.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Carbon (particularly carbon-c-relay) expects one metric per line.
Current PVE implementation breaks this rule.
Committed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>