mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-07-16 19:52:12 +08:00
adjust http max idle connections per host
related to https://github.com/chrislusf/seaweedfs/issues/1802
This commit is contained in:
parent
0f426ce34d
commit
487e435679
@ -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)))
|
||||||
|
@ -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,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
@ -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,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
@ -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…
Reference in New Issue
Block a user