The codec-compression plug-in is developed by Alibaba Cloud Elasticsearch. It supports Brotli and zstd compression algorithms to provide a higher compression ratio for indexes, which significantly reduces index storage costs.
Prerequisites
An Alibaba Cloud Elasticsearch V6.7.0 cluster is created. For more information, see Create an Alibaba Cloud Elasticsearch instance.
ImportantThe codec-compression plug-in is available only in Alibaba Cloud Elasticsearch V6.7.0.
The codec-compression plug-in is installed. The plug-in is automatically installed for new clusters.
To check whether the plug-in is installed, go to the Plug-ins page. If it is not installed, install it manually. For more information, see Install and remove a built-in plug-in.
Background information
The codec-compression plug-in supports Brotli and zstd compression algorithms. It is suitable for scenarios that involve large amounts of data writes or high index storage costs, such as logging and time series data analysis. The following section describes a performance test on the plug-in:
Test environment
Cluster configuration: 3 data nodes, each of which offers 16 vCPUs, 64 GiB of memory, and one 2-TiB standard SSD
Datasets: 74-GiB nyc_taixs of Rally provided by open source Elasticsearch
Index settings: default settings. To consolidate segments after data is written, call the force merge API.
Test results
Compression algorithm
Index size (GiB)
TPS (document/s)
LZ4 (default compression algorithm of Elasticsearch)
35.5
202682
best_compression (DEFLATE)
26.4
181686
Brotli
24.4
182593
zstd
24.6
181393
Test conclusion
Compared with the default LZ4 algorithm, Brotli and zstd achieve a 45% higher compression ratio with the same query performance. However, write performance decreases by 10%. Compared with best_compression (DEFLATE), Brotli and zstd achieve an 8% higher compression ratio with the same write and query performance.
Procedure
Log on to the Kibana console of your Elasticsearch cluster.
For detailed instructions, see Log on to the Kibana console.
In the left menu bar, click Dev Tools.
On the Console tab of the page that appears, run the following commands to specify different compression algorithms for an index:
Brotli
PUT index-1 { "settings": { "index": { "codec": "brotli" } } }zstd
PUT index-1 { "settings": { "index": { "codec": "zstd" } } }