Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSDB dimensions encoding #99747

Merged

Conversation

felixbarny
Copy link
Member

Adds a run-length encoding for TSDB that takes advantage of the fact that doc_values for dimensions are sorted by _tsid, which implies that consecutive values for the same field are mostly the same in a block.

@felixbarny felixbarny added the :StorageEngine/TSDB You know, for Metrics label Sep 21, 2023
@elasticsearchmachine elasticsearchmachine added external-contributor Pull request authored by a developer outside the Elasticsearch team v8.11.0 labels Sep 21, 2023
@felixbarny
Copy link
Member Author

felixbarny commented Sep 21, 2023

Rally results. Note that was executed locally so take this with a shovel of salt. I saw a lot of run-to-run variance, even for disk usage metrics.

Highlights:

  • The overall reduction in storage size is around 11% when excluding _recovery_source.
  • For some properties, such as kubernetes.pod.name, the storage for doc_values was reduced over 90% - from 110.72 MB to 7.25 MB.
  • Other properties, such as host.name saw a much modest reduction in doc_values size of 19%.
  • As there's no optimization for single-valued fields, yet, some fields such as agent.version saw an increase from 108 bytes to 2MB
  • Confusingly, these fields also saw a regression on the inverted index size. Probably the singleton value optimization kicks in for inverted indices, too.
  • The size of the inverted index is more pronounced now that doc_values take up less space.
  • Throughput was slightly decreased on that run but probably within margins of error (-2%). Needs benchmarking on a more stable environment to really tell.
