updated sizing netdata (#17057)
Costa Tsaousis committed
Feb 25, 2024 at 12:37 UTC
79e7a6282e911d22febef0dd4d07fb5c5b418bfd
2 files changed
+46
-44
docs/netdata-agent/sizing-netdata-agents/README.md
+3
-1
@@ -58,7 +58,9 @@ The following are some of the innovations the open-source Netdata agent has, tha
58
59
2. **4 bytes per sample uncompressed**
60
61
- To achieve optimal memory and disk footprint, Netdata uses a custom 32-bit floating point number we have developed. This floating point number is used to store the samples collected, together with their anomaly bit. The database of Netdata is fixed-step, so it has predefined slots for every sample, allowing Netdata to store timestamps once every several hundreds samples, minimizing both its memory requirements and the disk footprint.
61
+ To achieve optimal memory and disk footprint, Netdata uses a custom 32-bit floating point number. This floating point number is used to store the samples collected, together with their anomaly bit. The database of Netdata is fixed-step, so it has predefined slots for every sample, allowing Netdata to store timestamps once every several hundreds samples, minimizing both its memory requirements and the disk footprint.
62
+
63
+ The final disk footprint of Netdata varies due to compression efficiency. It is usually about 0.6 bytes per sample for the high-resolution tier (per-second), 6 bytes per sample for the mid-resolution tier (per-minute) and 18 bytes per sample for the low-resolution tier (per-hour).
64
65
3. **Query priorities**
66
docs/netdata-agent/sizing-netdata-agents/disk-requirements-and-retention.md
+43
-43
@@ -28,11 +28,11 @@ To configure database mode `ram` or `alloc`, in `netdata.conf`, set the followin
28
29
`dbengine` supports up to 5 tiers. By default, 3 tiers are used, like this:
30
31
-| Tier | Resolution | Uncompressed Sample Size |
32
-|:--------:|:--------------------------------------------------------------------------------------------:|:------------------------:|
33
-| `tier0` | native resolution (metrics collected per-second as stored per-second) | 4 bytes |
34
-| `tier1` | 60 iterations of `tier0`, so when metrics are collected per-second, this tier is per-minute. | 16 bytes |
35
-| `tier2` | 60 iterations of `tier1`, so when metrics are collected per second, this tier is per-hour. | 16 bytes |
31
+| Tier | Resolution | Uncompressed Sample Size | Usually On Disk |
32
+|:--------:|:--------------------------------------------------------------------------------------------:|:------------------------:|:---------------:|
33
+| `tier0` | native resolution (metrics collected per-second as stored per-second) | 4 bytes | 0.6 bytes |
34
+| `tier1` | 60 iterations of `tier0`, so when metrics are collected per-second, this tier is per-minute. | 16 bytes | 6 bytes |
35
+| `tier2` | 60 iterations of `tier1`, so when metrics are collected per second, this tier is per-hour. | 16 bytes | 18 bytes |
36
37
Data are saved to disk compressed, so the actual size on disk varies depending on compression efficiency.
38
@@ -56,40 +56,46 @@ You can find information about the current disk utilization of a Netdata Parent,
56
```json
57
{
58
// more information about the agent
59
- // near the end:
59
+ // then, near the end:
60
"db_size": [
61
{
62
"tier": 0,
63
- "disk_used": 1677528462156,
64
- "disk_max": 1677721600000,
65
- "disk_percent": 99.9884881,
66
- "from": 1706201952,
67
- "to": 1707401946,
68
- "retention": 1199994,
69
- "expected_retention": 1200132,
70
- "currently_collected_metrics": 2198777
63
+ "metrics": 43070,
64
+ "samples": 88078162001,
65
+ "disk_used": 41156409552,
66
+ "disk_max": 41943040000,
67
+ "disk_percent": 98.1245269,
68
+ "from": 1705033983,
69
+ "to": 1708856640,
70
+ "retention": 3822657,
71
+ "expected_retention": 3895720,
72
+ "currently_collected_metrics": 27424
73
},
74
{
75
"tier": 1,
74
- "disk_used": 838123468064,
75
- "disk_max": 838860800000,
76
- "disk_percent": 99.9121032,
77
- "from": 1702885800,
78
- "to": 1707401946,
79
- "retention": 4516146,
80
- "expected_retention": 4520119,
81
- "currently_collected_metrics": 2198777
76
+ "metrics": 72987,
77
+ "samples": 5155155269,
78
+ "disk_used": 20585157180,
79
+ "disk_max": 20971520000,
80
+ "disk_percent": 98.1576785,
81
+ "from": 1698287340,
82
+ "to": 1708856640,
83
+ "retention": 10569300,
84
+ "expected_retention": 10767675,
85
+ "currently_collected_metrics": 27424
86
},
87
{
88
"tier": 2,
85
- "disk_used": 334329683032,
86
- "disk_max": 419430400000,
87
- "disk_percent": 79.710408,
88
- "from": 1679670000,
89
- "to": 1707401946,
90
- "retention": 27731946,
91
- "expected_retention": 34790871,
92
- "currently_collected_metrics": 2198777
89
+ "metrics": 148234,
90
+ "samples": 314919121,
91
+ "disk_used": 5957346684,
92
+ "disk_max": 10485760000,
93
+ "disk_percent": 56.8136853,
94
+ "from": 1667808000,
95
+ "to": 1708856640,
96
+ "retention": 41048640,
97
+ "expected_retention": 72251324,
98
+ "currently_collected_metrics": 27424
99
}
100
]
101
}
@@ -98,6 +104,8 @@ You can find information about the current disk utilization of a Netdata Parent,
104
In this example:
105
106
- `tier` is the database tier.
107
+- `metrics` is the number of unique time-series in the database.
108
+- `samples` is the number of samples in the database.
109
- `disk_used` is the currently used disk space in bytes.
110
- `disk_max` is the configured max disk space in bytes.
111
- `disk_percent` is the current disk space utilization for this tier.
@@ -107,21 +115,13 @@ In this example:
115
- `expected_retention` is the expected retention in seconds when `disk_percent` will be 100 (divide by 3600 for hours, divide by 86400 for days).
116
- `currently_collected_metrics` is the number of unique time-series currently being collected for this tier.
117
110
-The estimated number of samples on each tier can be calculated as follows:
111
-
112
-```
113
-estimasted number of samples = retention / sample duration * currently_collected_metrics
114
-```
115
-
118
So, for our example above:
119
118
-| Tier | Sample Duration (seconds) | Estimated Number of Samples | Disk Space Used | Current Retention (days) | Expected Retention (days) | Bytes Per Sample |
119
-|:-------:|:-------------------------:|:---------------------------:|:---------------:|:------------------------:|:-------------------------:|:----------------:|
120
-| `tier0` | 1 | 2.64 trillion samples | 1.56 TiB | 13.8 | 13.9 | 0.64 |
121
-| `tier1` | 60 | 165.5 billion samples | 780 GiB | 52.2 | 52.3 | 5.01 |
122
-| `tier2` | 3600 | 16.9 billion samples | 311 GiB | 320.9 | 402.7 | 19.73 |
123
-
124
-Note: as you can see in this example, the disk footprint per sample of `tier2` is bigger than the uncompressed sample size (19.73 bytes vs 16 bytes). This is due to the fact that samples are organized into pages and pages into extents. When Netdata is restarted frequently, it saves all data prematurely, before filling up entire pages and extents, leading to increased overheads per sample.
120
+| Tier | # Of Metrics | # Of Samples | Disk Used | Disk Free | Current Retention | Expected Retention | Sample Size |
121
+|-----:|-------------:|--------------:|----------:|----------:|------------------:|-------------------:|------------:|
122
+| 0 | 43.1K | 88.1 billion | 38.4Gi | 1.88% | 44.2 days | 45.0 days | 0.46 B |
123
+| 1 | 73.0K | 5.2 billion | 19.2Gi | 1.84% | 122.3 days | 124.6 days | 3.99 B |
124
+| 2 | 148.3K | 315.0 million | 5.6Gi | 43.19% | 475.1 days | 836.2 days | 18.91 B |
125
126
To configure retention, in `netdata.conf`, set the following:
127