Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

adjust http max idle connections per host

Chris Lu487e435679d6
diff --git a/unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go b/unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go
index b2e4b28c6d..2ee8028f22 100644
--- a/unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go
+++ b/unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go
@@ -45,7 +45,7 @@ func main() {
defer wg.Done()
client := &http.Client{Transport: &http.Transport{
- MaxConnsPerHost: 1024,
+ MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024,
}}
r := rand.New(rand.NewSource(time.Now().UnixNano() + int64(x)))
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index fccc24b16d..7e2a6dcd25 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -58,6 +58,7 @@ var (
func init() {
HttpClient = &http.Client{Transport: &http.Transport{
+ MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024,
}}
}
diff --git a/weed/pb/grpc_client_server.go b/weed/pb/grpc_client_server.go
index 9ffda9b04d..ec49d177b1 100644
--- a/weed/pb/grpc_client_server.go
+++ b/weed/pb/grpc_client_server.go
@@ -29,6 +29,7 @@ var (
func init() {
http.DefaultTransport.(*http.Transport).MaxIdleConnsPerHost = 1024
+ http.DefaultTransport.(*http.Transport).MaxIdleConns = 1024
}
func NewGrpcServer(opts ...grpc.ServerOption) *grpc.Server {
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go
index 4c408110a4..82f0de6b27 100644
--- a/weed/s3api/s3api_object_handlers.go
+++ b/weed/s3api/s3api_object_handlers.go
@@ -27,6 +27,7 @@ var (
func init() {
client = &http.Client{Transport: &http.Transport{
+ MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024,
}}
}
diff --git a/weed/server/filer_server_handlers_proxy.go b/weed/server/filer_server_handlers_proxy.go
index 8d73bc960c..b8b28790be 100644
--- a/weed/server/filer_server_handlers_proxy.go
+++ b/weed/server/filer_server_handlers_proxy.go
@@ -14,6 +14,7 @@ var (
func init() {
client = &http.Client{Transport: &http.Transport{
+ MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024,
}}
}
diff --git a/weed/util/http_util.go b/weed/util/http_util.go
index 2cd69b01bb..135d10c45c 100644
--- a/weed/util/http_util.go
+++ b/weed/util/http_util.go
@@ -21,6 +21,7 @@ var (
func init() {
Transport = &http.Transport{
+ MaxIdleConns: 1024,
MaxIdleConnsPerHost: 1024,
}
client = &http.Client{