Explainer
What one Telegraf point really costs on InfluxDB disk
Short answer
InfluxDB writes points into compressed columns, so nothing in a query reports the bytes one stored point occupies. Trim each point to value, timestamp and topic tag, measure one sensor's compacted size over a test week, and scale it by the point count that your interval, sensor count and retention days produce.
On this page
A two-second temperature feed that reaches Grafana needs only the value, the timestamp and the MQTT topic, yet the query returns nine columns, and most of them look like stored data. Part of what you see is query decoration, part is real storage, and the number you actually want — the bytes one point occupies on disk — is not readable anywhere, because InfluxDB keeps fields and tags in compressed columns rather than rows. So the answer is a measurement, not a lookup. Strip each point to what the chart uses with Telegraf's documented filters and the agent hostname option, log one sensor for a week at the production settings, read the compacted size on disk, and multiply by the point count: about 31.5 billion points for 1000 sensors over two years.
What one point really contains #
The Flux query behind the Grafana panel returns table, _start, _stop, _time, _value, _field, _measurement, host and topic — nine columns for a point that keeps six. The distinction decides what trimming can and cannot save.
| Column | Stored on disk | What it is |
|---|---|---|
_time |
Yes | The metric timestamp, required |
_value |
Yes | The field value, required |
_field |
Yes | The field key, part of the series identity |
_measurement |
Yes | The measurement name, part of the series identity |
host |
Yes | A tag Telegraf adds by default |
topic |
Yes | A tag from the consumer input, part of the series identity |
table, _start, _stop |
No | Query output: grouping and range bounds |
table, _start and _stop are generated when the query runs: they group the result and carry the range bounds you asked for. Removing them from any configuration saves nothing, because they never reach the storage engine. Tags are the real lever: they live in the series key and the index, not repeated as full strings on every point the way a row store would repeat them, and each unique combination of measurement, tag values and field key is one series. That identity is also why you must know which keys are tags and which are fields before writing a filter — the options that remove them are separate.
Why there is no byte figure to read #
InfluxDB stores each column compressed, so the length of a line-protocol line is not the space the point occupies: timestamps on a regular cadence collapse to almost nothing, a numeric field compresses well below its eight-byte raw width, and tags are stored once per series rather than once per point. Freshly written data is not yet compacted either, and takes noticeably more space than the same data after compaction. Multiplying a raw point size by a point count therefore overestimates the steady state and underestimates the first days of a test. The committed method is to measure after compaction: the stored size of a settled bucket is the only byte figure that means anything, and the example below turns it into a volume size for your fleet.
Trim the point before Telegraf writes it #
The consumer setup behind this feed is the one described in how to store MQTT messages in InfluxDB with Telegraf. How that input splits a topic into measurement, tags and fields decides which filter each key needs; how to turn an MQTT topic into InfluxDB fields with Telegraf walks through that mapping.
- Print the metrics exactly as the input produces them — Telegraf's test mode (
--test) or a file output on the same configuration — and record which keys arrive as tags and which as fields. - Keep the topic tag: the Grafana panel filters and groups on it.
- Drop the host tag when one Telegraf instance writes the bucket: set
omit_hostname = truein the[agent]section and restart the service. Keephostwhen several collectors write identical topic names into one bucket, because it is what keeps their series apart. - Drop unused field keys with
fieldpassorfielddrop, unused tag keys withtagpassortagdrop, and whole measurements withnamepassornamedrop. Telegraf's configuration documentation states that modifier filters "remove tags and fields from a metric", and that a metric left without any field is not passed on at all. - Re-run the test mode and confirm only the value, the timestamp and the topic tag remain; restart the service and query the bucket for recent points to confirm they match.
- Expect no change to existing points: filters apply to new writes only, and old series stay until retention deletes them.
Measuring bytes per sensor after compaction #
One sensor stands in for the fleet if it uses the production shape — same measurement name, same tags, same field type.
- Apply the final filter configuration first, because tags, fields and measurement names decide both compression and series overhead.
- Log it at the production interval for about a week; compaction needs days to settle, and a still-shrinking folder reads low.
- Read the stored size with the vendor's command-line inspect utility, which reports on-disk data size and can break it down by measurement — cleaner than reading the data folder while writes are active.
- Re-read a day later; two nearly equal readings mean the figure has settled.
- Divide the settled bytes by the points written in the window. That bytes-per-point figure for your exact series shape is the input the example below scales.
Example: 1000 sensors every 2 seconds for two years #
Arithmetic first, from the publish rate alone; the byte figure is illustrative until your compacted test replaces it.
- One point every 2 s: 86,400 s ÷ 2 s = 43,200 points per sensor per day.
- 1,000 sensors: 43,200 × 1,000 = 43,200,000 points per day.
- Two years at 365 days each: 43,200,000 × 730 = 31,536,000,000 points, about 31.5 billion.
- Illustrative measured input: the compacted week leaves 605,000 bytes for one sensor's 302,400 points, so 605,000 ÷ 302,400 ≈ 2.0 bytes per point.
- Two-year steady state: 31,536,000,000 × 2 bytes = 63,072,000,000 bytes ≈ 63 GB, about 59 GiB.
- The same fleet on a 90-day retention: 43,200,000 × 90 = 3,888,000,000 points, and 3,888,000,000 × 2 bytes = 7,776,000,000 bytes ≈ 7.8 GB.
Decision, two-year retention: provision above the 63 GB compacted estimate with the headroom your fill test shows — freshly written points run larger until compaction, so confirm the folder stops climbing once the window fills instead of sizing from the first week's raw growth.
Decision, 90-day retention: about 7.8 GB steady once the window has filled once, checked the same way.
One caveat belongs to both cases: 1,000 topics form at least 1,000 series, and a single-sensor test carries one series' overhead but not the index for a thousand, so the first weeks at full fleet are the final confirmation.
What moves bytes per point #
- Fields per point: every extra field is another compressed column written on every point.
- Value behavior and cadence: a slowly changing numeric on a regular cadence compresses far better than strings or jittery intervals, where timestamp deltas stop repeating and neighboring values stop resembling each other.
- Tag cardinality: tags live in the series key and the index, so every new unique tag value adds a series whose overhead is per-series, not per-point — this is why the topic stays as the single tag and host goes, when the deployment allows it.
- Measurement routing: one measurement per topic versus a shared measurement with a topic tag changes both the series count and the per-measurement breakdown the inspect utility reports; how Telegraf MQTT routing creates one measurement per topic covers the one-measurement-per-topic case.
- Time since write: not-yet-compacted data reads larger, so compare sizes only between settled periods.
- Retention fill: once the retention window has filled, occupied space holds steady unless the data structure changes or new series appear — that plateau is the proof the estimate holds.
The decisions #
Write less: drop host when one collector writes the bucket, keep topic as a tag, drop fields you never chart, and verify with a test-mode run plus a bucket query on new points.
Size the disk: measure compacted bytes per point for a week at production settings, multiply by the point count that the interval, sensor count and retention days produce, and provision above that result with the headroom the fill test shows. The same measure-then-scale habit applies beyond the database folder, as in the guide to sizing a self-hosted Node-RED, InfluxDB and Grafana historian.
Questions asked
Why keep the topic as a tag instead of a field?
Tags form the series key and the index, so Grafana can filter and group per topic without scanning every value. Fields are value columns: queries can group by tags, not by fields, and filtering on a field means scanning values. Moving topic into a field would merge distinct topics into fewer series and break per-topic charts, so keep it as a tag and trim elsewhere.
What happens if two Telegraf hosts write the same topic into one bucket?
Without the host tag their points interleave in one identical series, and neither collector's data can be told apart afterward. With host kept, each collector writes its own series and both stay queryable. The rule follows the deployment: one collector writes the bucket, omit host; several collectors share it, keep host.
Does an irregular publish cadence change the estimate?
The point count still scales with the average rate, but the bytes per point rise: timestamp deltas no longer repeat, so timestamps compress less tightly than on a fixed cadence. Measure with the sensors' real timing rather than a scripted regular feed, or the test will flatter the estimate.
How does a filled retention window confirm the estimate?
Log at the production rate until the oldest data inside the retention window is deleted; from then on writes and deletes balance and the occupied size should hold level across daily readings. A continued climb after that point means new series or a changed tag structure appeared, and the bytes-per-point figure no longer applies unchanged.