Make query result HTTP compression configurable#5818
Merged
dain merged 2 commits intotrinodb:masterfrom Nov 16, 2020
Merged
Conversation
dain
requested changes
Nov 13, 2020
Member
dain
left a comment
There was a problem hiding this comment.
One comment on the description in the client options, but otherwise looks good.
presto-benchmark-driver/src/main/java/io/prestosql/benchmark/driver/BenchmarkDriverOptions.java
Outdated
Show resolved
Hide resolved
a5e8306 to
980e115
Compare
By default, presto will GZIP query result JSON payloads sent to the client. However, especially when the client is connected to the coordinator over localhost, the added overhead of compressing the response and then uncompressing it on the client is a losing proposition. For queries that are bound only by result processing throughput (eg: SELECT * FROM <large table>) execution time can reduced by 20-50% when submitted over a localhost connection with compression disabled.
Allows configuring HTTP response compression for the query results endpoints at the server level, regardless of client configuration.
980e115 to
7a1b15a
Compare
dain
approved these changes
Nov 16, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adapted changes from prestodb/presto#15393
Before this change, query result JSON responses were generally compressed (assuming the response met the minimum size threshold and passed the user agent checks), so that behavior is still the default. However, disabling GZIP compression can significantly improve throughput of sending query results, especially over localhost links where the overhead of compressing the response and then uncompressing it again on the client side is never worth the bandwidth savings.
Clients are allowed to opt-out of compression, but not request compression from a server which has decided to disable compressed query result responses. Both sides ultimately negotiate the result based on their Accept-Encoding or Content-Encoding headers and the way that the gzip compression middleware interprets them.
For queries that are bound only by result processing throughput (eg:
SELECT * FROM <large table>) execution time can reduced by 20-50% when submitted over a localhost connection with compression disabled.