-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve] [broker] Servlet support response compression #21667
[improve] [broker] Servlet support response compression #21667
Conversation
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java
Outdated
Show resolved
Hide resolved
@hangc0276 please address the review comments. it would be great to finally get this merged after a few years of reviews :) |
Sure, I will address it. |
782f2c9
to
c3f6449
Compare
pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java
Show resolved
Hide resolved
Cherry-picking to branch-3.0 and branch-3.2 since the lack of compression is causing issues when metrics are enabled and there are a large amount of active topics. |
Btw. It looks like this change could be improved. Instead of adding multiple GzipHandler instances, it would be better to add a single instance and provide a configuration option for configuring excluded paths, just in case the compression causes problems for some cases. |
Early WIP PR for improvement: #22370 |
(cherry picked from commit 7a4e16a) # Conflicts: # pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java
(cherry picked from commit 7a4e16a)
(cherry picked from commit 7a4e16a)
(cherry picked from commit 7a4e16a) Signed-off-by: Zixuan Liu <[email protected]>
Fixes #16321
Main Issue: #xyz
PIP: #xyz
Motivation
The original PR is #18102, after communicating with the author @xuesongxs, I opened a new PR to handle it.
I tested the Prometheus metric with 1000 topics and enabled the compression to get 33x data saving.
Modifications
Add gzip compression by default and the whether the response is compressed or not is based on the client request header
Accept-Encoding: gzip
.The feature will improve the metric cross-zone traffic a lot especially Pulsar broker deployed on Cloud.
This is a new feature and it will be released on the feature branch.
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: