From b23166c3bb9f5166164e9d40a9d4aeb82053703e Mon Sep 17 00:00:00 2001 From: Patrick Schork <354473+pschork@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:08:55 -0700 Subject: [PATCH] Add automaxprocs to correctly determine CPU resources in container --- node/grpc/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/node/grpc/server.go b/node/grpc/server.go index c29b22b3b6..4f65981b9e 100644 --- a/node/grpc/server.go +++ b/node/grpc/server.go @@ -20,6 +20,8 @@ import ( "github.com/Layr-Labs/eigensdk-go/logging" "github.com/shirou/gopsutil/mem" + _ "go.uber.org/automaxprocs" + "google.golang.org/grpc" "google.golang.org/grpc/reflection" "google.golang.org/protobuf/proto" @@ -139,7 +141,7 @@ func (s *Server) NodeInfo(ctx context.Context, in *pb.NodeInfoRequest) (*pb.Node memBytes = v.Total } - return &pb.NodeInfoReply{Semver: node.SemVer, Os: runtime.GOOS, Arch: runtime.GOARCH, NumCpu: uint32(runtime.NumCPU()), MemBytes: memBytes}, nil + return &pb.NodeInfoReply{Semver: node.SemVer, Os: runtime.GOOS, Arch: runtime.GOARCH, NumCpu: uint32(runtime.GOMAXPROCS(0)), MemBytes: memBytes}, nil } func (s *Server) handleStoreChunksRequest(ctx context.Context, in *pb.StoreChunksRequest) (*pb.StoreChunksReply, error) {