agrif / OctoPrint-InfluxDB

Writes temperatures and events to an Influx database.
GNU Affero General Public License v3.0
24 stars 15 forks source link

Events create high cardinality #13

Closed mwinters-stuff closed 4 years ago

mwinters-stuff commented 4 years ago

The events, make far too many tags, thus cardinality is extremly high - like over 200 thousand after a few prints. Would expect cardinality to be < 50. This affects influxdb performance, both memory and index space.

agrif commented 4 years ago

I'm not sure why I stored those as tags -- I think it was probably the easy way out.

I've made changes to how events are stored: now, the type is stored as a tag (which it always should have been??) and the rest of the payload is stored as fields. This can result in some of the payload being dropped (if it's not a type that can be stored in a field, or if it has a datatype that changes over time) but I think it's a good first approximation.

These changes are in 1.3.0 which should be available for update now. You might want to reset your octoprint database, or at least remove the events measurement, just to clear up space.