Click to expand full rally results
Metric Task Baseline Contender Diff Unit Diff %
Cumulative indexing time of primary shards 174.112 178.36 4.24855 min +2.44%
Min cumulative indexing time across primary shard 174.112 178.36 4.24855 min +2.44%
Median cumulative indexing time across primary shard 174.112 178.36 4.24855 min +2.44%
Max cumulative indexing time across primary shard 174.112 178.36 4.24855 min +2.44%
Cumulative indexing throttle time of primary shards 0 0 0 min 0.00%
Min cumulative indexing throttle time across primary shard 0 0 0 min 0.00%
Median cumulative indexing throttle time across primary shard 0 0 0 min 0.00%
Max cumulative indexing throttle time across primary shard 0 0 0 min 0.00%
Cumulative merge time of primary shards 66.2421 66.0366 -0.20552 min -0.31%
Cumulative merge count of primary shards 117 118 1 +0.85%
Min cumulative merge time across primary shard 66.2421 66.0366 -0.20552 min -0.31%
Median cumulative merge time across primary shard 66.2421 66.0366 -0.20552 min -0.31%
Max cumulative merge time across primary shard 66.2421 66.0366 -0.20552 min -0.31%
Cumulative merge throttle time of primary shards 0.122167 0.125783 0.00362 min +2.96%
Min cumulative merge throttle time across primary shard 0.122167 0.125783 0.00362 min +2.96%
Median cumulative merge throttle time across primary shard 0.122167 0.125783 0.00362 min +2.96%
Max cumulative merge throttle time across primary shard 0.122167 0.125783 0.00362 min +2.96%
Cumulative refresh time of primary shards 3.8504 3.76163 -0.08877 min -2.31%
Cumulative refresh count of primary shards 292 294 2 +0.68%
Min cumulative refresh time across primary shard 3.8504 3.76163 -0.08877 min -2.31%
Median cumulative refresh time across primary shard 3.8504 3.76163 -0.08877 min -2.31%
Max cumulative refresh time across primary shard 3.8504 3.76163 -0.08877 min -2.31%
Cumulative flush time of primary shards 0.31765 0.34275 0.0251 min +7.90%
Cumulative flush count of primary shards 7 8 1 +14.29%
Min cumulative flush time across primary shard 0.31765 0.34275 0.0251 min +7.90%
Median cumulative flush time across primary shard 0.31765 0.34275 0.0251 min +7.90%
Max cumulative flush time across primary shard 0.31765 0.34275 0.0251 min +7.90%
Total Young Gen GC time 100.341 103.807 3.466 s +3.45%
Total Young Gen GC count 25044 25268 224 +0.89%
Total Old Gen GC time 0 0 0 s 0.00%
Total Old Gen GC count 0 0 0 0.00%
Store size 19.8238 18.5893 -1.23454 GB -6.23%
Translog size 5.12227e-08 5.12227e-08 0 GB 0.00%
Heap used for segments 0 0 0 MB 0.00%
Heap used for doc values 0 0 0 MB 0.00%
Heap used for terms 0 0 0 MB 0.00%
Heap used for norms 0 0 0 MB 0.00%
Heap used for points 0 0 0 MB 0.00%
Heap used for stored fields 0 0 0 MB 0.00%
Segment count 18 30 12 +66.67%
Total Ingest Pipeline count 0 0 0 0.00%
Total Ingest Pipeline time 0 0 0 ms 0.00%
Total Ingest Pipeline failed 0 0 0 0.00%
tsdb _field_names inverted index 19.9111 20.8984 0.9873 kB +4.96%
tsdb _field_names total 19.9111 20.8984 0.9873 kB +4.96%
tsdb kubernetes.event.metadata.generate_name inverted index 19.5186 20.2373 0.71875 kB +3.68%
tsdb kubernetes.event.metadata.generate_name doc values 104.41 136.167 31.7568 kB +30.42%
tsdb kubernetes.event.metadata.generate_name total 123.929 156.404 32.4756 kB +26.21%
tsdb kubernetes.labels.beta_kubernetes_io/arch inverted index 41.334 41.6836 0.34961 kB +0.85%
tsdb kubernetes.labels.beta_kubernetes_io/arch doc values 97.498 135.541 38.043 kB +39.02%
tsdb kubernetes.labels.beta_kubernetes_io/arch total 138.832 177.225 38.3926 kB +27.65%
tsdb kubernetes.labels.beta_kubernetes_io/os inverted index 41.334 41.6836 0.34961 kB +0.85%
tsdb kubernetes.labels.beta_kubernetes_io/os doc values 97.498 135.541 38.043 kB +39.02%
tsdb kubernetes.labels.beta_kubernetes_io/os total 138.832 177.225 38.3926 kB +27.65%
tsdb kubernetes.labels.kubernetes_io/arch inverted index 41.335 41.6836 0.34863 kB +0.84%
tsdb kubernetes.labels.kubernetes_io/arch doc values 97.498 135.541 38.043 kB +39.02%
tsdb kubernetes.labels.kubernetes_io/arch total 138.833 177.225 38.3916 kB +27.65%
tsdb kubernetes.labels.kubernetes_io/os inverted index 41.335 41.6836 0.34863 kB +0.84%
tsdb kubernetes.labels.kubernetes_io/os doc values 97.498 135.541 38.043 kB +39.02%
tsdb kubernetes.labels.kubernetes_io/os total 138.833 177.225 38.3916 kB +27.65%
tsdb kubernetes.labels.app_kubernetes_io/managed-by inverted index 16.4697 18.2354 1.76562 kB +10.72%
tsdb kubernetes.labels.app_kubernetes_io/managed-by doc values 151.094 168.906 17.8125 kB +11.79%
tsdb kubernetes.labels.app_kubernetes_io/managed-by total 167.563 187.142 19.5781 kB +11.68%
tsdb kubernetes.node.network.rx.errors doc values 185.886 192.889 7.00293 kB +3.77%
tsdb kubernetes.node.network.rx.errors total 185.886 192.889 7.00293 kB +3.77%
tsdb kubernetes.node.network.tx.errors doc values 185.886 192.889 7.00293 kB +3.77%
tsdb kubernetes.node.network.tx.errors total 185.886 192.889 7.00293 kB +3.77%
tsdb kubernetes.labels.helm_sh/chart inverted index 23.2002 24.9443 1.74414 kB +7.52%
tsdb kubernetes.labels.helm_sh/chart doc values 159.839 169.664 9.8252 kB +6.15%
tsdb kubernetes.labels.helm_sh/chart total 183.039 194.608 11.5693 kB +6.32%
tsdb kubernetes.labels.beta_kubernetes_io/instance-type inverted index 56.2227 56.9072 0.68457 kB +1.22%
tsdb kubernetes.labels.beta_kubernetes_io/instance-type doc values 108.451 139.313 30.8623 kB +28.46%
tsdb kubernetes.labels.beta_kubernetes_io/instance-type total 164.674 196.221 31.5469 kB +19.16%
tsdb kubernetes.labels.app_kubernetes_io/component inverted index 24.876 27.3057 2.42969 kB +9.77%
tsdb kubernetes.labels.app_kubernetes_io/component doc values 175.827 168.742 -7.08496 kB -4.03%
tsdb kubernetes.labels.app_kubernetes_io/component total 200.703 196.048 -4.65527 kB -2.32%
tsdb kubernetes.labels.io_kompose_service inverted index 24.6631 26.5273 1.86426 kB +7.56%
tsdb kubernetes.labels.io_kompose_service doc values 176.996 164.072 -12.9238 kB -7.30%
tsdb kubernetes.labels.io_kompose_service total 201.659 190.6 -11.0596 kB -5.48%
tsdb kubernetes.node.pod.allocatable.total doc values 192.239 202.677 10.4375 kB +5.43%
tsdb kubernetes.node.pod.allocatable.total total 192.239 202.677 10.4375 kB +5.43%
tsdb kubernetes.node.pod.capacity.total doc values 192.239 202.677 10.4375 kB +5.43%
tsdb kubernetes.node.pod.capacity.total total 192.239 202.677 10.4375 kB +5.43%
tsdb kubernetes.node.cpu.capacity.cores doc values 194.354 204.607 10.2529 kB +5.28%
tsdb kubernetes.node.cpu.capacity.cores total 194.354 204.607 10.2529 kB +5.28%
tsdb kubernetes.node.fs.inodes.count doc values 199.546 206.764 7.21777 kB +3.62%
tsdb kubernetes.node.fs.inodes.count total 199.546 206.764 7.21777 kB +3.62%
tsdb kubernetes.node.memory.majorpagefaults doc values 200.062 207.938 7.875 kB +3.94%
tsdb kubernetes.node.memory.majorpagefaults total 200.062 207.938 7.875 kB +3.94%
tsdb kubernetes.node.fs.capacity.bytes doc values 206.235 213.467 7.23145 kB +3.51%
tsdb kubernetes.node.fs.capacity.bytes total 206.235 213.467 7.23145 kB +3.51%
tsdb kubernetes.node.runtime.imagefs.capacity.bytes doc values 206.235 213.467 7.23145 kB +3.51%
tsdb kubernetes.node.runtime.imagefs.capacity.bytes total 206.235 213.467 7.23145 kB +3.51%
tsdb kubernetes.node.status.unschedulable inverted index 20.4785 22.7256 2.24707 kB +10.97%
tsdb kubernetes.node.status.unschedulable doc values 182.117 195.657 13.54 kB +7.43%
tsdb kubernetes.node.status.unschedulable total 202.596 218.383 15.7871 kB +7.79%
tsdb kubernetes.node.cpu.allocatable.cores doc values 209.511 220.308 10.7969 kB +5.15%
tsdb kubernetes.node.cpu.allocatable.cores total 209.511 220.308 10.7969 kB +5.15%
tsdb kubernetes.node.status.ready inverted index 21.1143 23.4414 2.32715 kB +11.02%
tsdb kubernetes.node.status.ready doc values 183.617 202.396 18.7793 kB +10.23%
tsdb kubernetes.node.status.ready total 204.731 225.838 21.1064 kB +10.31%
tsdb kubernetes.node.memory.capacity.bytes doc values 223.819 239.411 15.5918 kB +6.97%
tsdb kubernetes.node.memory.capacity.bytes total 223.819 239.411 15.5918 kB +6.97%
tsdb kubernetes.node.memory.allocatable.bytes doc values 224.688 240.016 15.3281 kB +6.82%
tsdb kubernetes.node.memory.allocatable.bytes total 224.688 240.016 15.3281 kB +6.82%
tsdb kubernetes.labels.name inverted index 28.9004 31.2295 2.3291 kB +8.06%
tsdb kubernetes.labels.name doc values 223.068 213.276 -9.79199 kB -4.39%
tsdb kubernetes.labels.name total 251.969 244.506 -7.46289 kB -2.96%
tsdb kubernetes.event.type inverted index 61.5176 62.8252 1.30762 kB +2.13%
tsdb kubernetes.event.type doc values 193.447 147.251 -46.1963 kB -23.88%
tsdb kubernetes.event.type total 254.965 210.076 -44.8887 kB -17.61%
tsdb kubernetes.event.count doc values 263.58 293.115 29.5352 kB +11.21%
tsdb kubernetes.event.count total 263.58 293.115 29.5352 kB +11.21%
tsdb kubernetes.node.memory.pagefaults doc values 460.427 477.307 16.8799 kB +3.67%
tsdb kubernetes.node.memory.pagefaults total 460.427 477.307 16.8799 kB +3.67%
tsdb kubernetes.node.runtime.imagefs.used.bytes doc values 449.949 479.819 29.8701 kB +6.64%
tsdb kubernetes.node.runtime.imagefs.used.bytes total 449.949 479.819 29.8701 kB +6.64%
tsdb kubernetes.node.fs.inodes.used doc values 534.129 550.801 16.6719 kB +3.12%
tsdb kubernetes.node.fs.inodes.used total 534.129 550.801 16.6719 kB +3.12%
tsdb kubernetes.node.fs.inodes.free doc values 535.569 552.052 16.4824 kB +3.08%
tsdb kubernetes.node.fs.inodes.free total 535.569 552.052 16.4824 kB +3.08%
tsdb kubernetes.event.involved_object.api_version inverted index 195.102 197.84 2.73828 kB +1.40%
tsdb kubernetes.event.involved_object.api_version doc values 460.197 185.03 -275.167 kB -59.79%
tsdb kubernetes.event.involved_object.api_version total 655.299 382.87 -272.429 kB -41.57%
tsdb kubernetes.event.involved_object.kind inverted index 217.568 220.079 2.51074 kB +1.15%
tsdb kubernetes.event.involved_object.kind doc values 460.701 185.459 -275.242 kB -59.74%
tsdb kubernetes.event.involved_object.kind total 678.27 405.538 -272.731 kB -40.21%
tsdb kubernetes.node.start_time doc values 609.69 288.653 -321.037 kB -52.66%
tsdb kubernetes.node.start_time points 230.318 240.573 10.2549 kB +4.45%
tsdb kubernetes.node.start_time total 840.009 529.227 -310.782 kB -37.00%
tsdb kubernetes.node.fs.used.bytes doc values 842.731 860.991 18.2598 kB +2.17%
tsdb kubernetes.node.fs.used.bytes total 842.731 860.991 18.2598 kB +2.17%
tsdb kubernetes.node.fs.available.bytes doc values 843.511 862.281 18.7705 kB +2.23%
tsdb kubernetes.node.fs.available.bytes total 843.511 862.281 18.7705 kB +2.23%
tsdb kubernetes.node.runtime.imagefs.available.bytes doc values 843.511 862.281 18.7705 kB +2.23%
tsdb kubernetes.node.runtime.imagefs.available.bytes total 843.511 862.281 18.7705 kB +2.23%
tsdb kubernetes.labels.kubernetes_io/hostname inverted index 135.429 156.731 21.3027 kB +15.73%
tsdb kubernetes.labels.kubernetes_io/hostname doc values 734.89 147.177 -587.713 kB -79.97%
tsdb kubernetes.labels.kubernetes_io/hostname total 870.318 303.908 -566.41 kB -65.08%
tsdb kubernetes.system.memory.majorpagefaults doc values 841.684 875.34 33.6562 kB +4.00%
tsdb kubernetes.system.memory.majorpagefaults total 841.684 875.34 33.6562 kB +4.00%
tsdb kubernetes.event.metadata.namespace inverted index 132.256 138.84 6.58398 kB +4.98%
tsdb kubernetes.event.metadata.namespace doc values 799.251 154.889 -644.362 kB -80.62%
tsdb kubernetes.event.metadata.namespace total 931.507 293.729 -637.778 kB -68.47%
tsdb kubernetes.volume.fs.inodes.used doc values 846.312 1007.02 160.706 kB +18.99%
tsdb kubernetes.volume.fs.inodes.used total 846.312 1007.02 160.706 kB +18.99%
tsdb kubernetes.container.logs.inodes.count doc values 922.613 1021.51 98.8945 kB +10.72%
tsdb kubernetes.container.logs.inodes.count total 922.613 1021.51 98.8945 kB +10.72%
tsdb kubernetes.node.memory.rss.bytes doc values 1.00396 1.01709 0.01313 MB +1.31%
tsdb kubernetes.node.memory.rss.bytes total 1.00396 1.01709 0.01313 MB +1.31%
tsdb kubernetes.node.memory.workingset.bytes doc values 1.00788 1.02065 0.01276 MB +1.27%
tsdb kubernetes.node.memory.workingset.bytes total 1.00788 1.02065 0.01276 MB +1.27%
tsdb kubernetes.node.memory.available.bytes doc values 1.01 1.02295 0.01295 MB +1.28%
tsdb kubernetes.node.memory.available.bytes total 1.01 1.02295 0.01295 MB +1.28%
tsdb kubernetes.node.memory.usage.bytes doc values 1.02172 1.03459 0.01288 MB +1.26%
tsdb kubernetes.node.memory.usage.bytes total 1.02172 1.03459 0.01288 MB +1.26%
tsdb kubernetes.container.memory.majorpagefaults doc values 935.887 1062.53 126.641 kB +13.53%
tsdb kubernetes.container.memory.majorpagefaults total 935.887 1062.53 126.641 kB +13.53%
tsdb kubernetes.container.logs.capacity.bytes doc values 1001.45 1100.37 98.918 kB +9.88%
tsdb kubernetes.container.logs.capacity.bytes total 1001.45 1100.37 98.918 kB +9.88%
tsdb kubernetes.container.rootfs.capacity.bytes doc values 1001.45 1100.37 98.918 kB +9.88%
tsdb kubernetes.container.rootfs.capacity.bytes total 1001.45 1100.37 98.918 kB +9.88%
tsdb kubernetes.container.rootfs.inodes.used doc values 1.02521 1.15667 0.13145 MB +12.82%
tsdb kubernetes.container.rootfs.inodes.used total 1.02521 1.15667 0.13145 MB +12.82%
tsdb kubernetes.system.container inverted index 180.907 190.232 9.3252 kB +5.15%
tsdb kubernetes.system.container doc values 1093.62 845.908 -247.716 kB -22.65%
tsdb kubernetes.system.container total 1.24466 1.01186 -0.2328 MB -18.70%
tsdb kubernetes.labels.k8s-app inverted index 179.146 189.854 10.708 kB +5.98%
tsdb kubernetes.labels.k8s-app doc values 1128.74 927.106 -201.63 kB -17.86%
tsdb kubernetes.labels.k8s-app total 1.27723 1.09078 -0.18645 MB -14.60%
tsdb kubernetes.event.reason inverted index 530.658 535.394 4.73535 kB +0.89%
tsdb kubernetes.event.reason doc values 813.771 345.518 -468.253 kB -57.54%
tsdb kubernetes.event.reason total 1344.43 880.911 -463.518 kB -34.48%
tsdb kubernetes.labels.heritage inverted index 145.926 159.36 13.4346 kB +9.21%
tsdb kubernetes.labels.heritage doc values 1.28356 1.29396 0.0104 MB +0.81%
tsdb kubernetes.labels.heritage total 1.42607 1.44958 0.02352 MB +1.65%
tsdb kubernetes.volume.fs.inodes.count doc values 1.26969 1.5331 0.26341 MB +20.75%
tsdb kubernetes.volume.fs.inodes.count total 1.26969 1.5331 0.26341 MB +20.75%
tsdb kubernetes.volume.fs.used.bytes doc values 1.36314 1.56259 0.19945 MB +14.63%
tsdb kubernetes.volume.fs.used.bytes total 1.36314 1.56259 0.19945 MB +14.63%
tsdb kubernetes.pod.network.rx.errors doc values 1.63971 1.66888 0.02917 MB +1.78%
tsdb kubernetes.pod.network.rx.errors total 1.63971 1.66888 0.02917 MB +1.78%
tsdb kubernetes.pod.network.tx.errors doc values 1.63971 1.66888 0.02917 MB +1.78%
tsdb kubernetes.pod.network.tx.errors total 1.63971 1.66888 0.02917 MB +1.78%
tsdb kubernetes.container.rootfs.used.bytes doc values 1.58289 1.74203 0.15914 MB +10.05%
tsdb kubernetes.container.rootfs.used.bytes total 1.58289 1.74203 0.15914 MB +10.05%
tsdb kubernetes.node.network.tx.bytes doc values 1.74452 1.76702 0.0225 MB +1.29%
tsdb kubernetes.node.network.tx.bytes total 1.74452 1.76702 0.0225 MB +1.29%
tsdb kubernetes.node.network.rx.bytes doc values 1.8152 1.83528 0.02008 MB +1.11%
tsdb kubernetes.node.network.rx.bytes total 1.8152 1.83528 0.02008 MB +1.11%
tsdb kubernetes.node.cpu.usage.nanocores doc values 1.86809 1.87831 0.01022 MB +0.55%
tsdb kubernetes.node.cpu.usage.nanocores total 1.86809 1.87831 0.01022 MB +0.55%
tsdb kubernetes.pod.memory.major_page_faults doc values 1.84785 1.90964 0.06179 MB +3.34%
tsdb kubernetes.pod.memory.major_page_faults total 1.84785 1.90964 0.06179 MB +3.34%
tsdb kubernetes.system.memory.pagefaults doc values 2.02534 2.094 0.06866 MB +3.39%
tsdb kubernetes.system.memory.pagefaults total 2.02534 2.094 0.06866 MB +3.39%
tsdb kubernetes.labels.chart inverted index 254.027 273.917 19.8896 kB +7.83%
tsdb kubernetes.labels.chart doc values 1.86302 1.62398 -0.23903 MB -12.83%
tsdb kubernetes.labels.chart total 2.11109 1.89148 -0.21961 MB -10.40%
tsdb kubernetes.pod.status.scheduled inverted index 343.162 356.38 13.2178 kB +3.85%
tsdb kubernetes.pod.status.scheduled doc values 1.69053 1.9257 0.23518 MB +13.91%
tsdb kubernetes.pod.status.scheduled total 2.02565 2.27373 0.24808 MB +12.25%
tsdb kubernetes.event.involved_object.resource_version inverted index 885.088 891.524 6.43652 kB +0.73%
tsdb kubernetes.event.involved_object.resource_version doc values 1639.13 557.895 -1081.24 kB -65.96%
tsdb kubernetes.event.involved_object.resource_version total 2.46506 1.41545 -1.04961 MB -42.58%
tsdb kubernetes.event.involved_object.name inverted index 981.589 987.7 6.11133 kB +0.62%
tsdb kubernetes.event.involved_object.name doc values 1544.54 372.775 -1171.76 kB -75.86%
tsdb kubernetes.event.involved_object.name total 2.46692 1.32859 -1.13833 MB -46.14%
tsdb kubernetes.node.cpu.usage.core.ns doc values 2.46695 2.48772 0.02077 MB +0.84%
tsdb kubernetes.node.cpu.usage.core.ns total 2.46695 2.48772 0.02077 MB +0.84%
tsdb kubernetes.volume.fs.inodes.free doc values 2.12777 2.51408 0.3863 MB +18.16%
tsdb kubernetes.volume.fs.inodes.free total 2.12777 2.51408 0.3863 MB +18.16%
tsdb kubernetes.container.logs.used.bytes doc values 2.46641 2.63021 0.1638 MB +6.64%
tsdb kubernetes.container.logs.used.bytes total 2.46641 2.63021 0.1638 MB +6.64%
tsdb kubernetes.system.memory.rss.bytes doc values 2.65915 2.7042 0.04506 MB +1.69%
tsdb kubernetes.system.memory.rss.bytes total 2.65915 2.7042 0.04506 MB +1.69%
tsdb kubernetes.system.start_time doc values 2.00613 1.01242 -0.99371 MB -49.53%
tsdb kubernetes.system.start_time points 740.816 768.746 27.9297 kB +3.77%
tsdb kubernetes.system.start_time total 2.72959 1.76315 -0.96644 MB -35.41%
tsdb kubernetes.system.memory.workingset.bytes doc values 2.72992 2.77405 0.04413 MB +1.62%
tsdb kubernetes.system.memory.workingset.bytes total 2.72992 2.77405 0.04413 MB +1.62%
tsdb kubernetes.system.memory.usage.bytes doc values 2.77827 2.8231 0.04483 MB +1.61%
tsdb kubernetes.system.memory.usage.bytes total 2.77827 2.8231 0.04483 MB +1.61%
tsdb kubernetes.pod.status.ready inverted index 565.437 588.31 22.873 kB +4.05%
tsdb kubernetes.pod.status.ready doc values 2.29687 1.97896 -0.31791 MB -13.84%
tsdb kubernetes.pod.status.ready total 2.84905 2.55348 -0.29557 MB -10.37%
tsdb kubernetes.event.metadata.resource_version inverted index 1.46267 1.46532 0.00264 MB +0.18%
tsdb kubernetes.event.metadata.resource_version doc values 1909.49 743.162 -1166.32 kB -61.08%
tsdb kubernetes.event.metadata.resource_version total 3.32741 2.19106 -1.13635 MB -34.15%
tsdb kubernetes.event.metadata.name inverted index 1.4466 1.45138 0.00478 MB +0.33%
tsdb kubernetes.event.metadata.name doc values 1955.79 757.797 -1198 kB -61.25%
tsdb kubernetes.event.metadata.name total 3.35655 2.19142 -1.16513 MB -34.71%
tsdb kubernetes.event.metadata.self_link inverted index 1.44694 1.45209 0.00515 MB +0.36%
tsdb kubernetes.event.metadata.self_link doc values 1964.42 766.519 -1197.9 kB -60.98%
tsdb kubernetes.event.metadata.self_link total 3.36531 2.20064 -1.16468 MB -34.61%
tsdb kubernetes.pod.status.phase inverted index 637.96 662.74 24.7803 kB +3.88%
tsdb kubernetes.pod.status.phase doc values 2.74456 2.02162 -0.72294 MB -26.34%
tsdb kubernetes.pod.status.phase total 3.36757 2.66883 -0.69874 MB -20.75%
tsdb kubernetes.labels.app_kubernetes_io/instance inverted index 398.707 430.375 31.668 kB +7.94%
tsdb kubernetes.labels.app_kubernetes_io/instance doc values 3.1656 2.24262 -0.92298 MB -29.16%
tsdb kubernetes.labels.app_kubernetes_io/instance total 3.55496 2.6629 -0.89206 MB -25.09%
tsdb kubernetes.labels.app_kubernetes_io/name inverted index 399.146 430.152 31.0059 kB +7.77%
tsdb kubernetes.labels.app_kubernetes_io/name doc values 3.19288 2.24246 -0.95042 MB -29.77%
tsdb kubernetes.labels.app_kubernetes_io/name total 3.58267 2.66253 -0.92014 MB -25.68%
tsdb kubernetes.event.metadata.timestamp.created doc values 1.87377 1.57526 -0.29851 MB -15.93%
tsdb kubernetes.event.metadata.timestamp.created points 1.99279 1.99191 -0.00088 MB -0.04%
tsdb kubernetes.event.metadata.timestamp.created total 3.86657 3.56717 -0.29939 MB -7.74%
tsdb kubernetes.event.timestamp.last_occurrence doc values 1.78533 1.59653 -0.1888 MB -10.57%
tsdb kubernetes.event.timestamp.last_occurrence points 2.08282 2.07866 -0.00416 MB -0.20%
tsdb kubernetes.event.timestamp.last_occurrence total 3.86815 3.6752 -0.19295 MB -4.99%
tsdb kubernetes.labels.tier inverted index 382.247 408.384 26.1367 kB +6.84%
tsdb kubernetes.labels.tier doc values 3.47404 3.47728 0.00323 MB +0.09%
tsdb kubernetes.labels.tier total 3.84733 3.87609 0.02876 MB +0.75%
tsdb kubernetes.statefulset.name inverted index 428.308 460.004 31.6963 kB +7.40%
tsdb kubernetes.statefulset.name doc values 3.53269 2.46643 -1.06625 MB -30.18%
tsdb kubernetes.statefulset.name total 3.95096 2.91566 -1.0353 MB -26.20%
tsdb kubernetes.event.timestamp.first_occurrence doc values 2.01438 1.572 -0.44238 MB -21.96%
tsdb kubernetes.event.timestamp.first_occurrence points 1.98392 1.98058 -0.00334 MB -0.17%
tsdb kubernetes.event.timestamp.first_occurrence total 3.9983 3.55258 -0.44572 MB -11.15%
tsdb kubernetes.labels.statefulset_kubernetes_io/pod-name inverted index 451.543 475.123 23.5801 kB +5.22%
tsdb kubernetes.labels.statefulset_kubernetes_io/pod-name doc values 3.83191 2.4673 -1.36461 MB -35.61%
tsdb kubernetes.labels.statefulset_kubernetes_io/pod-name total 4.27287 2.93129 -1.34159 MB -31.40%
tsdb kubernetes.labels.component inverted index 518.102 546.459 28.3574 kB +5.47%
tsdb kubernetes.labels.component doc values 3.78474 3.28398 -0.50075 MB -13.23%
tsdb kubernetes.labels.component total 4.2907 3.81763 -0.47306 MB -11.03%
tsdb kubernetes.container.memory.usage.node.pct doc values 4.36672 1.537 -2.82972 MB -64.80%
tsdb kubernetes.container.memory.usage.node.pct total 4.36672 1.537 -2.82972 MB -64.80%
tsdb kubernetes.volume.fs.capacity.bytes doc values 3.95896 4.41682 0.45785 MB +11.56%
tsdb kubernetes.volume.fs.capacity.bytes total 3.95896 4.41682 0.45785 MB +11.56%
tsdb kubernetes.pod.host_ip doc values 2.97032 1.94084 -1.02948 MB -34.66%
tsdb kubernetes.pod.host_ip points 1.71368 1.81163 0.09796 MB +5.72%
tsdb kubernetes.pod.host_ip total 4.684 3.75247 -0.93153 MB -19.89%
tsdb kubernetes.volume.fs.available.bytes doc values 4.2966 4.73675 0.44016 MB +10.24%
tsdb kubernetes.volume.fs.available.bytes total 4.2966 4.73675 0.44016 MB +10.24%
tsdb kubernetes.container.memory.available.bytes doc values 4.60956 4.77241 0.16284 MB +3.53%
tsdb kubernetes.container.memory.available.bytes total 4.60956 4.77241 0.16284 MB +3.53%
tsdb kubernetes.event.involved_object.uid inverted index 2.23648 2.26128 0.0248 MB +1.11%
tsdb kubernetes.event.involved_object.uid doc values 2.56764 1.74078 -0.82687 MB -32.20%
tsdb kubernetes.event.involved_object.uid total 4.80412 4.00206 -0.80206 MB -16.70%
tsdb kubernetes.container.logs.inodes.used doc values 4.83786 5.04066 0.20281 MB +4.19%
tsdb kubernetes.container.logs.inodes.used total 4.83786 5.04066 0.20281 MB +4.19%
tsdb kubernetes.container.logs.inodes.free doc values 4.84895 5.05359 0.20463 MB +4.22%
tsdb kubernetes.container.logs.inodes.free total 4.84895 5.05359 0.20463 MB +4.22%
tsdb agent.version inverted index 5.30221 1.61716 -3.68505 MB -69.50%
tsdb agent.version doc values 108 2.73382e+06 2.73371e+06 bytes +2531216.67%
tsdb agent.version total 5.30231 4.22433 -1.07798 MB -20.33%
tsdb ecs.version inverted index 5.30221 1.61716 -3.68505 MB -69.50%
tsdb ecs.version doc values 108 2.73382e+06 2.73371e+06 bytes +2531216.67%
tsdb ecs.version total 5.30231 4.22433 -1.07798 MB -20.33%
tsdb agent.type inverted index 5.30229 1.6173 -3.68499 MB -69.50%
tsdb agent.type doc values 198 2.73397e+06 2.73377e+06 bytes +1380693.94%
tsdb agent.type total 5.30248 4.22462 -1.07786 MB -20.33%
tsdb event.module inverted index 5.30229 1.6173 -3.68499 MB -69.50%
tsdb event.module doc values 198 2.73397e+06 2.73377e+06 bytes +1380693.94%
tsdb event.module total 5.30248 4.22462 -1.07786 MB -20.33%
tsdb service.type inverted index 5.30229 1.6173 -3.68499 MB -69.50%
tsdb service.type doc values 198 2.73397e+06 2.73377e+06 bytes +1380693.94%
tsdb service.type total 5.30248 4.22462 -1.07786 MB -20.33%
tsdb fields.cluster inverted index 5.30233 1.61736 -3.68497 MB -69.50%
tsdb fields.cluster doc values 234 2.73403e+06 2.7338e+06 bytes +1168289.74%
tsdb fields.cluster total 5.30255 4.22473 -1.07782 MB -20.33%
tsdb kubernetes.container.cpu.usage.node.pct doc values 5.31834 2.89077 -2.42757 MB -45.65%
tsdb kubernetes.container.cpu.usage.node.pct total 5.31834 2.89077 -2.42757 MB -45.65%
tsdb kubernetes.container.memory.rss.bytes doc values 5.29827 5.47229 0.17402 MB +3.28%
tsdb kubernetes.container.memory.rss.bytes total 5.29827 5.47229 0.17402 MB +3.28%
tsdb kubernetes.container.memory.pagefaults doc values 5.34551 5.56409 0.21858 MB +4.09%
tsdb kubernetes.container.memory.pagefaults total 5.34551 5.56409 0.21858 MB +4.09%
tsdb kubernetes.pod.memory.usage.node.pct doc values 5.57244 2.3436 -3.22884 MB -57.94%
tsdb kubernetes.pod.memory.usage.node.pct total 5.57244 2.3436 -3.22884 MB -57.94%
tsdb container.runtime inverted index 3.27382 3.27258 -0.00124 MB -0.04%
tsdb container.runtime doc values 281.895 2388.03 2106.13 kB +747.14%
tsdb container.runtime total 3.54911 5.60464 2.05553 MB +57.92%
tsdb kubernetes.container.memory.workingset.bytes doc values 5.5217 5.68608 0.16438 MB +2.98%
tsdb kubernetes.container.memory.workingset.bytes total 5.5217 5.68608 0.16438 MB +2.98%
tsdb kubernetes.system.cpu.usage.nanocores doc values 5.69641 5.72614 0.02973 MB +0.52%
tsdb kubernetes.system.cpu.usage.nanocores total 5.69641 5.72614 0.02973 MB +0.52%
tsdb kubernetes.event.message inverted index 2.15709 2.1788 0.0217 MB +1.01%
tsdb kubernetes.event.message stored fields 3.14205 3.57794 0.4359 MB +13.87%
tsdb kubernetes.event.message total 5.29914 5.75674 0.4576 MB +8.64%
tsdb kubernetes.container.memory.usage.bytes doc values 5.62459 5.79182 0.16723 MB +2.97%
tsdb kubernetes.container.memory.usage.bytes total 5.62459 5.79182 0.16723 MB +2.97%
tsdb kubernetes.pod.memory.available.bytes doc values 5.8365 5.93994 0.10343 MB +1.77%
tsdb kubernetes.pod.memory.available.bytes total 5.8365 5.93994 0.10343 MB +1.77%
tsdb kubernetes.pod.cpu.usage.node.pct doc values 6.17387 3.62804 -2.54583 MB -41.24%
tsdb kubernetes.pod.cpu.usage.node.pct total 6.17387 3.62804 -2.54583 MB -41.24%
tsdb kubernetes.pod.memory.rss.bytes doc values 6.30632 6.39368 0.08735 MB +1.39%
tsdb kubernetes.pod.memory.rss.bytes total 6.30632 6.39368 0.08735 MB +1.39%
tsdb kubernetes.pod.memory.working_set.bytes doc values 6.45478 6.5431 0.08832 MB +1.37%
tsdb kubernetes.pod.memory.working_set.bytes total 6.45478 6.5431 0.08832 MB +1.37%
tsdb kubernetes.pod.memory.page_faults doc values 6.41775 6.56842 0.15068 MB +2.35%
tsdb kubernetes.pod.memory.page_faults total 6.41775 6.56842 0.15068 MB +2.35%
tsdb kubernetes.pod.memory.usage.bytes doc values 6.52915 6.61649 0.08735 MB +1.34%
tsdb kubernetes.pod.memory.usage.bytes total 6.52915 6.61649 0.08735 MB +1.34%
tsdb kubernetes.container.cpu.usage.limit.pct doc values 6.83339 3.91838 -2.91501 MB -42.66%
tsdb kubernetes.container.cpu.usage.limit.pct total 6.83339 3.91838 -2.91501 MB -42.66%
tsdb kubernetes.container.memory.usage.limit.pct doc values 6.87115 2.66327 -4.20787 MB -61.24%
tsdb kubernetes.container.memory.usage.limit.pct total 6.87115 2.66327 -4.20787 MB -61.24%
tsdb kubernetes.system.cpu.usage.core.ns doc values 6.97063 7.03216 0.06153 MB +0.88%
tsdb kubernetes.system.cpu.usage.core.ns total 6.97063 7.03216 0.06153 MB +0.88%
tsdb kubernetes.labels.pod-template-generation inverted index 943.357 992.013 48.6553 kB +5.16%
tsdb kubernetes.labels.pod-template-generation doc values 6.42035 5.87511 -0.54524 MB -8.49%
tsdb kubernetes.labels.pod-template-generation total 7.34159 6.84387 -0.49772 MB -6.78%
tsdb kubernetes.pod.cpu.usage.limit.pct doc values 7.56072 4.61589 -2.94483 MB -38.95%
tsdb kubernetes.pod.cpu.usage.limit.pct total 7.56072 4.61589 -2.94483 MB -38.95%
tsdb kubernetes.labels.logtype inverted index 868.564 900.669 32.1045 kB +3.70%
tsdb kubernetes.labels.logtype doc values 6.80369 6.63493 -0.16876 MB -2.48%
tsdb kubernetes.labels.logtype total 7.6519 7.51449 -0.1374 MB -1.80%
tsdb kubernetes.pod.memory.usage.limit.pct doc values 7.88462 3.42458 -4.46005 MB -56.57%
tsdb kubernetes.pod.memory.usage.limit.pct total 7.88462 3.42458 -4.46005 MB -56.57%
tsdb kubernetes.container.logs.available.bytes doc values 8.53668 8.7519 0.21522 MB +2.52%
tsdb kubernetes.container.logs.available.bytes total 8.53668 8.7519 0.21522 MB +2.52%
tsdb kubernetes.container.rootfs.available.bytes doc values 8.53668 8.7519 0.21522 MB +2.52%
tsdb kubernetes.container.rootfs.available.bytes total 8.53668 8.7519 0.21522 MB +2.52%
tsdb service.address inverted index 5.33304 5.35258 0.01953 MB +0.37%
tsdb service.address doc values 2.19608 3.66071 1.46463 MB +66.69%
tsdb service.address total 7.52913 9.01329 1.48416 MB +19.71%
tsdb kubernetes.labels.github_account inverted index 2.30408 2.32873 0.02464 MB +1.07%
tsdb kubernetes.labels.github_account doc values 7.03372 5.67047 -1.36325 MB -19.38%
tsdb kubernetes.labels.github_account total 9.3378 7.99919 -1.33861 MB -14.34%
tsdb event.dataset inverted index 6.81289 6.82791 0.01502 MB +0.22%
tsdb event.dataset doc values 799.582 2965.18 2165.59 kB +270.84%
tsdb event.dataset total 7.59373 9.72359 2.12986 MB +28.05%
tsdb kubernetes.event.metadata.uid inverted index 4.49253 4.54021 0.04768 MB +1.06%
tsdb kubernetes.event.metadata.uid doc values 5.45743 4.31491 -1.14252 MB -20.94%
tsdb kubernetes.event.metadata.uid total 9.94996 8.85512 -1.09484 MB -11.00%
tsdb kubernetes.container.status.restarts doc values 10.4885 10.5317 0.04322 MB +0.41%
tsdb kubernetes.container.status.restarts total 10.4885 10.5317 0.04322 MB +0.41%
tsdb kubernetes.volume.name inverted index 1.75855 1.84524 0.08669 MB +4.93%
tsdb kubernetes.volume.name doc values 9770.84 814.933 -8955.91 kB -91.66%
tsdb kubernetes.volume.name total 11.3004 2.64107 -8.65932 MB -76.63%
tsdb kubernetes.container.status.phase inverted index 5.97913 6.0599 0.08076 MB +1.35%
tsdb kubernetes.container.status.phase doc values 6.54806 3.32623 -3.22183 MB -49.20%
tsdb kubernetes.container.status.phase total 12.5272 9.38612 -3.14107 MB -25.07%
tsdb metricset.name inverted index 7.15247 7.20241 0.04994 MB +0.70%
tsdb metricset.name doc values 5.38711 3.32238 -2.06473 MB -38.33%
tsdb metricset.name total 12.5396 10.5248 -2.01479 MB -16.07%
tsdb kubernetes.labels.controller-revision-hash inverted index 1.49741 1.57972 0.08231 MB +5.50%
tsdb kubernetes.labels.controller-revision-hash doc values 12.0023 6.82464 -5.1777 MB -43.14%
tsdb kubernetes.labels.controller-revision-hash total 13.4998 8.40436 -5.0954 MB -37.74%
tsdb kubernetes.pod.network.tx.bytes doc values 13.4904 13.6668 0.17642 MB +1.31%
tsdb kubernetes.pod.network.tx.bytes total 13.4904 13.6668 0.17642 MB +1.31%
tsdb kubernetes.pod.network.rx.bytes doc values 13.7751 13.9512 0.17611 MB +1.28%
tsdb kubernetes.pod.network.rx.bytes total 13.7751 13.9512 0.17611 MB +1.28%
tsdb kubernetes.container.cpu.limit.cores doc values 14.1255 15.1015 0.97596 MB +6.91%
tsdb kubernetes.container.cpu.limit.cores total 14.1255 15.1015 0.97596 MB +6.91%
tsdb kubernetes.container.memory.limit.bytes doc values 15.2359 15.8275 0.59158 MB +3.88%
tsdb kubernetes.container.memory.limit.bytes total 15.2359 15.8275 0.59158 MB +3.88%
tsdb kubernetes.container.memory.request.bytes doc values 15.3345 15.9641 0.62956 MB +4.11%
tsdb kubernetes.container.memory.request.bytes total 15.3345 15.9641 0.62956 MB +4.11%
tsdb kubernetes.container.cpu.request.cores doc values 14.9902 16.1029 1.11266 MB +7.42%
tsdb kubernetes.container.cpu.request.cores total 14.9902 16.1029 1.11266 MB +7.42%
tsdb kubernetes.pod.cpu.usage.nanocores doc values 16.3911 16.4454 0.05426 MB +0.33%
tsdb kubernetes.pod.cpu.usage.nanocores total 16.3911 16.4454 0.05426 MB +0.33%
tsdb kubernetes.labels.release inverted index 1.98475 2.08709 0.10234 MB +5.16%
tsdb kubernetes.labels.release doc values 14.5716 8.02747 -6.54413 MB -44.91%
tsdb kubernetes.labels.release total 16.5564 10.1146 -6.44179 MB -38.91%
tsdb kubernetes.container.cpu.usage.nanocores doc values 16.8182 16.9471 0.12895 MB +0.77%
tsdb kubernetes.container.cpu.usage.nanocores total 16.8182 16.9471 0.12895 MB +0.77%
tsdb kubernetes.container.start_time doc values 13.9783 1.95114 -12.0271 MB -86.04%
tsdb kubernetes.container.start_time points 3.37317 3.47526 0.10209 MB +3.03%
tsdb kubernetes.container.start_time total 17.3514 5.42639 -11.925 MB -68.73%
tsdb kubernetes.pod.start_time doc values 14.3584 2.71684 -11.6416 MB -81.08%
tsdb kubernetes.pod.start_time points 2.99406 3.07879 0.08473 MB +2.83%
tsdb kubernetes.pod.start_time total 17.3525 5.79563 -11.5569 MB -66.60%
tsdb kubernetes.container.status.ready inverted index 4.44784 4.5217 0.07387 MB +1.66%
tsdb kubernetes.container.status.ready doc values 13.4134 11.0511 -2.36224 MB -17.61%
tsdb kubernetes.container.status.ready total 17.8612 15.5728 -2.28837 MB -12.81%
tsdb kubernetes.pod.ip doc values 11.7231 2.32528 -9.3978 MB -80.16%
tsdb kubernetes.pod.ip points 6.63617 6.77593 0.13976 MB +2.11%
tsdb kubernetes.pod.ip total 18.3593 9.10121 -9.25804 MB -50.43%
tsdb kubernetes.replicaset.name inverted index 2.81028 2.97213 0.16185 MB +5.76%
tsdb kubernetes.replicaset.name doc values 18.4395 9.01596 -9.42352 MB -51.11%
tsdb kubernetes.replicaset.name total 21.2498 11.9881 -9.26167 MB -43.58%
tsdb kubernetes.labels.pod-template-hash inverted index 2.81067 2.97279 0.16212 MB +5.77%
tsdb kubernetes.labels.pod-template-hash doc values 18.4399 9.01665 -9.42325 MB -51.10%
tsdb kubernetes.labels.pod-template-hash total 21.2506 11.9894 -9.26113 MB -43.58%
tsdb kubernetes.container.status.reason inverted index 3.35487 3.41689 0.06201 MB +1.85%
tsdb kubernetes.container.status.reason doc values 18.4615 11.0487 -7.41282 MB -40.15%
tsdb kubernetes.container.status.reason total 21.8164 14.4656 -7.3508 MB -33.69%
tsdb kubernetes.container.cpu.usage.core.ns doc values 21.6668 21.884 0.21723 MB +1.00%
tsdb kubernetes.container.cpu.usage.core.ns total 21.6668 21.884 0.21723 MB +1.00%
tsdb metricset.period doc values 34.6497 34.7789 0.12913 MB +0.37%
tsdb metricset.period total 34.6497 34.7789 0.12913 MB +0.37%
tsdb kubernetes.labels.app inverted index 4.49839 4.72637 0.22798 MB +5.07%
tsdb kubernetes.labels.app doc values 30.5852 12.3604 -18.2248 MB -59.59%
tsdb kubernetes.labels.app total 35.0836 17.0868 -17.9968 MB -51.30%
tsdb kubernetes.container.id inverted index 17.7822 18.8641 1.08194 MB +6.08%
tsdb kubernetes.container.id doc values 30.0582 7.10012 -22.9581 MB -76.38%
tsdb kubernetes.container.id total 47.8404 25.9642 -21.8761 MB -45.73%
tsdb container.id inverted index 18.2426 19.4962 1.2536 MB +6.87%
tsdb container.id doc values 30.0506 7.08966 -22.9609 MB -76.41%
tsdb container.id total 48.2932 26.5859 -21.7073 MB -44.95%
tsdb _tsid doc values 48.6107 51.4094 2.79879 MB +5.76%
tsdb _tsid total 48.6107 51.4094 2.79879 MB +5.76%
tsdb kubernetes.container.name inverted index 9.52804 10.1541 0.62606 MB +6.57%
tsdb kubernetes.container.name doc values 47.575 4.26284 -43.3122 MB -91.04%
tsdb kubernetes.container.name total 57.103 14.4169 -42.6861 MB -74.75%
tsdb kubernetes.node.name inverted index 11.0284 11.5107 0.4823 MB +4.37%
tsdb kubernetes.node.name doc values 46.4318 4.5719 -41.8599 MB -90.15%
tsdb kubernetes.node.name total 57.4601 16.0826 -41.3776 MB -72.01%
tsdb kubernetes.container.image inverted index 9.06945 9.67482 0.60537 MB +6.67%
tsdb kubernetes.container.image doc values 50.8295 4.17972 -46.6497 MB -91.78%
tsdb kubernetes.container.image total 59.8989 13.8545 -46.0444 MB -76.87%
tsdb kubernetes.namespace inverted index 9.9263 10.3372 0.41092 MB +4.14%
tsdb kubernetes.namespace doc values 57.8168 4.85238 -52.9644 MB -91.61%
tsdb kubernetes.namespace total 67.7431 15.1896 -52.5535 MB -77.58%
tsdb kubernetes.labels.job-name inverted index 12.5676 12.9074 0.33977 MB +2.70%
tsdb kubernetes.labels.job-name doc values 57.9453 12.6764 -45.2689 MB -78.12%
tsdb kubernetes.labels.job-name total 70.5129 25.5838 -44.9291 MB -63.72%
tsdb kubernetes.labels.controller-uid inverted index 13.7838 14.4953 0.71154 MB +5.16%
tsdb kubernetes.labels.controller-uid doc values 60.4609 14.2699 -46.191 MB -76.40%
tsdb kubernetes.labels.controller-uid total 74.2447 28.7652 -45.4794 MB -61.26%
tsdb kubernetes.pod.uid inverted index 20.364 21.7961 1.43202 MB +7.03%
tsdb kubernetes.pod.uid doc values 97.4546 9.30179 -88.1529 MB -90.46%
tsdb kubernetes.pod.uid total 117.819 31.0979 -86.7208 MB -73.61%
tsdb kubernetes.pod.name inverted index 21.469 22.342 0.87304 MB +4.07%
tsdb kubernetes.pod.name doc values 110.718 7.25387 -103.464 MB -93.45%
tsdb kubernetes.pod.name total 132.187 29.5959 -102.591 MB -77.61%
tsdb agent.id inverted index 75.5477 75.7279 0.1802 MB +0.24%
tsdb agent.id doc values 111.265 90.0764 -21.1888 MB -19.04%
tsdb agent.id total 186.813 165.804 -21.0086 MB -11.25%
tsdb agent.hostname inverted index 75.7013 75.8762 0.17491 MB +0.23%
tsdb agent.hostname doc values 111.232 90.2945 -20.9378 MB -18.82%
tsdb agent.hostname total 186.934 166.171 -20.7629 MB -11.11%
tsdb host.name inverted index 75.7013 75.8762 0.17492 MB +0.23%
tsdb host.name doc values 111.232 90.2945 -20.9378 MB -18.82%
tsdb host.name total 186.934 166.171 -20.7629 MB -11.11%
tsdb agent.ephemeral_id inverted index 82.5803 82.7893 0.20895 MB +0.25%
tsdb agent.ephemeral_id doc values 111.297 124.067 12.7699 MB +11.47%
tsdb agent.ephemeral_id total 193.877 206.856 12.9789 MB +6.69%
tsdb _id inverted index 578.178 580.499 2.32062 MB +0.40%
tsdb _id stored fields 61.7795 78.1099 16.3303 MB +26.43%
tsdb _id total 639.958 658.609 18.651 MB +2.91%
tsdb @timestamp doc values 226.901 229.152 2.25179 MB +0.99%
tsdb @timestamp points 436.593 435.279 -1.31449 MB -0.30%
tsdb @timestamp total 663.494 664.431 0.9373 MB +0.14%
tsdb _seq_no doc values 380.106 379.34 -0.76581 MB -0.20%
tsdb _seq_no points 544.252 543.043 -1.20831 MB -0.22%
tsdb _seq_no total 924.358 922.384 -1.97413 MB -0.21%
tsdb event.duration doc values 552.966 536.913 -16.0531 MB -2.90%
tsdb event.duration points 632.037 632.07 0.03355 MB 0.01%
tsdb event.duration total 1.15723 1.14158 -0.01564 GB -1.35%
tsdb _recovery_source stored fields 2.34993 2.97252 0.62259 GB +26.49%
tsdb _recovery_source doc values 1.66456 1.78309 0.11853 MB +7.12%
tsdb _recovery_source total 2.35156 2.97426 0.6227 GB +26.48%
Min Throughput index 64747.5 63767.8 -979.689 docs/s -1.51%
Mean Throughput index 68158.5 66814 -1344.49 docs/s -1.97%
Median Throughput index 68024.2 66680.4 -1343.8 docs/s -1.98%
Max Throughput index 71848.9 70438.8 -1410.14 docs/s -1.96%
50th percentile latency index 487.425 502.385 14.9604 ms +3.07%
90th percentile latency index 1118.77 1115.76 -3.00404 ms -0.27%
99th percentile latency index 2037.83 1926.81 -111.018 ms -5.45%
99.9th percentile latency index 3389.4 3344.89 -44.5072 ms -1.31%
99.99th percentile latency index 4173.46 4029.33 -144.129 ms -3.45%
100th percentile latency index 4383.15 4395.38 12.2266 ms +0.28%
50th percentile service time index 487.425 502.385 14.9604 ms +3.07%
90th percentile service time index 1118.77 1115.76 -3.00404 ms -0.27%
99th percentile service time index 2037.83 1926.81 -111.018 ms -5.45%
99.9th percentile service time index 3389.4 3344.89 -44.5072 ms -1.31%
99.99th percentile service time index 4173.46 4029.33 -144.129 ms -3.45%
100th percentile service time index 4383.15 4395.38 12.2266 ms +0.28%
error rate index 0 0 0 % 0.00%

