mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
set default http idle connection per host
possible fix https://github.com/chrislusf/seaweedfs/issues/915
This commit is contained in:
parent
0bd7ced7c2
commit
c94823f52c
|
@ -3,6 +3,7 @@ package util
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -18,6 +19,10 @@ var (
|
||||||
grpcClientsLock sync.Mutex
|
grpcClientsLock sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init(){
|
||||||
|
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 100
|
||||||
|
}
|
||||||
|
|
||||||
func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server {
|
func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server {
|
||||||
var options []grpc.ServerOption
|
var options []grpc.ServerOption
|
||||||
options = append(options, grpc.KeepaliveParams(keepalive.ServerParameters{
|
options = append(options, grpc.KeepaliveParams(keepalive.ServerParameters{
|
||||||
|
|
Loading…
Reference in a new issue