[#470] grpc: Increase message limits
Build / Build Components (1.19) (pull_request) Successful in 3m27s Details
ci/woodpecker/pr/pre-commit Pipeline was successful Details
Build / Build Components (1.20) (pull_request) Successful in 3m25s Details
Tests and linters / Lint (pull_request) Successful in 2m15s Details
Tests and linters / Tests (1.19) (pull_request) Successful in 2m51s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 5m54s Details
Tests and linters / Tests with -race (pull_request) Successful in 6m31s Details
ci/woodpecker/push/pre-commit Pipeline was successful Details

For send message limit set to 2GiB, but there are custom
GET/GET RANGE limiters.
For receive message limit set to 256 MiB, but actual chunk size
will be managed by client.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
pull/470/head
Dmitrii Stepanov 2023-06-26 18:27:42 +03:00
parent f437ab8f15
commit 0c5b025788
1 changed files with 3 additions and 1 deletions

View File

@ -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(),