bamcis-io / PrestoClient

A .NET client for Prestodb written targetting .NET Standard 2.0.
MIT License
18 stars 18 forks source link

Enable compression on HttpClient #20

Open mmiller678 opened 1 year ago

mmiller678 commented 1 year ago

Were seeing the python trino library return results in 4s in 25 HTTP responses. The same query with the .NET client is taking 1m28s and making 127 HTTP requests. I believe this is due to http compression not being enabled. Additionally this causes substantially more load on the server based on the statics I am seeing the final response. Ideally I would like to control all settings on the HttpClient, not just compression.

mmiller678 commented 1 year ago

After further review my initial analysis is somewhat incorrect. The time for python is 16.5s in 94 HTTP requests (there was issue with all the data not being returned when we upgraded to the latest trino python library). The other issue is the check interval - which I wasn't aware of until I pulled the source and started debugging. By adding compression + setting the check interval to zero (removed limit of 50) the same query was resolved in 14s which is comparable to the python library. I don't think the check interval should have a min value - let the users decide how they want to use it.

hakenmt commented 1 year ago

Feel free to submit a PR and I can review and incorporate the requested changes.