@StephanErb
Copy link

Is it expected that gauges like tsdb kubernetes.pod.memory.usage.limit.pct drop so much in size? I would have expect that those are already stored pretty efficiently by the double delta encoding.

@felixbarny
Copy link
Member Author

Is it expected that gauges like tsdb kubernetes.pod.memory.usage.limit.pct drop so much in size?

No, that's not expected. The new encoding shouldn't affect gauges and counters. Maybe there's a bug that it accidentally does. But more likely, the issue is that I didn't force-merge down to one segment in these tests. There is a force-merge step in the benchmark and I assumed that it would force-merge to one segment by default. Turns out that it doesn't default to 1.

@jpountz
Copy link
Contributor

jpountz commented Sep 25, 2023

Nice work!

The fact that we're not seeing better improvements makes me wonder if we're missing the time_series_dimension flag on the agent.id field? The change to kubernetes.pod.memory.usage.limit.pct may indeed be related to the segment count.

I think that this format could be a good pick for logs later on, so I would like to avoid specializing it too much for the tsdb index mode, unless we can think of downsides with this approach. From that perspective, I would suggest the following format per block:

[<header: 1+ bytes><data: 0..N bytes>]

Bits 0-1 of the first byte of the header would describe the format that is used, how the data and the rest of the header need to be interpreted depend on this format:

  • 0x00: all ordinals are the same in the block
  • 0x01: ordinals are bit-packed
  • 0x02: the block contains two runs of ordinals
  • 0x03: unused for now, could be used later on if there is another way how ordinals may be organized that we'd like to optimize for

