grpc: Increase message limits #470
1 changed files with 3 additions and 1 deletions
|
@ -17,11 +17,13 @@ import (
|
|||
"google.golang.org/grpc/credentials"
|
||||
)
|
||||
|
||||
const maxRecvMsgSize = 256 << 20
|
||||
|
||||
func initGRPC(c *cfg) {
|
||||
var successCount int
|
||||
grpcconfig.IterateEndpoints(c.appCfg, func(sc *grpcconfig.Config) {
|
||||
serverOpts := []grpc.ServerOption{
|
||||
grpc.MaxSendMsgSize(maxMsgSize),
|
||||
grpc.MaxRecvMsgSize(maxRecvMsgSize),
|
||||
|
||||
grpc.ChainUnaryInterceptor(
|
||||
metrics.NewUnaryServerInterceptor(),
|
||||
tracing.NewUnaryServerInterceptor(),
|
||||
|
|
Loading…
Reference in a new issue
Why not to move it in config file?
If we transfer this parameter to the configuration file, then we can get a situation where different nodes have different values set. This will lead to problems with requests.
We will face this error (if it will be) anyway because it is impossible to upgrade all nodes at once, rolling upgrade is a usual case for us.
Well, you are right.
We can prevent invalid configuration, but we can't prevent rolling upgrade.
We have increased message size, so no problems should appear when talking
old -> new
node.For
new -> old
we still use defaultchunkSize
.