Skip to content

Commit

Permalink
[FAB-4243] Set CouchDB max_dbs_open config option
Browse files Browse the repository at this point in the history
CouchDB returns errors to peer if more than N channels (databases)
are being accessed concurrently.

Current default value for max_dbs_open in default.ini is 500.
This corresponds to 500 shards or 62 databases (there are 8 shards per
database by default).  For highly concurrent environments with a large
number of channels, a better default would be 1000 databases, which
corresponds to max_dbs_open of 8000.

CouchDB uses LRU cache to manage open databases,
and closes databases as needed.

Perhaps more important than picking a higher default value, is that
the configuration value be exposed in the CouchDB local.ini
configuration file, so that consumers are aware of the setting,
and can easily adjust if needed.

Change-Id: I19f99737939ed27c70955c6d5784232f02ef8b2c
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart committed Jun 19, 2017
1 parent f20846c commit 2bbbc23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion images/couchdb/local.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ database_dir = /opt/couchdb/data/
view_index_dir = /opt/couchdb/data/
uri_file = /opt/couchdb/data/couch.uri

; Specify the number of database shards that can be open concurrently.
; CouchDB uses LRU cache to manage open databases, and closes databases
; as needed. Deployments with large numbers of channels and high
; concurrency may need to increase this setting.
max_dbs_open = 8000

; only allow the admin user to connect
; Uncomment the following statement to enable admin user security.
; default_security = admin_only
Expand Down Expand Up @@ -50,4 +56,3 @@ iterations = 1000 ; iterations for password hashing

[attachments]
compressible_types = text/*, application/javascript, application/json, application/xml, application/octet-stream

0 comments on commit 2bbbc23

Please sign in to comment.