When the format is 0x00, bits 3-7 store the lower 5 bits of the ordinal, and bit 2 is a continuation bit, to know if more data needs to be read. So it would take a single byte to encode a block whose ordinals are all the same with a value <= 31, 2 bytes if the ordinal is in [32, 4096), 3 bytes if the ordinal is in [4096, 524288), etc.

When the format is 0x01, no additional information is stored in the header and ordinals are encoded on just as many bits are required based on the maximum ord of the field which is stored at the segment level.

When the format is 0x02 the first ordinal is encoded the same way as with 0x00. Then a byte stores the offset at which the ordinal value changes, and a zLong stores the delta between the ordinal at the beginning of the block and the ordinal at the end of the block (to optimize for the case when the field is part of the index sort).

What do you think?

@mattc58 mattc58 added v8.12.0 and removed v8.11.0 labels Oct 4, 2023
@jpountz
Copy link
Contributor

jpountz commented Oct 12, 2023

FYI I was interested in using your change in another context, so I gave a try at implementing something like the above format that I suggested. I uploaded it there in case you are interested in checking it out: main...jpountz:elasticsearch:pr/99747.

@felixbarny
Copy link
Member Author

I think that this format could be a good pick for logs later on, so I would like to avoid specializing it too much for the tsdb index mode, unless we can think of downsides with this approach.

Makes sense to me. Your proposal with the header makes sense to me. Feel free to push the commits to this PR.

This only supports runs for 1 or 2 unique values per block, right? I suppose the assumption is that the block will mostly have one value and sometimes two, at the boundary between two different runs. Is that right?

I'm wondering if we can optimize further by making the blocks larger if there are runs of over 128 consecutive ordinals. When decoding these longer runs, we could also avoid expending them into a long[] and just store the value in a single long variable and allow random access in that block.

@jpountz
Copy link
Contributor

jpountz commented Oct 12, 2023

This only supports runs for 1 or 2 unique values per block, right? I suppose the assumption is that the block will mostly have one value and sometimes two, at the boundary between two different runs. Is that right?

This is correct.

I'm wondering if we can optimize further by making the blocks larger if there are runs of over 128 consecutive ordinals.

We can make blocks larger, but there is a trade-off as blocks need to be entirely decoded even though we might need a single value in them.

When decoding these longer runs, we could also avoid expending them into a long[] and just store the value in a single long variable and allow random access in that block.

We can, but this has a trade-off as well. Right now the read logic has very few conditionals and mostly looks like if (decoded == false) { decode(); } return block[valueIndex];. To do something like you're suggesting we'd need to add an extra conditional to every read, something like: if (decoded == false) { decode(); } if (constantBlock) { return constantValue; } else { return block[valueIndex]; }. The benefit of the current approach is that we only need this conditional in the decoding logic, which gets called once per block, rather than in the read logic which gets called once per document.

@felixbarny
Copy link
Member Author

When the format is 0x00, bits 3-7 store the lower 5 bits of the ordinal, and bit 2 is a continuation bit, to know if more data needs to be read.

Maybe we can make the header variable in size. When bit 0 is not set (0x00), bit 1 is the continuation bit and bits 2-7 store the lower 6 bits so that we can store the range [0,64) in a single byte, [64, 8192) in 2 bytes, etc.

The tradeoff is that we can't use 0x02 as the first bit would be 0 and interpreted as "all ordinals are the same in the block" but as we only intend to use 3 states, this is probably fine.

WDYT?

@jpountz
Copy link
Contributor

jpountz commented Dec 5, 2023

This sounds good to me. Let's mark this draft PR as ready to review? @salvatore-campagna Could you take care of the review?

@felixbarny felixbarny marked this pull request as ready for review December 5, 2023 12:20
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Dec 5, 2023
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@felixbarny
Copy link
Member Author

Please also suggest more test cases, such as integration tests, if necessary.

One of the problems with the rally TSDB track is that that there's probably a bug in the anonymization script. For example, for the same pod id, there are several different host names. We'd typically expect the host to be always the same for the same pod. This affects the ability to de-duplicate runs of repetitive data. Therefore, we can't really rely on the existing rally track to evaluate the storage benefits from this work.

@jpountz
Copy link
Contributor

jpountz commented Dec 5, 2023

DocValuesFormatTestCase is supposed to give good coverage for correctness. And we seem to have coverage for the various cases that the encoding logic tries to optimize for, so unit testing looks good from my perspective.

I'm not too worried about not being able to better evaluate storage savings, if we have unit tests that make sure we do indeed encode runs of the same value on one or two bytes per block, this is good enough for me. The next level of testing I'll be especially interested in are performance benchmarks, checking that performance for terms aggregations on keyword fields remains on par with the current doc-values format.

@martijnvg
Copy link
Member

martijnvg commented Feb 2, 2024

I checked the storage savings that this change would give and it looks good.
The storage used for doc values of dimension fields drops from 30.5mb to 1.3mb.
Additionally the storage used for _tsid field drops from 2mb to 267.4kb. These are great results. Total storage usage drops from 215MB to 184.1mb.

The data source is cpu metrics from tsbs data sets. Around 8.6M docs and 1000 time series. 10 dimension and 10 metric fields. See collapsed sections for more details.

Baseline results (main branch)
name size relative
<total> 215.0mb 100.00%
<docvalues> 106.6mb 49.58%
<points> 58.4mb 27.16%
_seq_no 58.1mb 27.00%
<inverted_index> 50.0mb 23.26%
<metrics> 48.6mb 22.60%
_id 44.5mb 20.71%
<dimensions> 36.0mb 16.72%
<dimensions><docvalues> 30.5mb 14.16%
@timestamp 25.9mb 12.05%
hostname 13.2mb 6.12%
rack 8.9mb 4.15%
<dimensions><other> 5.5mb 2.56%
service 4.9mb 2.30%
usage_idle 4.9mb 2.27%
usage_softirq 4.9mb 2.27%
usage_irq 4.9mb 2.27%
usage_guest_nice 4.9mb 2.26%
usage_steal 4.9mb 2.26%
usage_user 4.9mb 2.26%
usage_nice 4.8mb 2.25%
usage_guest 4.8mb 2.25%
usage_iowait 4.8mb 2.25%
usage_system 4.8mb 2.25%
team 2.2mb 1.01%
_tsid 2.0mb 0.93%
os 1.8mb 0.84%
service_environment 1.8mb 0.84%
service_version 1.2mb 0.54%
datacenter 910.7kb 0.41%
region 737.5kb 0.33%
arch 383.2kb 0.17%

Note that names with < prefix and > are combination fields. For example <docvalues> is all storage for docvalues fields, and <dimensions> storage for all dimension fields

Contender results (this PR)
name size relative
<total> 184.1mb 100.00%
<docvalues> 75.7mb 41.12%
<points> 58.4mb 31.71%
_seq_no 58.1mb 31.53%
<inverted_index> 50.0mb 27.17%
<metrics> 48.6mb 26.39%
_id 44.5mb 24.18%
@timestamp 25.9mb 14.07%
<dimensions> 6.8mb 3.69%
<dimensions><other> 5.5mb 2.99%
usage_idle 4.9mb 2.65%
usage_softirq 4.9mb 2.65%
usage_irq 4.9mb 2.65%
usage_guest_nice 4.9mb 2.64%
usage_steal 4.9mb 2.64%
usage_user 4.9mb 2.64%
usage_nice 4.8mb 2.63%
usage_guest 4.8mb 2.63%
usage_iowait 4.8mb 2.63%
usage_system 4.8mb 2.63%
<dimensions><docvalues> 1.3mb 0.70%
hostname 1.0mb 0.55%
rack 899.1kb 0.48%
service 753.1kb 0.40%
team 685.0kb 0.36%
service_environment 644.8kb 0.34%
os 642.1kb 0.34%
datacenter 627.7kb 0.33%
region 602.5kb 0.32%
service_version 596.2kb 0.32%
arch 454.4kb 0.24%
_tsid 267.4kb 0.14%

@martijnvg
Copy link
Member

Oops, my branch was somehow out of date 🤦 ..., I will re-run the contender run and update the comment., which explains why I didn't see any difference for _tsid field.

@martijnvg
Copy link
Member

I've updated the contender run. The _tsid field is now also nicely compressed!

@martijnvg martijnvg requested review from martijnvg and removed request for salvatore-campagna February 2, 2024 16:11
@martijnvg
Copy link
Member

I also reran the tsdb track with both main as baseline and this pr as contender.
The total store size dropped from 5.3GB to 4.6GB. I also did an analysis on a field by field basis and most of the fields benefit from the change in this PR.

