Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit e726ea5

Browse files
authored
Merge pull request #449 from raintank/configs
update configs and docs
2 parents 8b6e6d7 + f0794cf commit e726ea5

18 files changed

+378
-216
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ So we can do consolidation (combined runtime+archived) accurately and correctly,
5656
* [Quick start using docker](https://github.com/raintank/metrictank/blob/master/docs/quick-start-docker.md)
5757
* [Installation guides](https://github.com/raintank/metrictank/blob/master/docs/installation.md)
5858
* [Configuration](https://github.com/raintank/metrictank/blob/master/docs/config.md)
59-
* [Data knobs](https://github.com/raintank/metrictank/blob/master/docs/data-knobs.md)
59+
* [Memory server](https://github.com/raintank/metrictank/blob/master/docs/memory-server.md)
60+
* [Compression tips](https://github.com/raintank/metrictank/blob/master/docs/compression-tips.md)
6061
* [Cassandra](https://github.com/raintank/metrictank/blob/master/docs/cassandra.md)
6162
* [Kafka](https://github.com/raintank/metrictank/blob/master/docs/kafka.md)
6263
* [Inputs](https://github.com/raintank/metrictank/blob/master/docs/inputs.md)

docker/docker-cluster/docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ services:
4040
MT_CLUSTER_MODE: multi
4141
MT_CLUSTER_PEERS: metrictank0,metrictank2,metrictank3
4242
MT_CLUSTER_BIND_ADDR: "metrictank1:7946"
43+
MT_CLUSTER_PRIMARY_NODE: "false"
4344
links:
4445
- cassandra
4546
- metrictank0
@@ -85,6 +86,7 @@ services:
8586
MT_CLUSTER_MODE: multi
8687
MT_CLUSTER_PEERS: metrictank0,metrictank1,metrictank2
8788
MT_CLUSTER_BIND_ADDR: "metrictank3:7946"
89+
MT_CLUSTER_PRIMARY_NODE: "false"
8890
links:
8991
- cassandra
9092
- metrictank0

docker/docker-cluster/metrictank.ini

+43-18
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ accounting-period = 5min
88

99
## data ##
1010

11-
# see https://github.com/raintank/metrictank/blob/master/docs/data-knobs.md for more details
11+
# see https://github.com/raintank/metrictank/blob/master/docs/memory-server.md for more details
12+
1213
# duration of raw chunks. e.g. 10min, 30min, 1h, 90min...
14+
# must be valid value as described here https://github.com/raintank/metrictank/blob/master/docs/memory-server.md#valid-chunk-spans
1315
chunkspan = 10min
14-
# number of raw chunks to keep in memory. should be at least 1 more than what's needed to satisfy aggregation rules
16+
# number of raw chunks to keep in in-memory ring buffer
17+
# See https://github.com/raintank/metrictank/blob/master/docs/memory-server.md for details and trade-offs, especially when compared to chunk-cache
18+
# (settings further down) which may be a more effective method to cache data and alleviate workload for cassandra.
1519
numchunks = 7
1620
# minimum wait before raw metrics are removed from storage
1721
ttl = 35d
@@ -29,11 +33,15 @@ gc-interval = 1h
2933
warm-up-period = 1h
3034

3135
# settings for rollups (aggregation for archives)
32-
# comma-separated of archive specifications.
36+
# comma-separated list of archive specifications.
3337
# archive specification is of the form: aggSpan:chunkSpan:numChunks:TTL[:ready as bool. default true]
34-
# with these aggregation rules: 5min:1h:2:3mon,1h:6h:2:1y:false
35-
# 5 min of data, store in a chunk that lasts 1hour, keep 2 chunks in memory, keep for 3months in cassandra
36-
# 1hr worth of data, in chunks of 6 hours, 2 chunks in mem, keep for 1 year, but this series is not ready yet for querying.
38+
# with these aggregation rules: 5min:1h:2:3mon,1h:6h:2:1y:false you get:
39+
# - 5 min of data, store in a chunk that lasts 1hour, keep 2 chunks in in-memory ring buffer, keep for 3months in cassandra
40+
# - 1hr worth of data, in chunks of 6 hours, 2 chunks in in-memory ring buffer, keep for 1 year, but this series is not ready yet for querying.
41+
# When running a cluster of metrictank instances, all instances should have the same agg-settings.
42+
# Note:
43+
# * chunk spans must be valid values as described here https://github.com/raintank/metrictank/blob/master/docs/memory-server.md#valid-chunk-spans
44+
# * numchunks -like the global setting- has nuanced use compared to chunk cache. see https://github.com/raintank/metrictank/blob/master/docs/memory-server.md
3745
agg-settings =
3846

3947
## metric data storage in cassandra ##
@@ -81,20 +89,13 @@ cassandra-username = cassandra
8189
# password for authentication
8290
cassandra-password = cassandra
8391

84-
## Profiling, instrumentation and logging ##
92+
## Profiling and logging ##
8593

8694
# see https://golang.org/pkg/runtime/#SetBlockProfileRate
8795
block-profile-rate = 0
8896
# 0 to disable. 1 for max precision (expensive!) see https://golang.org/pkg/runtime/#pkg-variables")
8997
mem-profile-rate = 524288 # 512*1024
9098

91-
# enable sending statsd messages for instrumentation
92-
statsd-enabled = true
93-
# statsd address
94-
statsd-addr = statsdaemon:8125
95-
# standard or datadog
96-
statsd-type = standard
97-
9899
# inspect status frequency. set to 0 to disable
99100
proftrigger-freq = 1s
100101
# path to store triggered profiles
@@ -108,6 +109,28 @@ proftrigger-heap-thresh = 25000000000
108109
# only log log-level and higher. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL
109110
log-level = 2
110111

112+
# instrumentation stats
113+
[stats]
114+
# enable sending graphite messages for instrumentation
115+
enabled = true
116+
# stats prefix (will add trailing dot automatically if needed)
117+
# The default matches what the Grafana dashboard expects
118+
# $instance will be replaced with the `instance` setting.
119+
# note, the 3rd word describes the environment you deployed in.
120+
prefix = metrictank.stats.docker-cluster.$instance
121+
# graphite address
122+
addr = localhost:2003
123+
# interval at which to send statistics
124+
interval = 1
125+
# how many messages (holding all measurements from one interval. rule of thumb: a message is ~25kB) to buffer up in case graphite endpoint is unavailable.
126+
# With the default of 20k you will use max about 500MB and bridge 5 hours of downtime when needed
127+
buffer-size = 20000
128+
129+
## chunk cache ##
130+
[chunk-cache]
131+
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
132+
max-size = 4294967296
133+
111134
## http api ##
112135
[http]
113136
# tcp address for metrictank to bind to for its HTTP interface
@@ -132,6 +155,8 @@ log-min-dur = 5min
132155
enabled = true
133156
# tcp address
134157
addr = :2003
158+
# represents the "partition" of your data if you decide to partition your data.
159+
partition = 0
135160
# needed to know your raw resolution for your metrics. see http://graphite.readthedocs.io/en/latest/config-carbon.html#storage-schemas-conf
136161
# NOTE: does NOT use aggregation and retention settings from this file. We use agg-settings and ttl for that.
137162
schemas-file = /etc/raintank/storage-schemas.conf
@@ -219,10 +244,6 @@ max-in-flight = 200
219244

220245
## metric metadata index ##
221246

222-
### in-memory
223-
[memory-idx]
224-
enabled = false
225-
226247
### in memory, cassandra-backed
227248
[cassandra-idx]
228249
enabled = true
@@ -260,3 +281,7 @@ auth = false
260281
username = cassandra
261282
# password for authentication
262283
password = cassandra
284+
285+
### in-memory only
286+
[memory-idx]
287+
enabled = false

docker/docker-dev-custom-cfg-kafka/metrictank.ini

+23-12
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ accounting-period = 5min
88

99
## data ##
1010

11-
# see https://github.com/raintank/metrictank/blob/master/docs/data-knobs.md for more details
11+
# see https://github.com/raintank/metrictank/blob/master/docs/memory-server.md for more details
12+
1213
# duration of raw chunks. e.g. 10min, 30min, 1h, 90min...
14+
# must be valid value as described here https://github.com/raintank/metrictank/blob/master/docs/memory-server.md#valid-chunk-spans
1315
chunkspan = 2min
14-
# number of raw chunks to keep in memory. should be at least 1 more than what's needed to satisfy aggregation rules
15-
numchunks = 1
16+
# number of raw chunks to keep in in-memory ring buffer
17+
# See https://github.com/raintank/metrictank/blob/master/docs/memory-server.md for details and trade-offs, especially when compared to chunk-cache
18+
# (settings further down) which may be a more effective method to cache data and alleviate workload for cassandra.
19+
numchunks = 2
1620
# minimum wait before raw metrics are removed from storage
1721
ttl = 35d
1822

@@ -31,11 +35,13 @@ warm-up-period = 1h
3135
# settings for rollups (aggregation for archives)
3236
# comma-separated list of archive specifications.
3337
# archive specification is of the form: aggSpan:chunkSpan:numChunks:TTL[:ready as bool. default true]
34-
# with these aggregation rules: 5min:1h:2:3mon,1h:6h:2:1y:false
35-
# 5 min of data, store in a chunk that lasts 1hour, keep 2 chunks in memory, keep for 3months in cassandra
36-
# 1hr worth of data, in chunks of 6 hours, 2 chunks in mem, keep for 1 year, but this series is not ready yet for querying.
38+
# with these aggregation rules: 5min:1h:2:3mon,1h:6h:2:1y:false you get:
39+
# - 5 min of data, store in a chunk that lasts 1hour, keep 2 chunks in in-memory ring buffer, keep for 3months in cassandra
40+
# - 1hr worth of data, in chunks of 6 hours, 2 chunks in in-memory ring buffer, keep for 1 year, but this series is not ready yet for querying.
3741
# When running a cluster of metrictank instances, all instances should have the same agg-settings.
38-
# chunk spans must be valid values as described here https://github.com/raintank/metrictank/blob/master/docs/data-knobs.md
42+
# Note:
43+
# * chunk spans must be valid values as described here https://github.com/raintank/metrictank/blob/master/docs/memory-server.md#valid-chunk-spans
44+
# * numchunks -like the global setting- has nuanced use compared to chunk cache. see https://github.com/raintank/metrictank/blob/master/docs/memory-server.md
3945
agg-settings =
4046

4147
## metric data storage in cassandra ##
@@ -111,7 +117,7 @@ enabled = true
111117
# The default matches what the Grafana dashboard expects
112118
# $instance will be replaced with the `instance` setting.
113119
# note, the 3rd word describes the environment you deployed in.
114-
prefix = metrictank.stats.default.$instance
120+
prefix = metrictank.stats.docker-dev-custom-cfg-kafka.$instance
115121
# graphite address
116122
addr = localhost:2003
117123
# interval at which to send statistics
@@ -120,6 +126,11 @@ interval = 1
120126
# With the default of 20k you will use max about 500MB and bridge 5 hours of downtime when needed
121127
buffer-size = 20000
122128

129+
## chunk cache ##
130+
[chunk-cache]
131+
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
132+
max-size = 4294967296
133+
123134
## http api ##
124135
[http]
125136
# tcp address for metrictank to bind to for its HTTP interface
@@ -233,10 +244,6 @@ max-in-flight = 200
233244

234245
## metric metadata index ##
235246

236-
### in-memory
237-
[memory-idx]
238-
enabled = false
239-
240247
### in memory, cassandra-backed
241248
[cassandra-idx]
242249
enabled = true
@@ -274,3 +281,7 @@ auth = false
274281
username = cassandra
275282
# password for authentication
276283
password = cassandra
284+
285+
### in-memory only
286+
[memory-idx]
287+
enabled = false

docs/compression-tips.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Compression tips
2+
3+
* values that never - or infrequently - change compress extremely well, so are very cheap to track and store.
4+
* pay attention to your timestamps, make sure they are evenly spaced. That compresses better.
5+
* storing values as integers (or more precisely: floats without decimal numbers) compresses very well.
6+
So you best store the numbers with the same unit as what your precision is.
7+
E.g. let's say you measure latencies such as 0.035 seconds (3 decimals precision, e.g. ms precision), it's better to
8+
track that as the number 35 (milliseconds) instead of 0.035 (seconds).
9+
10+
For more details, see the [go-tsz eval program](https://github.com/dgryski/go-tsz/tree/master/eval) or the
11+
[results table](https://raw.githubusercontent.com/dgryski/go-tsz/master/eval/eval-results.png)

docs/config.md

+30-17
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ accounting-period = 5min
3434
## data ##
3535

3636
```
37-
# see https://github.com/raintank/metrictank/blob/master/docs/data-knobs.md for more details
37+
# see https://github.com/raintank/metrictank/blob/master/docs/memory-server.md for more details
3838
# duration of raw chunks. e.g. 10min, 30min, 1h, 90min...
39-
chunkspan = 2h
40-
# number of raw chunks to keep in memory. should be at least 1 more than what's needed to satisfy aggregation rules
41-
numchunks = 5
39+
# must be valid value as described here https://github.com/raintank/metrictank/blob/master/docs/memory-server.md#valid-chunk-spans
40+
chunkspan = 10min
41+
# number of raw chunks to keep in in-memory ring buffer
42+
# See https://github.com/raintank/metrictank/blob/master/docs/memory-server.md for details and trade-offs, especially when compared to chunk-cache
43+
# (settings further down) which may be a more effective method to cache data and alleviate workload for cassandra.
44+
numchunks = 7
4245
# minimum wait before raw metrics are removed from storage
4346
ttl = 35d
4447
# max age for a chunk before to be considered stale and to be persisted to Cassandra
@@ -54,11 +57,13 @@ warm-up-period = 1h
5457
# settings for rollups (aggregation for archives)
5558
# comma-separated list of archive specifications.
5659
# archive specification is of the form: aggSpan:chunkSpan:numChunks:TTL[:ready as bool. default true]
57-
# with these aggregation rules: 5min:1h:2:3mon,1h:6h:2:1y:false
58-
# 5 min of data, store in a chunk that lasts 1hour, keep 2 chunks in memory, keep for 3months in cassandra
59-
# 1hr worth of data, in chunks of 6 hours, 2 chunks in mem, keep for 1 year, but this series is not ready yet for querying.
60+
# with these aggregation rules: 5min:1h:2:3mon,1h:6h:2:1y:false you get:
61+
# - 5 min of data, store in a chunk that lasts 1hour, keep 2 chunks in in-memory ring buffer, keep for 3months in cassandra
62+
# - 1hr worth of data, in chunks of 6 hours, 2 chunks in in-memory ring buffer, keep for 1 year, but this series is not ready yet for querying.
6063
# When running a cluster of metrictank instances, all instances should have the same agg-settings.
61-
# chunk spans must be valid values as described here https://github.com/raintank/metrictank/blob/master/docs/data-knobs.md
64+
# Note:
65+
# * chunk spans must be valid values as described here https://github.com/raintank/metrictank/blob/master/docs/memory-server.md#valid-chunk-spans
66+
# * numchunks -like the global setting- has nuanced use compared to chunk cache. see https://github.com/raintank/metrictank/blob/master/docs/memory-server.md
6267
agg-settings =
6368
```
6469

@@ -144,6 +149,14 @@ interval = 1
144149
buffer-size = 20000
145150
```
146151

152+
## chunk cache ##
153+
154+
```
155+
[chunk-cache]
156+
# maximum size of chunk cache in bytes. (1024 ^ 3) * 4 = 4294967296 = 4G
157+
max-size = 4294967296
158+
```
159+
147160
## http api ##
148161

149162
```
@@ -239,7 +252,7 @@ brokers = kafka:9092
239252
topic = metricpersist
240253
# kafka partitions to consume. use '*' or a comma separated list of id's. Should match kafka-mdm-in's partitions.
241254
partitions = *
242-
# method used for partitioning metrics. This should match the settings of tsdb-gw. One of byOrg|bySeries
255+
# method used for partitioning metrics. This should match the settings of tsdb-gw. (byOrg|bySeries)
243256
partition-scheme = bySeries
244257
# offset to start consuming from. Can be one of newest, oldest,last or a time duration
245258
offset = last
@@ -272,18 +285,11 @@ max-in-flight = 200
272285
```
273286

274287
## metric metadata index ##
275-
### in-memory
276-
277-
```
278-
[memory-idx]
279-
enabled = true
280-
```
281-
282288
### in memory, cassandra-backed
283289

284290
```
285291
[cassandra-idx]
286-
enabled = false
292+
enabled = true
287293
# Cassandra keyspace to store metricDefinitions in.
288294
keyspace = metrictank
289295
# comma separated list of cassandra addresses in host:port form
@@ -319,3 +325,10 @@ username = cassandra
319325
# password for authentication
320326
password = cassandra
321327
```
328+
329+
### in-memory only
330+
331+
```
332+
[memory-idx]
333+
enabled = false
334+
```

docs/consolidation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ must cleanly multiply between one another (why again?)
108108
try to minimize storage overhead of each band
109109

110110
SPAN CHOICE
111-
As described in the page [Data knobs](https://github.com/raintank/metrictank/blob/master/docs/data-knobs.md#valid-chunk-spans), only a finite set of values are valid chunk spans. This applies to rolled up chunks as well.
111+
As described in the page [Memory server](https://github.com/raintank/metrictank/blob/master/docs/memory-server.md#valid-chunk-spans), only a finite set of values are valid chunk spans. This applies to rolled up chunks as well.
112112

113113
RETENTION:
114114
should at the minimum be maxT otherwise what's the point

0 commit comments

Comments
 (0)