You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/01 07:07:44 UTC
[GitHub] [pulsar] xuesongxs opened a new pull request, #16323: [Improve][broker] Add gzip compression before http service response
xuesongxs opened a new pull request, #16323:
URL: https://github.com/apache/pulsar/pull/16323
Fixes #16321
*Describe the modifications you've done.*
Add gzip compression before http service response.
Before compression:

After compression:

--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#issuecomment-1172893208
> Add configuration would be great and disabled by default.
OK, I'll add a configuration attribute.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on a diff in pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on code in PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#discussion_r924185139
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -323,6 +323,12 @@ public class ServiceConfiguration implements PulsarConfiguration {
+ "(0 to disable limiting)")
private int maxHttpServerConnections = 2048;
+ @FieldContext(
+ category = CATEGORY_SERVER,
+ doc = "enable compression when the HTTP service responds to the client"
+ )
+ private boolean enableCompress = false;
Review Comment:
please review
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#issuecomment-1172107059
> Is there any overhead about broker CPU cost? @xuesongxs
CPU utilization is not easy to test, which is also related to the compressed index memory size.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#issuecomment-1196258251
@codelipenghui @tjiuming @liangyuanpeng
Please help review the code.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] tjiuming commented on pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
tjiuming commented on PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#issuecomment-1173579803
@xuesongxs most of the endpoints won't has a big response body, the only known endpoint needs to compress is `/metrics`. if we enable compress all of the endpoints, it will comes high CPU usage.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#issuecomment-1173597600
> @xuesongxs most of the endpoints won't has a big response body, the only known endpoint needs to compress is `/metrics`. if we enable compress all of the endpoints, it will comes high CPU usage.
OK,I'll modify it and only add it on /metrics.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] AnonHxy commented on pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
AnonHxy commented on PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#issuecomment-1172086678
Is there any overhead about broker CPU cost? @xuesongxs
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#issuecomment-1172903808
looks duplicated with https://github.com/apache/pulsar/pull/16197?
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] xuesongxs commented on pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
xuesongxs commented on PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#issuecomment-1172905354
> looks duplicated with #16197?
The purpose is the same, but its implementation method is not based on jetty's gzip handler, and it is not sure whether its repair can be recognized on the promethues client, and the implementation method is somewhat redundant. Please decide which solution to use.
I think that compression should be used in the HTTP service of broker, not only in metrics, but also in rest API.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] tjiuming commented on a diff in pull request #16323: [Improve][broker] Add gzip compression before http service response
Posted by GitBox <gi...@apache.org>.
tjiuming commented on code in PR #16323:
URL: https://github.com/apache/pulsar/pull/16323#discussion_r915069353
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java:
##########
@@ -323,6 +323,12 @@ public class ServiceConfiguration implements PulsarConfiguration {
+ "(0 to disable limiting)")
private int maxHttpServerConnections = 2048;
+ @FieldContext(
+ category = CATEGORY_SERVER,
+ doc = "enable compression when the HTTP service responds to the client"
+ )
+ private boolean enableCompress = false;
Review Comment:
`enableCompressMetricsData` should be better
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org