However there are a few fields that are actually larger. The most significant are:fields.cluster, agent.type, event.module, service.type, agent.version, ecs.version. Which all grew from 1mb to 1.9mb (an increase of 81%).

I suspect these are fields with one distinct value and aren't the fields we should optimise for.
So my thinking is that this isn't an issue that blocks merging this change.

Comparison a field by field basis sorted by relative improvement
field name baseline contender diff
kubernetes.volume.name 10.1mb 1.2mb -88.12%
kubernetes.labels.kubernetes_io/hostname 709.8kb 90.3kb -87.27%
kubernetes.container.start_time 15.1mb 2.7mb -82.19%
kubernetes.pod.name 112.5mb 20.3mb -81.90%
kubernetes.namespace 51.7mb 9.9mb -80.78%
kubernetes.pod.start_time 15.2mb 2.9mb -80.68%
kubernetes.pod.uid 93mb 20.1mb -78.34%
kubernetes.container.image 38.6mb 8.5mb -77.77%
kubernetes.container.name 37.4mb 8.8mb -76.44%
kubernetes.container.id 70mb 16.6mb -76.21%
container.id 70.2mb 16.8mb -76.01%
kubernetes.node.name 42.8mb 11.1mb -74.06%
kubernetes.system.start_time 1.5mb 424.2kb -73.73%
kubernetes.system.container 419.7kb 120kb -71.40%
_tsid 33.3mb 9.8mb -70.51%
kubernetes.labels.job-name 60.2mb 21.5mb -64.24%
kubernetes.labels.controller-uid 61.6mb 22.7mb -63.14%
kubernetes.node.start_time 636.1kb 239.3kb -62.37%
kubernetes.event.metadata.namespace 844.4kb 320.8kb -62.00%
kubernetes.labels.app 27.1mb 13.4mb -50.60%
kubernetes.replicaset.name 15.2mb 8.7mb -42.67%
kubernetes.labels.pod-template-hash 15.2mb 8.7mb -42.67%
kubernetes.event.type 161.8kb 92.9kb -42.57%
kubernetes.labels.statefulset_kubernetes_io/pod-name 2.6mb 1.6mb -37.59%
kubernetes.labels.controller-revision-hash 9.2mb 5.9mb -35.63%
kubernetes.labels.release 11.3mb 7.3mb -35.56%
kubernetes.pod.status.phase 3.2mb 2.1mb -33.17%
kubernetes.container.status.reason 17.9mb 12.6mb -29.75%
kubernetes.statefulset.name 2.2mb 1.6mb -29.11%
kubernetes.labels.app_kubernetes_io/name 1.8mb 1.3mb -26.98%
kubernetes.labels.app_kubernetes_io/instance 1.8mb 1.3mb -25.82%
kubernetes.container.status.phase 10mb 7.5mb -25.34%
metricset.name 11mb 8.5mb -22.27%
kubernetes.pod.status.ready 2.6mb 2mb -20.86%
kubernetes.event.involved_object.api_version 555.4kb 445.1kb -19.86%
agent.hostname 184.5mb 148.7mb -19.40%
host.name 184.5mb 148.7mb -19.40%
agent.id 184.3mb 148.6mb -19.40%
agent.ephemeral_id 188.1mb 152.4mb -18.96%
kubernetes.labels.github_account 8.9mb 7.6mb -14.84%
kubernetes.event.reason 1.2mb 1mb -14.67%
kubernetes.labels.chart 1.1mb 1mb -13.35%
kubernetes.event.timestamp.first_occurrence 4mb 3.4mb -13.13%
kubernetes.labels.component 2.2mb 2mb -11.81%
kubernetes.labels.k8s-app 765kb 681.4kb -10.93%
kubernetes.event.metadata.timestamp.created 3.8mb 3.5mb -9.53%
kubernetes.event.metadata.name 3.3mb 3mb -8.95%
kubernetes.event.metadata.self_link 3.3mb 3mb -8.92%
kubernetes.labels.app_kubernetes_io/component 109.9kb 100.3kb -8.70%
kubernetes.labels.io_kompose_service 112.7kb 103.2kb -8.48%
kubernetes.labels.pod-template-generation 4.9mb 4.5mb -8.38%
kubernetes.event.metadata.resource_version 3.3mb 3mb -7.64%
kubernetes.event.timestamp.last_occurrence 3.9mb 3.6mb -7.40%
kubernetes.event.involved_object.kind 577.7kb 543.3kb -5.94%
service.address 7.1mb 6.7mb -5.83%
kubernetes.labels.name 138.4kb 131.6kb -4.88%
kubernetes.event.involved_object.name 2.3mb 2.2mb -4.66%
kubernetes.labels.logtype 6.7mb 6.4mb -3.83%
kubernetes.labels.helm_sh/chart 105.2kb 101.2kb -3.82%
kubernetes.event.metadata.uid 9.4mb 9.1mb -3.15%
kubernetes.event.involved_object.resource_version 2.3mb 2.2mb -2.47%
kubernetes.event.involved_object.uid 4.9mb 4.8mb -2.28%
event.duration 1.1gb 1.1gb -1.37%
kubernetes.labels.tier 2mb 2mb -1.25%
kubernetes.labels.heritage 789.6kb 783.5kb -0.78%
_seq_no 950.6mb 950.6mb -0.00%
_field_names 17.3kb 17.3kb 0.00%
_id 564.4mb 564.4mb 0.00%
kubernetes.container.cpu.limit.cores 12.7mb 12.7mb 0.00%
kubernetes.container.cpu.request.cores 13.5mb 13.5mb 0.00%
kubernetes.container.cpu.usage.core.ns 19.9mb 19.9mb 0.00%
kubernetes.container.cpu.usage.limit.pct 6.2mb 6.2mb 0.00%
kubernetes.container.cpu.usage.nanocores 16.5mb 16.5mb 0.00%
kubernetes.container.cpu.usage.node.pct 4.7mb 4.7mb 0.00%
kubernetes.container.logs.available.bytes 7.2mb 7.2mb 0.00%
kubernetes.container.logs.capacity.bytes 920.1kb 920.1kb 0.00%
kubernetes.container.logs.inodes.count 841.3kb 841.3kb 0.00%
kubernetes.container.logs.inodes.free 3.4mb 3.4mb 0.00%
kubernetes.container.logs.inodes.used 3.4mb 3.4mb 0.00%
kubernetes.container.logs.used.bytes 1.6mb 1.6mb 0.00%
kubernetes.container.memory.available.bytes 4mb 4mb 0.00%
kubernetes.container.memory.limit.bytes 13.3mb 13.3mb 0.00%
kubernetes.container.memory.majorpagefaults 743.8kb 743.8kb 0.00%
kubernetes.container.memory.pagefaults 3.9mb 3.9mb 0.00%
kubernetes.container.memory.request.bytes 13.4mb 13.4mb 0.00%
kubernetes.container.memory.rss.bytes 4.6mb 4.6mb 0.00%
kubernetes.container.memory.usage.bytes 4.9mb 4.9mb 0.00%
kubernetes.container.memory.usage.limit.pct 6.2mb 6.2mb 0.00%
kubernetes.container.memory.usage.node.pct 3.7mb 3.7mb 0.00%
kubernetes.container.memory.workingset.bytes 4.8mb 4.8mb 0.00%
kubernetes.container.rootfs.available.bytes 7.2mb 7.2mb 0.00%
kubernetes.container.rootfs.capacity.bytes 920.1kb 920.1kb 0.00%
kubernetes.container.rootfs.inodes.used 814.8kb 814.8kb 0.00%
kubernetes.container.rootfs.used.bytes 1.1mb 1.1mb 0.00%
kubernetes.container.status.ready 16.1mb 16.1mb 0.00%
kubernetes.container.status.restarts 10.4mb 10.4mb 0.00%
kubernetes.event.count 93.2kb 93.2kb 0.00%
kubernetes.node.cpu.allocatable.cores 138.7kb 138.7kb 0.00%
kubernetes.node.cpu.capacity.cores 125.7kb 125.7kb 0.00%
kubernetes.node.cpu.usage.core.ns 2.2mb 2.2mb 0.00%
kubernetes.node.cpu.usage.nanocores 1.7mb 1.7mb 0.00%
kubernetes.node.fs.available.bytes 653.9kb 653.9kb 0.00%
kubernetes.node.fs.capacity.bytes 139kb 139kb 0.00%
kubernetes.node.fs.inodes.count 132.3kb 132.3kb 0.00%
kubernetes.node.fs.inodes.free 345.3kb 345.3kb 0.00%
kubernetes.node.fs.inodes.used 344.2kb 344.2kb 0.00%
kubernetes.node.fs.used.bytes 655.6kb 655.6kb 0.00%
kubernetes.node.memory.allocatable.bytes 142.5kb 142.5kb 0.00%
kubernetes.node.memory.available.bytes 921.8kb 921.8kb 0.00%
kubernetes.node.memory.capacity.bytes 142.3kb 142.3kb 0.00%
kubernetes.node.memory.majorpagefaults 129.2kb 129.2kb 0.00%
kubernetes.node.memory.pagefaults 258.9kb 258.9kb 0.00%
kubernetes.node.memory.rss.bytes 915.2kb 915.2kb 0.00%
kubernetes.node.memory.usage.bytes 933.5kb 933.5kb 0.00%
kubernetes.node.memory.workingset.bytes 921.3kb 921.3kb 0.00%
kubernetes.node.network.rx.bytes 1.5mb 1.5mb 0.00%
kubernetes.node.network.rx.errors 119kb 119kb 0.00%
kubernetes.node.network.tx.bytes 1.4mb 1.4mb 0.00%
kubernetes.node.network.tx.errors 119kb 119kb 0.00%
kubernetes.node.pod.allocatable.total 125.5kb 125.5kb 0.00%
kubernetes.node.pod.capacity.total 125.5kb 125.5kb 0.00%
kubernetes.node.runtime.imagefs.available.bytes 653.9kb 653.9kb 0.00%
kubernetes.node.runtime.imagefs.capacity.bytes 139kb 139kb 0.00%
kubernetes.node.runtime.imagefs.used.bytes 174.2kb 174.2kb 0.00%
kubernetes.node.status.unschedulable 133kb 133kb 0.00%
kubernetes.pod.cpu.usage.limit.pct 7.1mb 7.1mb 0.00%
kubernetes.pod.cpu.usage.nanocores 15.8mb 15.8mb 0.00%
kubernetes.pod.cpu.usage.node.pct 5.7mb 5.7mb 0.00%
kubernetes.pod.host_ip 3mb 3mb 0.00%
kubernetes.pod.ip 15.5mb 15.5mb 0.00%
kubernetes.pod.memory.available.bytes 4.8mb 4.8mb 0.00%
kubernetes.pod.memory.major_page_faults 1.4mb 1.4mb 0.00%
kubernetes.pod.memory.page_faults 4.6mb 4.6mb 0.00%
kubernetes.pod.memory.rss.bytes 5.3mb 5.3mb 0.00%
kubernetes.pod.memory.usage.bytes 5.6mb 5.6mb 0.00%
kubernetes.pod.memory.usage.limit.pct 7.6mb 7.6mb 0.00%
kubernetes.pod.memory.usage.node.pct 5.2mb 5.2mb 0.00%
kubernetes.pod.memory.working_set.bytes 5.6mb 5.6mb 0.00%
kubernetes.pod.network.rx.bytes 11.4mb 11.4mb 0.00%
kubernetes.pod.network.rx.errors 1.3mb 1.3mb 0.00%
kubernetes.pod.network.tx.bytes 11.1mb 11.1mb 0.00%
kubernetes.pod.network.tx.errors 1.3mb 1.3mb 0.00%
kubernetes.system.cpu.usage.core.ns 5.7mb 5.7mb 0.00%
kubernetes.system.cpu.usage.nanocores 4.9mb 4.9mb 0.00%
kubernetes.system.memory.majorpagefaults 54.6kb 54.6kb 0.00%
kubernetes.system.memory.pagefaults 815kb 815kb 0.00%
kubernetes.system.memory.rss.bytes 1.7mb 1.7mb 0.00%
kubernetes.system.memory.usage.bytes 1.8mb 1.8mb 0.00%
kubernetes.system.memory.workingset.bytes 1.8mb 1.8mb 0.00%
kubernetes.volume.fs.available.bytes 1.6mb 1.6mb 0.00%
kubernetes.volume.fs.capacity.bytes 1mb 1mb 0.00%
kubernetes.volume.fs.inodes.count 610.7kb 610.7kb 0.00%
kubernetes.volume.fs.inodes.free 907.2kb 907.2kb 0.00%
kubernetes.volume.fs.inodes.used 374.5kb 374.5kb 0.00%
kubernetes.volume.fs.used.bytes 725.8kb 725.8kb 0.00%
metricset.period 34mb 34mb 0.00%
@timestamp 650.7mb 650.7mb 0.00%
kubernetes.event.message 5.3mb 5.3mb 0.00%
kubernetes.labels.app_kubernetes_io/managed-by 92.7kb 94.5kb 1.94%
kubernetes.node.status.ready 149.3kb 153.4kb 2.75%
kubernetes.pod.status.scheduled 1.7mb 1.8mb 4.28%
kubernetes.labels.beta_kubernetes_io/instance-type 67.2kb 72.2kb 7.49%
event.dataset 6.8mb 7.6mb 11.55%
kubernetes.labels.beta_kubernetes_io/arch 48.7kb 55.3kb 13.56%
kubernetes.labels.beta_kubernetes_io/os 48.7kb 55.3kb 13.56%
kubernetes.labels.kubernetes_io/arch 48.7kb 55.3kb 13.56%
kubernetes.labels.kubernetes_io/os 48.7kb 55.3kb 13.56%
kubernetes.event.metadata.generate_name 34.1kb 39.6kb 16.28%
container.runtime 3.3mb 3.9mb 19.26%
fields.cluster 1mb 1.9mb 81.34%
agent.type 1mb 1.9mb 81.34%
event.module 1mb 1.9mb 81.34%
service.type 1mb 1.9mb 81.34%
agent.version 1mb 1.9mb 81.35%
ecs.version 1mb 1.9mb 81.35%

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good. I was thinking that we could do something about fields with one unique value. I think we can optimise these cases without making the format more difficult. Like this:

