From 9bec20933d2c2338eaf3c85e4233005ca145b7ca Mon Sep 17 00:00:00 2001 From: Jian Xiao Date: Fri, 14 Jun 2024 21:18:40 +0000 Subject: [PATCH 1/4] Add log for request data size breakdown --- node/grpc/server.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/node/grpc/server.go b/node/grpc/server.go index 73dabc436f..992442bd57 100644 --- a/node/grpc/server.go +++ b/node/grpc/server.go @@ -200,7 +200,15 @@ func (s *Server) validateStoreChunkRequest(in *pb.StoreChunksRequest) error { func (s *Server) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (*pb.StoreChunksReply, error) { start := time.Now() - s.node.Logger.Info("StoreChunks RPC request recieved", "request message size", proto.Size(in)) + blobHeadersSize := 0 + bundleSize := 0 + for _, blob := range in.Blobs { + blobHeadersSize += proto.Size(blob.GetHeader()) + for _, bundle := range blob.GetBundles() { + bundleSize += proto.Size(bundle) + } + } + s.node.Logger.Info("StoreChunks RPC request recieved", "request message size", proto.Size(in), "total size of blob headers", blobHeadersSize, "total size of bundles", bundleSize) // Validate the request. if err := s.validateStoreChunkRequest(in); err != nil { From a8ac3e187445a581334673dda30ab0c8139faabb Mon Sep 17 00:00:00 2001 From: Jian Xiao Date: Fri, 14 Jun 2024 22:24:08 +0000 Subject: [PATCH 2/4] num blobs --- node/grpc/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/grpc/server.go b/node/grpc/server.go index 992442bd57..b797525fb1 100644 --- a/node/grpc/server.go +++ b/node/grpc/server.go @@ -208,7 +208,7 @@ func (s *Server) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (*p bundleSize += proto.Size(bundle) } } - s.node.Logger.Info("StoreChunks RPC request recieved", "request message size", proto.Size(in), "total size of blob headers", blobHeadersSize, "total size of bundles", bundleSize) + s.node.Logger.Info("StoreChunks RPC request recieved", "num of blobs", len(in.Blobs), "request message size", proto.Size(in), "total size of blob headers", blobHeadersSize, "total size of bundles", bundleSize) // Validate the request. if err := s.validateStoreChunkRequest(in); err != nil { From 5f6910ddb1377b0fda44ddc36a3f99132005d5aa Mon Sep 17 00:00:00 2001 From: Jian Xiao Date: Fri, 14 Jun 2024 22:46:59 +0000 Subject: [PATCH 3/4] comment --- node/grpc/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node/grpc/server.go b/node/grpc/server.go index b797525fb1..db6db12d71 100644 --- a/node/grpc/server.go +++ b/node/grpc/server.go @@ -208,6 +208,8 @@ func (s *Server) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (*p bundleSize += proto.Size(bundle) } } + // Caveat: proto.Size() returns int, so this log will not work for larger protobuf + // message (over about 2GiB). s.node.Logger.Info("StoreChunks RPC request recieved", "num of blobs", len(in.Blobs), "request message size", proto.Size(in), "total size of blob headers", blobHeadersSize, "total size of bundles", bundleSize) // Validate the request. From a622d5ae9210fc956ed94745c9dafb4c80a3f1f3 Mon Sep 17 00:00:00 2001 From: Jian Xiao Date: Fri, 14 Jun 2024 22:56:45 +0000 Subject: [PATCH 4/4] fix --- node/grpc/server.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/node/grpc/server.go b/node/grpc/server.go index db6db12d71..d9710ca829 100644 --- a/node/grpc/server.go +++ b/node/grpc/server.go @@ -208,8 +208,7 @@ func (s *Server) StoreChunks(ctx context.Context, in *pb.StoreChunksRequest) (*p bundleSize += proto.Size(bundle) } } - // Caveat: proto.Size() returns int, so this log will not work for larger protobuf - // message (over about 2GiB). + // Caveat: proto.Size() returns int, so this log will not work for larger protobuf message (over about 2GiB). s.node.Logger.Info("StoreChunks RPC request recieved", "num of blobs", len(in.Blobs), "request message size", proto.Size(in), "total size of blob headers", blobHeadersSize, "total size of bundles", bundleSize) // Validate the request.