Commit Graph

23 Commits

Author SHA1 Message Date
Fabian Grünbichler
0fc553eb1b 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>
2020-10-29 08:51:51 +01:00
Thomas Lamprecht
1d5c5ba19a acme: account: hide TOS checkbox during load and reuse field references
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-14 16:28:39 +02:00
Thomas Lamprecht
5c77a34f08 metric server: improve flush on big data updates
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-05-08 17:15:44 +02:00
Thomas Lamprecht
db2ce4886c status/graphite: fix memory leak, avoid cyclic closure reference
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>
2019-11-19 09:11:47 +01:00
Thomas Lamprecht
1e4ae7d44c fixup: graphite: use correct variable in closure
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-19 09:10:54 +01:00
Thomas Lamprecht
87be2c19e3 ext. metric: move to a transaction model
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-18 19:04:29 +01:00
Thomas Lamprecht
68f58b5d59 status plugins: add _connect to plugin method interface
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>
2019-11-14 19:27:28 +01:00
Thomas Lamprecht
108e0c8b9f status/graphite: refactor write_graphite to send all at once
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>
2019-11-07 18:59:06 +01:00
Thomas Lamprecht
8dcf2cac46 status/graphite: just use setsockopt to set timeouts
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>
2019-11-07 16:27:50 +01:00
Thomas Lamprecht
228f017ee4 status/graphite: record missing module-use
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-07 16:26:54 +01:00
Thomas Lamprecht
c44a0c01c8 status/graphite: reduce default timeout to 1 second
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>
2019-11-06 21:06:00 +01:00
Thomas Lamprecht
dd4268e50e status/graphite: refactor default assignments, no ternary
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-06 21:02:59 +01:00
Martin Verges
2c927f113b add graphite tcp support
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>
2019-11-06 20:48:35 +01:00
Thomas Lamprecht
fa6f371649 cleanup Status plugins use statements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-11 09:22:04 +02:00
Dominik Csapak
5c90e08ab0 Graphite.pm: fix whitespace
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-03-05 14:21:50 +01:00
Dominik Csapak
5a5aed73e2 fix #1683: do not send non-numeric values to graphite
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>
2018-03-05 14:21:50 +01:00
Thomas Lamprecht
09f19204be InfluxDB plugins: send nodename when updating CT/VM status
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>
2017-02-28 11:28:10 +01:00
Thomas Lamprecht
f014da61c5 Status: report errors on socket creation problems
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>
2016-05-23 09:17:42 +02:00
Thomas Lamprecht
4caf47e9e2 Status: allow IPs and move properties to base class
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>
2016-05-23 09:16:33 +02:00
Alexey Kuzmin
e9f581d4e1 Status/Graphite: fix carbon protocol
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>
2016-05-04 11:09:40 +02:00
Alexandre Derumier
58541b9463 add influxdb stats plugin V2
/etc/pve/status.cfg
-------------------
influxdb:
      server influxdb3.odiso.net
      port 8089

This require influxdb >= 0.9 with udp enabled

influxdb.conf
-------------

[[udp]]
  enabled = true
  bind-address = "0.0.0.0:8089"
  database = "proxmox"
  batch-size = 1000
  batch-timeout = "1s"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-11 07:59:34 +02:00
Alexandre Derumier
567bb543a7 add graphite plugin V2
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-06-23 17:13:14 +02:00
Dietmar Maurer
eb32152f91 implement status plugin framework 2015-06-22 09:45:57 +02:00