Subject: [PATCH] special case 1 value fields
---
Index: server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesProducer.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesProducer.java b/server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesProducer.java
--- a/server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesProducer.java	(revision bbb141902e88f2c5a656b3cb08baf19e84e45f46)
+++ b/server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesProducer.java	(date 1707207874949)
@@ -600,11 +600,14 @@
         entry.numValues = meta.readLong();
         if (entry.numValues > 0) {
             final int indexBlockShift = meta.readInt();
-            entry.indexMeta = DirectMonotonicReader.loadMeta(
-                meta,
-                1 + ((entry.numValues - 1) >>> ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SHIFT),
-                indexBlockShift
-            );
+            // Special case, -1 means there are no blocks, so no need to load the metadata for it
+            if (indexBlockShift != -1) {
+                entry.indexMeta = DirectMonotonicReader.loadMeta(
+                    meta,
+                    1 + ((entry.numValues - 1) >>> ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SHIFT),
+                    indexBlockShift
+                );
+            }
             entry.indexOffset = meta.readLong();
             entry.indexLength = meta.readLong();
             entry.valuesOffset = meta.readLong();
@@ -688,6 +691,94 @@
             return DocValues.emptyNumeric();
         }
 
+        if (maxOrd == 1) {
+            // Special case for maxOrd 1, no need to read blocks and use ordinal 0 as only value
+            if (entry.docsWithFieldOffset == -1) {
+                // Special case when there is one unique value
+                return new NumericDocValues() {
+
+                    private final int maxDoc = ES87TSDBDocValuesProducer.this.maxDoc;
+                    private int doc = -1;
+
+                    @Override
+                    public long longValue() {
+                        // Only one ordinal!
+                        return 0L;
+                    }
+
+                    @Override
+                    public int docID() {
+                        return doc;
+                    }
+
+                    @Override
+                    public int nextDoc() throws IOException {
+                        return advance(doc + 1);
+                    }
+
+                    @Override
+                    public int advance(int target) throws IOException {
+                        if (target >= maxDoc) {
+                            return doc = NO_MORE_DOCS;
+                        }
+                        return doc = target;
+                    }
+
+                    @Override
+                    public boolean advanceExact(int target) {
+                        doc = target;
+                        return true;
+                    }
+
+                    @Override
+                    public long cost() {
+                        return maxDoc;
+                    }
+                };
+            } else {
+                final IndexedDISI disi = new IndexedDISI(
+                    data,
+                    entry.docsWithFieldOffset,
+                    entry.docsWithFieldLength,
+                    entry.jumpTableEntryCount,
+                    entry.denseRankPower,
+                    entry.numValues
+                );
+                return new NumericDocValues() {
+
+                    @Override
+                    public int advance(int target) throws IOException {
+                        return disi.advance(target);
+                    }
+
+                    @Override
+                    public boolean advanceExact(int target) throws IOException {
+                        return disi.advanceExact(target);
+                    }
+
+                    @Override
+                    public int nextDoc() throws IOException {
+                        return disi.nextDoc();
+                    }
+
+                    @Override
+                    public int docID() {
+                        return disi.docID();
+                    }
+
+                    @Override
+                    public long cost() {
+                        return disi.cost();
+                    }
+
+                    @Override
+                    public long longValue() {
+                        return 0L;
+                    }
+                };
+            }
+        }
+
         // NOTE: we could make this a bit simpler by reusing #getValues but this
         // makes things slower.
 
