Skip to content
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

feat(http): gzip compress the query CSV response. #14495

Merged
merged 1 commit into from
Jul 29, 2019

Conversation

goller
Copy link
Contributor

@goller goller commented Jul 29, 2019

If client requests with Accept-Encoding: gzip, then
compress response and return with Content-Encoding: gzip.

This increases the server-side load by about 12%, but saves network bandwidth.

benchmark                     old ns/op     new ns/op     delta
Benchmark_Query_no_gzip-4     123609        137885        +11.55%

benchmark                     old allocs     new allocs     delta
Benchmark_Query_no_gzip-4     149            150            +0.67%

benchmark                     old bytes     new bytes     delta
Benchmark_Query_no_gzip-4     14297         15205         +6.35%
  • CHANGELOG.md updated with a link to the PR (not the Issue)
  • Well-formatted commit messages
  • Rebased/mergeable
  • Tests pass
  • http/swagger.yml updated (if modified Go structs or API)
  • Documentation updated or issue created (provide link to issue/pr)
  • Signed CLA (if not already signed)

@goller goller requested a review from a team as a code owner July 29, 2019 19:30
@goller goller requested review from chnn and russorat July 29, 2019 19:31
If client requests with Accept-Encoding: gzip, then
compress response and return with Content-Encoding: gzip.

This increases the server-side load by about 12%, but saves network bandwidth.

benchmark                     old ns/op     new ns/op     delta
Benchmark_Query_no_gzip-4     123609        137885        +11.55%

benchmark                     old allocs     new allocs     delta
Benchmark_Query_no_gzip-4     149            150            +0.67%

benchmark                     old bytes     new bytes     delta
Benchmark_Query_no_gzip-4     14297         15205         +6.35%
@goller goller force-pushed the feat/query-gzip-content-encoding branch from a4214e7 to 5d44d8e Compare July 29, 2019 19:33
}

func Benchmark_Query_gzip(b *testing.B) {
benchmarkQuery(b, false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wonder if nginx could compress more efficiently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants