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

thriftbp: Report request/response payload sizes from client side #650

Merged
merged 1 commit into from
May 7, 2024

Conversation

fishy
Copy link
Member

@fishy fishy commented May 6, 2024

We currently already have a middleware to report that from the server side, but that's simulated by reconstruct THeaderProtocols and read/write to them, which will not include the header size and will not reflect compressions (zlib, etc.).

This client side reporting is done directly at the TTransport (TSocket) level, so it will reflect the exact number actually read/written at that level. If zlib is enabled in THeaderProtocol the size will reflect compressed payload. The only thing it will not reflect is potential SSL layer (e.g. when using TSSLSocket over TSocket, which we don't support yet).

We currently already have a middleware to report that from the server
side, but that's simulated by reconstruct THeaderProtocols and
read/write to them, which will not include the header size and will not
reflect compressions (zlib, etc.).

This client side reporting is done directly at the TTransport (TSocket)
level, so it will reflect the exact number actually read/written at that
level. If zlib is enabled in THeaderProtocol the size will reflect
compressed payload. The only thing it will not reflect is potential SSL
layer (e.g. when using TSSLSocket over TSocket, which we don't support
yet).
@fishy fishy requested a review from a team as a code owner May 6, 2024 23:10
@fishy fishy requested review from kylelemons, konradreiche and pacejackson and removed request for a team May 6, 2024 23:10
Copy link
Contributor

@kylelemons kylelemons left a comment

Choose a reason for hiding this comment

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

do we want to make it "more accurate" than the server? That might be confusing...

@fishy
Copy link
Member Author

fishy commented May 6, 2024

do we want to make it "more accurate" than the server? That might be confusing...

why not? the server ones always come with the big caveat that they're estimations (see the doccomment here), and also the client metrics will have different labels compared to the server ones.

we can potentially do the same thing on the server side in the future (make the server one more accurate), but that requires open up new apis from upstream thrift (in order to do that we need both of these things at the same time: 1) access to the underlying TTransport; and 2) a clear boundary when a request is finished. we currently have apis for them separately but not an api with access to both).

Copy link
Contributor

@kylelemons kylelemons left a comment

Choose a reason for hiding this comment

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

the reason is that if you want to look at server bandwidth and see a mismatch between the client and the server, you might be rightfully confused. Having different names for the metrics could help to clarify the difference. I'm not sure how many people really look at bandwidth though, so very shrug.

@fishy fishy merged commit 3868423 into master May 7, 2024
2 checks passed
@fishy fishy deleted the thriftbp-client-payload-size branch May 7, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants