Browse Source

adjust http max idle connections per host

related to https://github.com/chrislusf/seaweedfs/issues/1802
pull/1804/head
Chris Lu 4 years ago
parent
commit
487e435679
  1. 2
      unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go
  2. 1
      weed/operation/upload_content.go
  3. 1
      weed/pb/grpc_client_server.go
  4. 1
      weed/s3api/s3api_object_handlers.go
  5. 1
      weed/server/filer_server_handlers_proxy.go
  6. 1
      weed/util/http_util.go

2
unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go

@ -45,7 +45,7 @@ func main() {
defer wg.Done() defer wg.Done()
client := &http.Client{Transport: &http.Transport{ client := &http.Client{Transport: &http.Transport{
MaxConnsPerHost: 1024,
MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024, MaxIdleConnsPerHost: 1024,
}} }}
r := rand.New(rand.NewSource(time.Now().UnixNano() + int64(x))) r := rand.New(rand.NewSource(time.Now().UnixNano() + int64(x)))

1
weed/operation/upload_content.go

@ -58,6 +58,7 @@ var (
func init() { func init() {
HttpClient = &http.Client{Transport: &http.Transport{ HttpClient = &http.Client{Transport: &http.Transport{
MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024, MaxIdleConnsPerHost: 1024,
}} }}
} }

1
weed/pb/grpc_client_server.go

@ -29,6 +29,7 @@ var (
func init() { func init() {
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 1024 http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 1024
http.DefaultTransport.(*http.Transport).MaxIdleConns = 1024
} }
func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server { func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server {

1
weed/s3api/s3api_object_handlers.go

@ -27,6 +27,7 @@ var (
func init() { func init() {
client = &http.Client{Transport: &http.Transport{ client = &http.Client{Transport: &http.Transport{
MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024, MaxIdleConnsPerHost: 1024,
}} }}
} }

1
weed/server/filer_server_handlers_proxy.go

@ -14,6 +14,7 @@ var (
func init() { func init() {
client = &http.Client{Transport: &http.Transport{ client = &http.Client{Transport: &http.Transport{
MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024, MaxIdleConnsPerHost: 1024,
}} }}
} }

1
weed/util/http_util.go

@ -21,6 +21,7 @@ var (
func init() { func init() {
Transport = &http.Transport{ Transport = &http.Transport{
MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024, MaxIdleConnsPerHost: 1024,
} }
client = &http.Client{ client = &http.Client{

Loading…
Cancel
Save