You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While stats.OutPayload correctly accounts for the 5-byte GRPC header, stats.InPayload skips it when computing InPayload.WireLength. This means that a client's throughput does not match the server's throughput when you have a simple test which sends a single request response pair between client and server.
The patch below fixes the problem in GRPC.
diff --git a/rpc_util.go b/rpc_util.go
index eccf84d..8418649 100644
--- a/rpc_util.go
+++ b/rpc_util.go
@@ -376,7 +376,7 @@ func recv(p *parser, c Codec, s *transport.Stream, dc Decompressor, m interface{
return err
}
if inPayload != nil {
- inPayload.WireLength = len(d)
+ inPayload.WireLength = len(d) + len(p.header)
}
if err := checkRecvPayload(pf, s.RecvCompress(), dc); err != nil {
return err
diff --git a/server.go b/server.go
index 2c26db8..ba53840 100644
--- a/server.go
+++ b/server.go
@@ -818,7 +818,7 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.
}
df := func(v interface{}) error {
if inPayload != nil {
- inPayload.WireLength = len(req)
+ inPayload.WireLength = len(req) + len(p.header)
}
if pf == compressionMade {
var err error
The text was updated successfully, but these errors were encountered:
This issue is labeled as requiring an update from the reporter, and no update has been received after 7 days. If no update is provided in the next 7 days, this issue will be automatically closed.
While
stats.OutPayload
correctly accounts for the 5-byte GRPC header,stats.InPayload
skips it when computingInPayload.WireLength
. This means that a client's throughput does not match the server's throughput when you have a simple test which sends a single request response pair between client and server.The patch below fixes the problem in GRPC.
The text was updated successfully, but these errors were encountered: