-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[doc] Add read performance doc. #4336
Closed
+68
−0
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
title: "Read Performance" | ||
weight: 2 | ||
type: docs | ||
aliases: | ||
- /maintenance/read-performance.html | ||
--- | ||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
# Read Performance | ||
|
||
There are many ways to improve read performance when reading Paimon data with Flink. | ||
|
||
## Acceleration In Flink client | ||
When use Flink batch job scan Paimon table, if you don't add option `scan.parallelism`, Paimon will infer the parallelism by read manifest files which take lots of time. So you can read Paimon table with the `scan.parallelism` table property. | ||
|
||
## Read Compact Snapshot | ||
You can read snapshot which commitKind = Compact, Compared to read other commitKind snapshot, reading this snapshot requires fewer merge operations, resulting in higher performance. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may only be faster if there is a configuration full-compact. |
||
|
||
## Modify Compaction Config | ||
You can reduce the option value of configuration `num-sorted-run.compaction-trigger` for higher performance. But this is a trade-off between writing and query performance. | ||
|
||
## Modify DataFile's Compression Rates | ||
You can add option `file.compression.zstd-level` to adjust DataFile's compression rates, the smaller the value, the higher the read performance. | ||
|
||
## DeletionVector + Vectorized Computing Engine | ||
You can set `deletion-vectors.enabled` = true, and use a computing engine with vectorized ability to read Paimon table. This way can fully utilize the SIMD capability of the CPU to accelerate data processing. | ||
|
||
# Avoid OOM | ||
Reading data often leads to OOM due to various reasons. Below are several methods to reduce the probability of OOM. | ||
|
||
## Reduce The Concurrency Of Reading Manifest | ||
The parallelism of scanning manifest files, default value is the size of cpu processor. We can control it by `scan.manifest.parallelism`, the smaller the value, the lower probability of OOM. | ||
|
||
## Reduce The Stats In DataFileMeta | ||
If your Paimon table has lots of columns, and you just want field B to use dense stat, other columns close stats. You can control this by follow options. | ||
|
||
`metadata.stats-dense-store` = true | ||
|
||
`metadata.stats-mode` = none | ||
|
||
`fields.b.stats-mode` = truncate(16) | ||
|
||
## Reduce The Record In Memory | ||
If your Paimon table has some lager records which will occupy a lot of memory. Your can reduce the option `read.batch-size`, the default value is 1024. | ||
|
||
## Optimize Memory When MOR | ||
When merge on read in a sortedRun which include lots of DataFile, too many readers will consume too much memory and causing OOM. | ||
Your can add option `sort-spill-threshold` to spill some DataFile before MOR. | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that for most tables it will cause "take lots of time".