Skip to content

Commit

Permalink
Merge pull request #8238 from yudai/allow_more_streams
Browse files Browse the repository at this point in the history
v3rpc: Let clients establish unlimited streams
  • Loading branch information
xiang90 committed Jul 12, 2017
2 parents 148ed90 + 52101e6 commit 0a2b580
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion etcdserver/api/v3rpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package v3rpc

import (
"crypto/tls"
"math"

"github.com/coreos/etcd/etcdserver"
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
Expand All @@ -27,7 +28,10 @@ import (
healthpb "google.golang.org/grpc/health/grpc_health_v1"
)

const grpcOverheadBytes = 512 * 1024
const (
grpcOverheadBytes = 512 * 1024
maxStreams = math.MaxUint32
)

func init() {
grpclog.SetLogger(plog)
Expand All @@ -42,6 +46,7 @@ func Server(s *etcdserver.EtcdServer, tls *tls.Config) *grpc.Server {
opts = append(opts, grpc.UnaryInterceptor(newUnaryInterceptor(s)))
opts = append(opts, grpc.StreamInterceptor(newStreamInterceptor(s)))
opts = append(opts, grpc.MaxMsgSize(int(s.Cfg.MaxRequestBytes+grpcOverheadBytes)))
opts = append(opts, grpc.MaxConcurrentStreams(maxStreams))
grpcServer := grpc.NewServer(opts...)

pb.RegisterKVServer(grpcServer, NewQuotaKVServer(s))
Expand Down

0 comments on commit 0a2b580

Please sign in to comment.