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

RPCDaemon: increase throughput by allowing more parallel grpc streams and not lockthread for read tx #1580

Merged
merged 18 commits into from
Mar 23, 2021
Prev Previous commit
Next Next commit
lint
  • Loading branch information
AskAlexSharov committed Mar 23, 2021
commit 23a1ad864c2fb9872e3110af9aa7241ea59eec26
7 changes: 4 additions & 3 deletions ethdb/remote/remotedbserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io"
"net"
"runtime"
"time"

grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
Expand Down Expand Up @@ -49,10 +50,10 @@ func StartGrpc(kv ethdb.KV, eth core.Backend, addr string, creds *credentials.Tr
streamInterceptors = append(streamInterceptors, grpc_recovery.StreamServerInterceptor())
unaryInterceptors = append(unaryInterceptors, grpc_recovery.UnaryServerInterceptor())
var grpcServer *grpc.Server
//cpus := uint32(runtime.GOMAXPROCS(-1))
cpus := uint32(runtime.GOMAXPROCS(-1))
opts := []grpc.ServerOption{
//grpc.NumStreamWorkers(cpus), // reduce amount of goroutines
grpc.WriteBufferSize(1024), // reduce buffers to save mem
grpc.NumStreamWorkers(cpus), // reduce amount of goroutines
grpc.WriteBufferSize(1024), // reduce buffers to save mem
grpc.ReadBufferSize(1024),
grpc.MaxConcurrentStreams(1000), // to force clients reduce concurrency level
// Don't drop the connection, settings accordign to this comment on GitHub
Expand Down