-
Notifications
You must be signed in to change notification settings - Fork 840
Add Zstandard compression support and update tests #12201
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
base: master
Are you sure you want to change the base?
Conversation
[approve ci] |
@masaori335 do you know which files I need to modify to install zstd on the osx used in the Jenkins job? |
We need to ask @ezelkow1 to install the package in the osx env, I guess. However, this PR has |
0167bf5
to
74cd8b5
Compare
thank you, _F was a mistake, it was meant to be _H |
308032c
to
c598282
Compare
Looks like all the FreeBSD machines for CI are offline |
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.
Really appreciate it if you can please add some documentation to the changes.
Thanks.
Hi! This doesn't compile for me. I added a line to
Please include this patch in your PR to enable the ZSTD code. Thanks!
|
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.
Please patch ink_config.h
and resolve compiler issues.
4b8603e
to
72c0dbf
Compare
- Add support for configurable compression levels per host: * gzip-compression-level (1-9, default 6) * brotli-compression-level (0-11, default 6) * brotli-lgwin (10-24, default 16) * zstd-compression-level (1-22, default 12) This enables fine-tuning compression performance vs. speed trade-offs on a per-host basis
@cmcfarlen do you know if there's anything I can do to help get this reviewed? I'm happy to join a mailing list or slack, discord, etc - my work uses ATS quite a bit and I'm eager to ensure we contribute back to the project where we can |
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.
You can find the dev mailing list (and other mailing lists) on apache.org. I'm sure we can get you on Slack as well. I don't have a lot of availability, so I likely won't be reviewing this whole change, but hopefully this is a helpful start.
Switch to the upstream zstd CMake package and drop our custom Find-module. - Use `find_package(zstd CONFIG QUIET)` and set `HAVE_ZSTD_H` when found - Provide a compatibility target `zstd::zstd` that aliases `zstd::libzstd_shared`/`zstd::libzstd_static`/`zstd::libzstd` to keep existing link lines working - Remove `cmake/Findzstd.cmake` and rely on distro-provided configs This reduces maintenance and prefers the canonical package configuration while retaining compatibility with current linkage in the tree.
Co-authored-by: JosiahWI <[email protected]>
Updates function names from zstd_compress_* to zstd_transform_* to align with naming conventions used by other compression algorithms in the codebase. Improves code consistency and maintainability by standardizing function naming patterns across different compression implementations.
tests/gold_tests/headers/replays/normalized_ae_varied_transactions.replay.yaml
Show resolved
Hide resolved
# Conflicts: # contrib/docker/ubuntu/noble/Dockerfile # plugins/compress/configuration.cc # plugins/compress/configuration.h
This pull request adds full support for the zstd (Zstandard) compression algorithm throughout Apache Traffic Server, including build system integration, compression plugin support, Accept-Encoding header normalization, and test coverage.
Key Features
Build system and dependencies:
Findzstd.cmake
libzstd-dev
packageTS_HAS_ZSTD
feature flag for conditional compilationCore compression support:
Accept-Encoding header normalization:
proxy.config.http.normalize_ae
configuration to support values 4 and 5 for zstd normalizationAPI and infrastructure:
TS_HTTP_VALUE_ZSTD
andTS_HTTP_LEN_ZSTD
constantsImproved cache matching:
Test Coverage
compress3.config
for zstd-specific plugin configurationStandards Compliance
The implementation follows RFC 8878 standards for zstd compression and maintains backward compatibility with existing gzip and brotli compression functionality. All tests pass and the feature is properly integrated with existing caching and content negotiation mechanisms.
Configuration
New normalization modes:
proxy.config.http.normalize_ae = 4
: Prioritize zstd, fallback to br then gzipproxy.config.http.normalize_ae = 5
: Support all combinations of zstd, br, and gzipBenefits