自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Asticsearch 8.x 存儲(chǔ)有無壓縮?能壓縮到多少?

存儲(chǔ) 數(shù)據(jù)管理
默認(rèn)值使用 LZ4? 壓縮壓縮存儲(chǔ)的數(shù)據(jù),但這可以設(shè)置為 best_compression?,它使用 DEFLATE 來獲得更高的壓縮率,但會(huì)降低存儲(chǔ)字段的性能。

1、認(rèn)知前提

Elasticsearch 支持壓縮,壓縮方式默認(rèn)為:LZ4 壓縮算法。

具體參見:

The default value compresses stored data with LZ4 compression, but this can be set to best_compression which uses DEFLATE for a higher compression ratio, at the expense of slower stored fields performance.

中文翻譯為:

默認(rèn)值使用 LZ4 壓縮壓縮存儲(chǔ)的數(shù)據(jù),但這可以設(shè)置為 best_compression,它使用 DEFLATE 來獲得更高的壓縮率,但會(huì)降低存儲(chǔ)字段的性能。

https://www.elastic.co/guide/en/elasticsearch/reference/8.14/index-modules.html#index-codec

這里要引申一下,這屬于:靜態(tài)配置,類似:number_of_shard 主分片數(shù),不允許動(dòng)態(tài)修改,除非重建索引。

2、動(dòng)手驗(yàn)證一下壓縮比到底能壓縮多少?

2.1 樣例數(shù)據(jù)準(zhǔn)備

以 kibana_sample_flights 飛行數(shù)據(jù)為例進(jìn)行驗(yàn)證。

圖片圖片

我們直接借助 elasticdump 進(jìn)行導(dǎo)出,以json 存儲(chǔ),作為原始數(shù)據(jù)。

導(dǎo)出實(shí)現(xiàn)參考:

NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \

  --input=https://elastic:@172.121.10.114:9200/kibana_sample_data_flights\

  --output=/www/elasticsearch_0801_20220713/test/flights.json \

  --type=data \

  --input-ca=/www/elasticsearch_0801_20220713/elasticsearch-8.1.0/config/certs/http_ca.crt

導(dǎo)出成功截圖:

圖片圖片

所占存儲(chǔ)空間大?。?/p>

圖片圖片

2.2 Elasticsearch 默認(rèn) LZ4 壓縮算法的存儲(chǔ)大小

2.3 如果修改為:best_compression壓縮后,所占據(jù)存儲(chǔ)空間大小如下

需要修改索引:

PUT kibana_sample_data_flights_ext
{
  "settings": {
    "index.codec": "best_compression"

  },

  "mappings": {

    "properties": {
......省略部分映射描述......

然后,reindex 遷移數(shù)據(jù)。

POST _reindex
{
  "source": {
    "index": "kibana_sample_data_flights"
  },
  "dest": {
    "index": "kibana_sample_data_flights_ext"
  }
}

3、初步結(jié)論

圖片圖片

1)默認(rèn)壓縮LZ4 算法能壓縮到一半!54.77%,能節(jié)省一半的存儲(chǔ)!

新壓縮算法 best_compression 壓縮后,壓縮為原始空間的:35%,也就是能省65%的空間。

壓縮比要求高推薦使用:best_compression。

責(zé)任編輯:武曉燕 來源: 銘毅天下Elasticsearch
相關(guān)推薦

2021-10-12 10:22:33

數(shù)據(jù)庫架構(gòu)技術(shù)

2012-05-03 15:01:24

數(shù)值壓縮

2025-04-29 09:14:00

2024-01-04 07:59:07

Painless腳本數(shù)據(jù)

2023-08-01 08:44:33

ChatGPTPython腳本

2024-01-30 17:37:50

es集群數(shù)據(jù)

2014-07-04 10:37:44

Windows 8.xwindows

2018-08-27 10:54:30

C++壓縮存儲(chǔ)

2014-09-05 14:32:24

操作系統(tǒng)Linux

2018-12-19 13:45:56

Hive實(shí)踐存儲(chǔ)

2010-03-23 09:54:35

好壓壓縮

2010-01-04 09:27:31

Linux壓縮解壓縮命令詳解

2023-10-20 13:12:10

Btrfs壓縮

2009-08-25 09:42:27

Windows 7系統(tǒng)瘦身

2023-12-21 07:30:36

PythonZipfileTarfile

2019-10-11 18:27:18

APK資源壓縮

2023-08-02 07:21:30

工具搜索排序

2023-02-26 13:02:19

AI算法技術(shù)

2018-09-14 16:18:26

Linux壓縮文件應(yīng)用程序
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)