Index: server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesConsumer.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesConsumer.java b/server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesConsumer.java
--- a/server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesConsumer.java	(revision bbb141902e88f2c5a656b3cb08baf19e84e45f46)
+++ b/server/src/main/java/org/elasticsearch/index/codec/tsdb/ES87TSDBDocValuesConsumer.java	(date 1707207874958)
@@ -127,7 +127,8 @@
         meta.writeLong(numValues);
 
         if (numValues > 0) {
-            meta.writeInt(ES87TSDBDocValuesFormat.DIRECT_MONOTONIC_BLOCK_SHIFT);
+            // Special case ofr maxOrd of 1, signal -1 that no blocks will be written
+            meta.writeInt(maxOrd != 1 ? ES87TSDBDocValuesFormat.DIRECT_MONOTONIC_BLOCK_SHIFT : -1);
             final ByteBuffersDataOutput indexOut = new ByteBuffersDataOutput();
             final DirectMonotonicWriter indexWriter = DirectMonotonicWriter.getInstance(
                 meta,
@@ -136,41 +137,45 @@
                 ES87TSDBDocValuesFormat.DIRECT_MONOTONIC_BLOCK_SHIFT
             );
 
-            final long[] buffer = new long[ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE];
-            int bufferSize = 0;
-            final long valuesDataOffset = data.getFilePointer();
-            final ES87TSDBDocValuesEncoder encoder = new ES87TSDBDocValuesEncoder();
-
-            values = valuesProducer.getSortedNumeric(field);
-            final int bitsPerOrd = maxOrd >= 0 ? PackedInts.bitsRequired(maxOrd - 1) : -1;
-            for (int doc = values.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = values.nextDoc()) {
-                final int count = values.docValueCount();
-                for (int i = 0; i < count; ++i) {
-                    buffer[bufferSize++] = values.nextValue();
-                    if (bufferSize == ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE) {
-                        indexWriter.add(data.getFilePointer() - valuesDataOffset);
-                        if (maxOrd >= 0) {
-                            encoder.encodeOrdinals(buffer, data, bitsPerOrd);
-                        } else {
-                            encoder.encode(buffer, data);
-                        }
-                        bufferSize = 0;
-                    }
-                }
-            }
-            if (bufferSize > 0) {
-                indexWriter.add(data.getFilePointer() - valuesDataOffset);
-                // Fill unused slots in the block with zeroes rather than junk
-                Arrays.fill(buffer, bufferSize, ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE, 0L);
-                if (maxOrd >= 0) {
-                    encoder.encodeOrdinals(buffer, data, bitsPerOrd);
-                } else {
-                    encoder.encode(buffer, data);
+            final long valuesDataOffset = data.getFilePointer();
+            // Special case ofr maxOrd of 1, skip writing the blocks
+            if (maxOrd != 1) {
+                final long[] buffer = new long[ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE];
+                int bufferSize = 0;
+                final ES87TSDBDocValuesEncoder encoder = new ES87TSDBDocValuesEncoder();
+                values = valuesProducer.getSortedNumeric(field);
+                final int bitsPerOrd = maxOrd >= 0 ? PackedInts.bitsRequired(maxOrd - 1) : -1;
+                for (int doc = values.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = values.nextDoc()) {
+                    final int count = values.docValueCount();
+                    for (int i = 0; i < count; ++i) {
+                        buffer[bufferSize++] = values.nextValue();
+                        if (bufferSize == ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE) {
+                            indexWriter.add(data.getFilePointer() - valuesDataOffset);
+                            if (maxOrd >= 0) {
+                                encoder.encodeOrdinals(buffer, data, bitsPerOrd);
+                            } else {
+                                encoder.encode(buffer, data);
+                            }
+                            bufferSize = 0;
+                        }
+                    }
+                }
+                if (bufferSize > 0) {
+                    indexWriter.add(data.getFilePointer() - valuesDataOffset);
+                    // Fill unused slots in the block with zeroes rather than junk
+                    Arrays.fill(buffer, bufferSize, ES87TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE, 0L);
+                    if (maxOrd >= 0) {
+                        encoder.encodeOrdinals(buffer, data, bitsPerOrd);
+                    } else {
+                        encoder.encode(buffer, data);
+                    }
                 }
             }
 
             final long valuesDataLength = data.getFilePointer() - valuesDataOffset;
-            indexWriter.finish();
+            if (maxOrd != 1) {
+                indexWriter.finish();
+            }
             final long indexDataOffset = data.getFilePointer();
             data.copyBytes(indexOut.toDataInput(), indexOut.size());
             meta.writeLong(indexDataOffset);

Basically maxOrd 1 is used as a signal not to write the blocks. The change is small (Most code is regarding the NumericDocValues implementations) and the file format complexity stays the same. This way most of the fields that regressed in the tsdb benchmark run, use the same storage as in the baseline run.

@felixbarny
Copy link
Member Author

Sounds good to me. Could you push these changes to the PR?

… has exactly one value and use ordinal zero as constant. This could be done without changing the core format and without making the format more complex.
@martijnvg
Copy link
Member

Could you push these changes to the PR

Yes, I've done this.

@martijnvg
Copy link
Member

With the latest changes the the field comparison for the tsdb track now looks like this:

field name baseline contender diff
kubernetes.volume.name 10.1mb 1.2mb -88.12%
kubernetes.labels.kubernetes_io/hostname 709.8kb 90.3kb -87.27%
kubernetes.container.start_time 15.1mb 2.7mb -82.19%
kubernetes.pod.name 112.5mb 20.3mb -81.90%
kubernetes.namespace 51.7mb 9.9mb -80.78%
kubernetes.pod.start_time 15.2mb 2.9mb -80.68%
kubernetes.pod.uid 93mb 20.1mb -78.34%
kubernetes.container.image 38.6mb 8.5mb -77.77%
kubernetes.container.name 37.4mb 8.8mb -76.44%
kubernetes.container.id 70mb 16.6mb -76.21%
container.id 70.2mb 16.8mb -76.01%
kubernetes.node.name 42.8mb 11.1mb -74.06%
kubernetes.system.start_time 1.5mb 424.2kb -73.73%
kubernetes.system.container 419.7kb 120kb -71.40%
_tsid 33.3mb 9.8mb -70.51%
kubernetes.labels.job-name 60.2mb 21.5mb -64.24%
kubernetes.labels.controller-uid 61.6mb 22.7mb -63.14%
kubernetes.node.start_time 636.1kb 239.3kb -62.37%
kubernetes.event.metadata.namespace 844.4kb 320.8kb -62.00%
kubernetes.labels.app 27.1mb 13.4mb -50.60%
kubernetes.replicaset.name 15.2mb 8.7mb -42.67%
kubernetes.labels.pod-template-hash 15.2mb 8.7mb -42.67%
kubernetes.event.type 161.8kb 92.9kb -42.57%
kubernetes.labels.statefulset_kubernetes_io/pod-name 2.6mb 1.6mb -37.59%
kubernetes.labels.controller-revision-hash 9.2mb 5.9mb -35.63%
kubernetes.labels.release 11.3mb 7.3mb -35.56%
kubernetes.pod.status.phase 3.2mb 2.1mb -33.17%
kubernetes.container.status.reason 17.9mb 12.6mb -29.75%
kubernetes.statefulset.name 2.2mb 1.6mb -29.11%
kubernetes.labels.app_kubernetes_io/name 1.8mb 1.3mb -26.98%
kubernetes.labels.app_kubernetes_io/instance 1.8mb 1.3mb -25.82%
kubernetes.container.status.phase 10mb 7.5mb -25.34%
metricset.name 11mb 8.5mb -22.27%
kubernetes.pod.status.ready 2.6mb 2mb -20.86%
kubernetes.event.involved_object.api_version 555.4kb 445.1kb -19.86%
agent.hostname 184.5mb 148.7mb -19.40%
host.name 184.5mb 148.7mb -19.40%
agent.id 184.3mb 148.6mb -19.40%
agent.ephemeral_id 188.1mb 152.4mb -18.96%
kubernetes.labels.github_account 8.9mb 7.6mb -14.84%
kubernetes.event.reason 1.2mb 1mb -14.67%
kubernetes.labels.chart 1.1mb 1mb -13.35%
kubernetes.event.timestamp.first_occurrence 4mb 3.4mb -13.13%
kubernetes.labels.component 2.2mb 2mb -11.81%
kubernetes.labels.k8s-app 765kb 681.4kb -10.93%
kubernetes.event.metadata.timestamp.created 3.8mb 3.5mb -9.53%
kubernetes.event.metadata.name 3.3mb 3mb -8.95%
kubernetes.event.metadata.self_link 3.3mb 3mb -8.92%
kubernetes.labels.app_kubernetes_io/component 109.9kb 100.3kb -8.70%
kubernetes.labels.io_kompose_service 112.7kb 103.2kb -8.48%
kubernetes.labels.pod-template-generation 4.9mb 4.5mb -8.38%
kubernetes.event.metadata.resource_version 3.3mb 3mb -7.64%
kubernetes.event.timestamp.last_occurrence 3.9mb 3.6mb -7.40%
kubernetes.event.involved_object.kind 577.7kb 543.3kb -5.94%
service.address 7.1mb 6.7mb -5.83%
kubernetes.labels.name 138.4kb 131.6kb -4.88%
kubernetes.event.involved_object.name 2.3mb 2.2mb -4.66%
kubernetes.labels.logtype 6.7mb 6.4mb -3.83%
kubernetes.labels.helm_sh/chart 105.2kb 101.2kb -3.82%
kubernetes.event.metadata.uid 9.4mb 9.1mb -3.15%
kubernetes.event.involved_object.resource_version 2.3mb 2.2mb -2.47%
kubernetes.event.involved_object.uid 4.9mb 4.8mb -2.28%
event.duration 1.1gb 1.1gb -1.37%
kubernetes.labels.tier 2mb 2mb -1.25%
kubernetes.labels.heritage 789.6kb 783.5kb -0.78%
_seq_no 950.6mb 950.6mb -0.00%
_field_names 17.3kb 17.3kb 0.00%
_id 564.4mb 564.4mb 0.00%
agent.type 1mb 1mb 0.00%
agent.version 1mb 1mb 0.00%
container.runtime 3.3mb 3.3mb 0.00%
ecs.version 1mb 1mb 0.00%
event.module 1mb 1mb 0.00%
fields.cluster 1mb 1mb 0.00%
kubernetes.container.cpu.limit.cores 12.7mb 12.7mb 0.00%
kubernetes.container.cpu.request.cores 13.5mb 13.5mb 0.00%
kubernetes.container.cpu.usage.core.ns 19.9mb 19.9mb 0.00%
kubernetes.container.cpu.usage.limit.pct 6.2mb 6.2mb 0.00%
kubernetes.container.cpu.usage.nanocores 16.5mb 16.5mb 0.00%
kubernetes.container.cpu.usage.node.pct 4.7mb 4.7mb 0.00%
kubernetes.container.logs.available.bytes 7.2mb 7.2mb 0.00%
kubernetes.container.logs.capacity.bytes 920.1kb 920.1kb 0.00%
kubernetes.container.logs.inodes.count 841.3kb 841.3kb 0.00%
kubernetes.container.logs.inodes.free 3.4mb 3.4mb 0.00%
kubernetes.container.logs.inodes.used 3.4mb 3.4mb 0.00%
kubernetes.container.logs.used.bytes 1.6mb 1.6mb 0.00%
kubernetes.container.memory.available.bytes 4mb 4mb 0.00%
kubernetes.container.memory.limit.bytes 13.3mb 13.3mb 0.00%
kubernetes.container.memory.majorpagefaults 743.8kb 743.8kb 0.00%
kubernetes.container.memory.pagefaults 3.9mb 3.9mb 0.00%
kubernetes.container.memory.request.bytes 13.4mb 13.4mb 0.00%
kubernetes.container.memory.rss.bytes 4.6mb 4.6mb 0.00%
kubernetes.container.memory.usage.bytes 4.9mb 4.9mb 0.00%
kubernetes.container.memory.usage.limit.pct 6.2mb 6.2mb 0.00%
kubernetes.container.memory.usage.node.pct 3.7mb 3.7mb 0.00%
kubernetes.container.memory.workingset.bytes 4.8mb 4.8mb 0.00%
kubernetes.container.rootfs.available.bytes 7.2mb 7.2mb 0.00%
kubernetes.container.rootfs.capacity.bytes 920.1kb 920.1kb 0.00%
kubernetes.container.rootfs.inodes.used 814.8kb 814.8kb 0.00%
kubernetes.container.rootfs.used.bytes 1.1mb 1.1mb 0.00%
kubernetes.container.status.ready 16.1mb 16.1mb 0.00%
kubernetes.container.status.restarts 10.4mb 10.4mb 0.00%
kubernetes.event.count 93.2kb 93.2kb 0.00%
kubernetes.event.metadata.generate_name 34.1kb 34.1kb 0.00%
kubernetes.labels.app_kubernetes_io/managed-by 92.7kb 92.7kb 0.00%
kubernetes.labels.beta_kubernetes_io/arch 48.7kb 48.7kb 0.00%
kubernetes.labels.beta_kubernetes_io/os 48.7kb 48.7kb 0.00%
kubernetes.labels.kubernetes_io/arch 48.7kb 48.7kb 0.00%
kubernetes.labels.kubernetes_io/os 48.7kb 48.7kb 0.00%
kubernetes.node.cpu.allocatable.cores 138.7kb 138.7kb 0.00%
kubernetes.node.cpu.capacity.cores 125.7kb 125.7kb 0.00%
kubernetes.node.cpu.usage.core.ns 2.2mb 2.2mb 0.00%
kubernetes.node.cpu.usage.nanocores 1.7mb 1.7mb 0.00%
kubernetes.node.fs.available.bytes 653.9kb 653.9kb 0.00%
kubernetes.node.fs.capacity.bytes 139kb 139kb 0.00%
kubernetes.node.fs.inodes.count 132.3kb 132.3kb 0.00%
kubernetes.node.fs.inodes.free 345.3kb 345.3kb 0.00%
kubernetes.node.fs.inodes.used 344.2kb 344.2kb 0.00%
kubernetes.node.fs.used.bytes 655.6kb 655.6kb 0.00%
kubernetes.node.memory.allocatable.bytes 142.5kb 142.5kb 0.00%
kubernetes.node.memory.available.bytes 921.8kb 921.8kb 0.00%
kubernetes.node.memory.capacity.bytes 142.3kb 142.3kb 0.00%
kubernetes.node.memory.majorpagefaults 129.2kb 129.2kb 0.00%
kubernetes.node.memory.pagefaults 258.9kb 258.9kb 0.00%
kubernetes.node.memory.rss.bytes 915.2kb 915.2kb 0.00%
kubernetes.node.memory.usage.bytes 933.5kb 933.5kb 0.00%
kubernetes.node.memory.workingset.bytes 921.3kb 921.3kb 0.00%
kubernetes.node.network.rx.bytes 1.5mb 1.5mb 0.00%
kubernetes.node.network.rx.errors 119kb 119kb 0.00%
kubernetes.node.network.tx.bytes 1.4mb 1.4mb 0.00%
kubernetes.node.network.tx.errors 119kb 119kb 0.00%
kubernetes.node.pod.allocatable.total 125.5kb 125.5kb 0.00%
kubernetes.node.pod.capacity.total 125.5kb 125.5kb 0.00%
kubernetes.node.runtime.imagefs.available.bytes 653.9kb 653.9kb 0.00%
kubernetes.node.runtime.imagefs.capacity.bytes 139kb 139kb 0.00%
kubernetes.node.runtime.imagefs.used.bytes 174.2kb 174.2kb 0.00%
kubernetes.node.status.unschedulable 133kb 133kb 0.00%
kubernetes.pod.cpu.usage.limit.pct 7.1mb 7.1mb 0.00%
kubernetes.pod.cpu.usage.nanocores 15.8mb 15.8mb 0.00%
kubernetes.pod.cpu.usage.node.pct 5.7mb 5.7mb 0.00%
kubernetes.pod.host_ip 3mb 3mb 0.00%
kubernetes.pod.ip 15.5mb 15.5mb 0.00%
kubernetes.pod.memory.available.bytes 4.8mb 4.8mb 0.00%
kubernetes.pod.memory.major_page_faults 1.4mb 1.4mb 0.00%
kubernetes.pod.memory.page_faults 4.6mb 4.6mb 0.00%
kubernetes.pod.memory.rss.bytes 5.3mb 5.3mb 0.00%
kubernetes.pod.memory.usage.bytes 5.6mb 5.6mb 0.00%
kubernetes.pod.memory.usage.limit.pct 7.6mb 7.6mb 0.00%
kubernetes.pod.memory.usage.node.pct 5.2mb 5.2mb 0.00%
kubernetes.pod.memory.working_set.bytes 5.6mb 5.6mb 0.00%
kubernetes.pod.network.rx.bytes 11.4mb 11.4mb 0.00%
kubernetes.pod.network.rx.errors 1.3mb 1.3mb 0.00%
kubernetes.pod.network.tx.bytes 11.1mb 11.1mb 0.00%
kubernetes.pod.network.tx.errors 1.3mb 1.3mb 0.00%
kubernetes.system.cpu.usage.core.ns 5.7mb 5.7mb 0.00%
kubernetes.system.cpu.usage.nanocores 4.9mb 4.9mb 0.00%
kubernetes.system.memory.majorpagefaults 54.6kb 54.6kb 0.00%
kubernetes.system.memory.pagefaults 815kb 815kb 0.00%
kubernetes.system.memory.rss.bytes 1.7mb 1.7mb 0.00%
kubernetes.system.memory.usage.bytes 1.8mb 1.8mb 0.00%
kubernetes.system.memory.workingset.bytes 1.8mb 1.8mb 0.00%
kubernetes.volume.fs.available.bytes 1.6mb 1.6mb 0.00%
kubernetes.volume.fs.capacity.bytes 1mb 1mb 0.00%
kubernetes.volume.fs.inodes.count 610.7kb 610.7kb 0.00%
kubernetes.volume.fs.inodes.free 907.2kb 907.2kb 0.00%
kubernetes.volume.fs.inodes.used 374.5kb 374.5kb 0.00%
kubernetes.volume.fs.used.bytes 725.8kb 725.8kb 0.00%
metricset.period 34mb 34mb 0.00%
service.type 1mb 1mb 0.00%
@timestamp 650.7mb 650.7mb 0.00%
kubernetes.event.message 5.3mb 5.3mb 0.00%
kubernetes.node.status.ready 149.3kb 153.4kb 2.75%
kubernetes.pod.status.scheduled 1.7mb 1.8mb 4.28%
kubernetes.labels.beta_kubernetes_io/instance-type 67.2kb 72.2kb 7.49%
event.dataset 6.8mb 7.6mb 11.55%

@felixbarny
Copy link
Member Author

Great! Thanks a lot of the detailed testing and analysis. I suppose this is ready to be merged then?

@felixbarny
Copy link
Member Author

As a next step, maybe we should also think about how to optimize postings if there are runs of consecutive values.

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is ready to be merged then?

Yes!

@martijnvg
Copy link
Member

As a next step, maybe we should also think about how to optimize postings if there are runs of consecutive values.

Yes, we can do a better job here. We can try to compress with a mix of PFOR-delta and binary interpolative coding.

@felixbarny felixbarny added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Feb 6, 2024
@elasticsearchmachine elasticsearchmachine merged commit 0cec48f into elastic:main Feb 6, 2024
15 checks passed
@felixbarny felixbarny deleted the tsdb-dimensions-encoding branch February 6, 2024 10:25
elasticsearchmachine pushed a commit that referenced this pull request Feb 8, 2024
Detects and efficiently encodes cyclic ordinals, as proposed by
@jpountz. This is beneficial for encoding dimensions that are
multivalued, such as host.ip.

A follow-up on #99747
martijnvg added a commit that referenced this pull request Feb 12, 2024
…s. (#105301)

The index needs to be in tsdb mode. All fields will use the tsdb coded, except fields start with a _ (not excluding _tsid).

Before this change relies on MapperService to check whether a field needed to use tsdb doc values codec, but we missed many field types (ip field type, scaled float field type, unsigned long field type, etc.). Instead we wanted to depend on the doc values type in FieldInfo, but that information is not available in PerFieldMapperCodec.

Borrowed the binary doc values implementation from Lucene90DocValuesFormat. This allows it to be used for any doc values field.

Followup on #99747
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) >enhancement external-contributor Pull request authored by a developer outside the Elasticsearch team release highlight :StorageEngine/TSDB You know, for Metrics Team:StorageEngine v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants