[Improve][broker] Add gzip compression before http service response#16323
[Improve][broker] Add gzip compression before http service response#16323xuesongxs wants to merge 5 commits intoapache:masterfrom xuesongxs:gzip
Conversation
|
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. |
liangyuanpeng
left a comment
There was a problem hiding this comment.
Add configuration would be great and disabled by default.
OK, I'll add a configuration attribute. |
|
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. |
|
@xuesongxs most of the endpoints won't has a big response body, the only known endpoint needs to compress is |
OK,I'll modify it and only add it on /metrics. |
tjiuming
left a comment
There was a problem hiding this comment.
Please add tests to ensure /metrics endpoint response compressed and others not
| category = CATEGORY_SERVER, | ||
| doc = "enable compression when the HTTP service responds to the client" | ||
| ) | ||
| private boolean enableCompress = false; |
There was a problem hiding this comment.
enableCompressMetricsData should be better
|
@codelipenghui @tjiuming @liangyuanpeng |
Fixes #16321
Describe the modifications you've done.

Add gzip compression before http service response.
Before compression:
After compression:
