For larger datasets, it's possible for shards to get into a state where many large, dense TSM files exist. While the shard is still hot for writes, full compactions will skip these files since they are already fairly optimized and full compactions are expensive. If the write volume is large enough, the shard can accumulate lots of these files. When a file is in this state, it's index can contain every series which causes startup times to increase since each file must parse the full set of series keys for every file. If the number of series is high, the index can be quite large causing large amount of disk IO at startup. To fix this, a optmize compaction is run when a full compaction planning step decides there is nothing to do. The optimize compaction combines and spreads the data and series keys across all files resulting in each file containing the full series data for that shard and a subset of the total set of keys in the shard. This allows a shard to only store a series key once in the shard reducing storage size as well allows a shard to only load each key once at startup. |
||
---|---|---|
.. | ||
DESIGN.md | ||
bit_reader.go | ||
bit_reader_test.go | ||
bool.go | ||
bool_test.go | ||
cache.go | ||
cache_race_test.go | ||
cache_test.go | ||
compact.go | ||
compact_test.go | ||
cursor.go | ||
encoding.gen.go | ||
encoding.gen.go.tmpl | ||
encoding.gen.go.tmpldata | ||
encoding.go | ||
encoding_test.go | ||
engine.go | ||
engine_test.go | ||
file_store.gen.go | ||
file_store.gen.go.tmpl | ||
file_store.gen.go.tmpldata | ||
file_store.go | ||
file_store_test.go | ||
file_unix.go | ||
file_windows.go | ||
float.go | ||
float_test.go | ||
int.go | ||
int_test.go | ||
iterator.gen.go | ||
iterator.gen.go.tmpl | ||
iterator.gen.go.tmpldata | ||
iterator.go | ||
mmap_solaris.go | ||
mmap_unix.go | ||
mmap_windows.go | ||
pools.go | ||
reader.go | ||
reader_test.go | ||
string.go | ||
string_test.go | ||
timestamp.go | ||
timestamp_test.go | ||
tombstone.go | ||
tombstone_test.go | ||
wal.go | ||
wal_test.go | ||
writer.go | ||
writer_test.go |