Skip to content

Commit

Permalink
set MaxRecvMsgSize of grpc as 64M
Browse files Browse the repository at this point in the history
  • Loading branch information
Silentttttt committed May 21, 2018
1 parent 3116fbf commit c8c992e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
// Const
const (
DefaultConnectionLimits = 128
MaxRecvMsgSize = 64 * 1024 * 1024
)

// Neblet interface breaks cycle import dependency and hides unused services.
Expand Down Expand Up @@ -68,7 +69,8 @@ func NewServer(neblet core.Neblet) *Server {
logging.CLog().Fatal("Failed to find rpc config in config file.")
}
rpc := grpc.NewServer(grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(loggingStream)),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(loggingUnary)))
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(loggingUnary)),
grpc.MaxRecvMsgSize(MaxRecvMsgSize))

srv := &Server{neblet: neblet, rpcServer: rpc, rpcConfig: cfg}
api := &APIService{server: srv}
Expand Down

0 comments on commit c8c992e

Please sign in to comment.