Database / CouchDB Interview Questions
What are the key CouchDB configuration parameters to tune for production (max_dbs_open, os_process_limit, etc.)?
CouchDB's default configuration targets a single-developer workstation. Production deployments require tuning several parameters across different configuration sections:
| Section / Key | Default | What it controls |
|---|---|---|
| [couchdb] max_dbs_open | 500 | Maximum number of database files open simultaneously. Each open database holds a file descriptor. Increase for servers with many databases; ensure OS ulimits allow it. |
| [couchdb] os_process_limit | 100 | Maximum JavaScript OS processes for the query server (views, VDU). Each concurrent JavaScript request consumes one process. Increase for high-concurrency view workloads. |
| [chttpd] workers | 100 | HTTP request handler pool size. Increase for high concurrent request rates. |
| [couch_httpd_auth] timeout | 600 | Session cookie timeout in seconds. |
| [smoosh] * | various | Auto-compaction daemon thresholds. min_priority controls when a database qualifies for compaction based on data/file size ratio. |
| [rexi] buffer_count | 2000 | Internal message buffer for cluster inter-node RPC. Increase if you see rexi_buffer errors in logs. |
| [fabric] request_timeout | 60000ms | Timeout for cluster-level requests. Increase for slow queries over large datasets. |
OS-level tuning is equally important: set ulimit -n to at least 65535 for file descriptors (each open database + each view index file counts). On Linux, set vm.swappiness=1 to prevent Erlang heap from being swapped. For high write throughput, ensure the storage device has noatime mount option to avoid inode update I/O on every read.
More Related questions...