Skip to content

Commit

Permalink
Add automaxprocs to correctly determine CPU resources in container
Browse files Browse the repository at this point in the history
  • Loading branch information
pschork committed Jul 10, 2024
1 parent 6d73a4a commit b23166c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion node/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b23166c

Please sign in to comment.