Skip to content

Commit

Permalink
Modify the default grpc keepalive time parameter
Browse files Browse the repository at this point in the history
1.set grpc_keepalive_time to 10 seconds
2.set grpc_keepalive_timeout to 10 seconds
These settings will help to avoid the situation which query will hang there when pod or Bare metal is broken.

Signed-off-by: JohnnyThree <[email protected]>
  • Loading branch information
inolddays committed Nov 27, 2019
1 parent 0e90bab commit 1fbdd6c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions go/vt/grpcclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,22 @@ package grpcclient

import (
"flag"
"time"

grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/keepalive"
"vitess.io/vitess/go/trace"

"vitess.io/vitess/go/vt/grpccommon"
"vitess.io/vitess/go/vt/vttls"

"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/vttls"
)

var (
keepaliveTime = flag.Duration("grpc_keepalive_time", 0, "After a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive.")
keepaliveTimeout = flag.Duration("grpc_keepalive_timeout", 0, "After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.")
keepaliveTime = flag.Duration("grpc_keepalive_time", 10*time.Second, "After a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive.")
keepaliveTimeout = flag.Duration("grpc_keepalive_timeout", 10*time.Second, "After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.")
initialConnWindowSize = flag.Int("grpc_initial_conn_window_size", 0, "grpc initial connection window size")
initialWindowSize = flag.Int("grpc_initial_window_size", 0, "grpc initial window size")
)
Expand Down

0 comments on commit 1fbdd6c

Please sign in to comment.