Skip to content

Commit

Permalink
HTTP adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
jie committed Oct 11, 2023
1 parent 051f076 commit e30673e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
7 changes: 6 additions & 1 deletion CA/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,12 @@ func StartCA(c *CAContext) {
time.Sleep(time.Duration(60-second+1) * time.Second)
}
// Initialize CA context
tr := &http.Transport{}
tr := &http.Transport{
MaxIdleConnsPerHost: 10,
MaxConnsPerHost: 300,
WriteBufferSize: 1024 * 1024, // 1MB
ReadBufferSize: 1024 * 1024, // 1MB
}
c.Client = &http.Client{
Transport: tr,
}
Expand Down
7 changes: 6 additions & 1 deletion Logger/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,12 @@ func PeriodicTask(ctx *LoggerContext) {
// Start the logger
func StartLogger(c *LoggerContext) {
// set up HTTP client
tr := &http.Transport{}
tr := &http.Transport{
MaxIdleConnsPerHost: 10,
MaxConnsPerHost: 300,
WriteBufferSize: 1024 * 1024, // 1MB
ReadBufferSize: 1024 * 1024, // 1MB
}
c.Client = &http.Client{
Transport: tr,
}
Expand Down
7 changes: 4 additions & 3 deletions gossiper/gossiper_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,10 @@ func StartGossiperServer(c *GossiperContext) {
//InitializeGossiperStorage(c)
// Create the http client to be used.
tr := &http.Transport{
MaxIdleConnsPerHost: 3000,
MaxConnsPerHost: 3000,
ExpectContinueTimeout: 10,
MaxIdleConnsPerHost: 10,
MaxConnsPerHost: 300,
WriteBufferSize: 1024 * 1024, // 1MB
ReadBufferSize: 1024 * 1024, // 1MB
}
c.Client = &http.Client{
Transport: tr,
Expand Down
7 changes: 4 additions & 3 deletions monitor/monitor-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ func StartMonitorServer(c *MonitorContext) {
}
time.Sleep(time.Duration(c.Clockdrift_miliseconds) * time.Millisecond)
tr := &http.Transport{
MaxIdleConnsPerHost: 3000,
MaxConnsPerHost: 3000,
ExpectContinueTimeout: 10,
MaxIdleConnsPerHost: 10,
MaxConnsPerHost: 300,
WriteBufferSize: 1024 * 1024, // 1MB
ReadBufferSize: 1024 * 1024, // 1MB
}
c.Client = &http.Client{
Transport: tr,
Expand Down

0 comments on commit e30673e

Please sign in to comment.