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 a26d696245edbfb45a3f6501ed064166f85e51d9
2 changes: 1 addition & 1 deletion ethdb/kv_lmdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (opts LmdbOpts) Open() (kv KV, err error) {
if err != nil {
return nil, err
}
err = env.SetMaxReaders(1024)
err = env.SetMaxReaders(512)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion ethdb/kv_mdbx.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (opts MdbxOpts) Open() (KV, error) {
if err = env.SetMaxDBs(100); err != nil {
return nil, err
}
if err = env.SetOption(mdbx.OptMaxReaders, 1024); err != nil {
if err = env.SetOption(mdbx.OptMaxReaders, 512); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion ethdb/remote/remotedbserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func StartGrpc(kv ethdb.KV, eth core.Backend, addr string, creds *credentials.Tr
grpc.NumStreamWorkers(cpus), // reduce amount of goroutines
grpc.WriteBufferSize(1024), // reduce buffers to save mem
grpc.ReadBufferSize(1024),
grpc.MaxConcurrentStreams(1_000), // to force clients reduce concurrency level
grpc.MaxConcurrentStreams(500), // to force clients reduce concurrency level
// Don't drop the connection, settings accordign to this comment on GitHub
// https://github.com/grpc/grpc-go/issues/3171#issuecomment-552796779
grpc.KeepaliveEnforcementPolicy(keepalive.EnforcementPolicy{
Expand Down