Skip to content

Commit

Permalink
define couchDB connection pool size
Browse files Browse the repository at this point in the history
FAB-17277 fix too many TCP connections between peer and CouchDB

Increase the connection pool size per host from 2 to 2000.
Also, increase the total connection pool size to 2000.

Signed-off-by: Senthil Nathan N <cendhu@gmail.com>
  • Loading branch information
cendhu authored and mastersingh24 committed Dec 17, 2019
1 parent c25924a commit 28c6efd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/ledger/util/couchdb/couchdbutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,14 @@ func CreateCouchInstance(config *Config, metricsProvider metrics.Provider) (*Cou
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
ForceAttemptHTTP2: true,
MaxIdleConns: 2000,
MaxIdleConnsPerHost: 2000,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}
transport.DisableCompression = false

client.Transport = transport

//Create the CouchDB instance
Expand Down

0 comments on commit 28c6efd

Please sign in to comment.