Skip to content

Commit 1d7e7bd

Browse files
authored
Lower zstd blockDocCount for best_speed from 128 to 96 (#112098)
Query latencies are more important for best speed use cases. Zstd stored fields have shown some increase in query latencies when limited number of stored field data is fetched (in case of get by id like queries). By decreasing the blockDocCount we try to reduce these latencies at the cost of using a little bit more storage. Based on the shared results below, setting blockDocCount to 96. Note that zstd is still behind a feature flag and this is the last things we like to tune before removing the feature flag. In all other cases zstd has shown to be the better trade of compared to lz4 and deflate (which get used depending on index.codec setting). After merging this change, we should monitor the nightly benchmarks and see the total effect before removing the feature flag.
1 parent 00a5c6d commit 1d7e7bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

server/src/main/java/org/elasticsearch/index/codec/zstd/Zstd814StoredFieldsFormat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public final class Zstd814StoredFieldsFormat extends Lucene90CompressingStoredFi
4747
public static final String MODE_KEY = Zstd814StoredFieldsFormat.class.getSimpleName() + ".mode";
4848

4949
public enum Mode {
50-
BEST_SPEED(0, BEST_SPEED_BLOCK_SIZE, 128),
50+
BEST_SPEED(0, BEST_SPEED_BLOCK_SIZE, 96),
5151
BEST_COMPRESSION(3, BEST_COMPRESSION_BLOCK_SIZE, 2048);
5252

5353
final int level, blockSizeInBytes, blockDocCount;

server/src/test/java/org/elasticsearch/index/codec/CodecTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void testDefault() throws Exception {
5858
assumeTrue("Only when zstd_stored_fields feature flag is enabled", CodecService.ZSTD_STORED_FIELDS_FEATURE_FLAG.isEnabled());
5959
Codec codec = createCodecService().codec("default");
6060
assertEquals(
61-
"Zstd814StoredFieldsFormat(compressionMode=ZSTD(level=0), chunkSize=14336, maxDocsPerChunk=128, blockShift=10)",
61+
"Zstd814StoredFieldsFormat(compressionMode=ZSTD(level=0), chunkSize=14336, maxDocsPerChunk=96, blockShift=10)",
6262
codec.storedFieldsFormat().toString()
6363
);
6464
}

0 commit comments

Comments
 (0)