FrankChen021 opened a new pull request, #18982: URL: https://github.com/apache/druid/pull/18982
### Description Currently zip(default level 6) is used to compress all files when uploading to hdfs. the zip compression takes cpu resources and time to upload large files. Another consequence is that it significantly increases task duration and may introduce task pending during task rolling over, which also introduces high lag in kafka. This PR adds support to using lz4 compression(fastest level) when uploading and decompression during downloading from hdfs. ## Metrics Comparison - because task duration is reduced, we didn't observe task pending <img width="1535" height="258" alt="image" src="https://github.com/user-attachments/assets/2f853a89-a126-4d09-a284-05ce1e13ecdd" /> - push duration is significantly reduced from up to 2 minutes to 30 seconds while the pull duration(pull+decompression) keep the same <img width="1198" height="694" alt="image" src="https://github.com/user-attachments/assets/5981efc4-5f57-4cf0-9659-c6a95fdfd510" /> - file size although the lz4 may increase the size of segment stored in hdfs, maybe 10% - 20%, but storage cost is acceptable - task hand off task hand off was reduced because task takes fewer time to compress the data <img width="3182" height="1626" alt="image" src="https://github.com/user-attachments/assets/d6a82851-974e-47b0-914a-adaea6501196" /> - cpu resources during the push phase of ingestion tasks, the lz4 does not take more cpu resource compared to zip <img width="816" height="580" alt="image" src="https://github.com/user-attachments/assets/f43a1977-6b98-409f-941a-f0063a461b79" /> and for historicals, we didn't observe any cpu resources increase in a cluster where lz4 formatted segments are frequently downloaded ## New Configuration - druid.storage.compressionFormat is added, if not given, it defaults to zip to keep current behaviour ## Metrics Added the following metrics: - hdfs/pull/size - hdfs/pull/duration - hdfs/push/size - hdfs/push/duration <!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. --> This PR has: - [x] been self-reviewed. - [x] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.) - [x] added documentation for new or modified features or behaviors. - [ ] a release note entry in the PR description. - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md) - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [x] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met. - [ ] added integration tests. - [x] been tested in a test Druid cluster. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
