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

Traffic compression #2258

Open
slava-re opened this issue Jul 1, 2024 · 5 comments
Open

Traffic compression #2258

slava-re opened this issue Jul 1, 2024 · 5 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@slava-re
Copy link

slava-re commented Jul 1, 2024

Feature Description

Good day to you!

We're seeing internet speed cap being a bottleneck on some of the dump operations we perform. Since compressed dumps can be less than ten times what the uncompressed dump is, I thought, it could be an interesting enhancement to add compression to the proxied traffic.

I understand that this would also involve the proxy software on the other end, so not sure if this is the right repo to submit a feature request like this, and it's high effort/low prio, but still submitting this just in case.

Sample code

No response

Alternatives Considered

Postgres had compression implemented in their SSL transport, but it got retired mainly because the underlying SSL library has an insecure implementation.

Additional Details

No response

@slava-re slava-re added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jul 1, 2024
@enocom
Copy link
Member

enocom commented Jul 2, 2024

This is an interesting idea. Would this be for the Postgres protocol or for the raw bytes going back and forth?

@jackwotherspoon jackwotherspoon added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Aug 14, 2024
@jackwotherspoon
Copy link
Collaborator

This is an interesting idea. Would this be for the Postgres protocol or for the raw bytes going back and forth?

@slava-re just wanted to follow-up on the above question ^

@slava-re
Copy link
Author

slava-re commented Aug 14, 2024

Sorry that I missed the question first time!

I think, by default Postgres doesn't encrypt the connection traffic (if it did, compressing encrypted stream would be useless), so this could be compression just at a proxy level, regardless of a protocol or the type of database. That's why adding it to Cloud SQL Proxy would be viable and beneficial to all DB types potentially.

@enocom
Copy link
Member

enocom commented Aug 14, 2024

More from the Postgres docs linked above. This is apparently an OpenSSL feature.

SSL compression is nowadays considered insecure and its use is no longer recommended. OpenSSL 1.1.0 disables compression by default, and many operating system distributions disable it in prior versions as well, so setting this parameter to on will not have any effect if the server does not accept compression. PostgreSQL 14 disables compression completely in the backend.

Looking at Go's TLS implementation, I don't see any mention of compression (other than here). If we were to pursue compression, it would be using the Go TLS implementation of it. So unless I've missed something in the API, I think this is presently infeasible.

@slava-re
Copy link
Author

Yeah, I've had in mind some kind of custom compression layer before the data is handed off to the encryption layer, which would require support on the other end (which Google technically would have ability to implement). But I totally see that this is not an easy thing to do a custom implementation of!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants