wohali commented on issue #1341: CouchDB degrades and starts timeouting on all 
index operations
URL: https://github.com/apache/couchdb/issues/1341#issuecomment-391900971
 
 
   @pzduniak I'll remind you we have a [Code of 
Conduct](https://couchdb.apache.org/conduct.html) at this project. Please 
choose your words a bit more carefully. You're also getting all of this support 
for free. We are a volunteer-run project here.
   
   /cc @janl 
   
   "The database doesn't start at all" vs. "the view functionality is dead" are 
two different complaints. If you are able to `GET /` and get a response back, 
CouchDB is running.
   
   CouchDB runs inside of Erlang. The JavaScript view functionality is provided 
by 1 or more additional, forked, external `couchjs` processes. When CouchDB is 
busy, Erlang will gladly eat an entire core, meaning you may need to provide an 
additional core for `couchjs`.
   
   Further, in 2.x, the default is to split each database into 8 shards on 
disk. CouchDB 2.x forks a separate `couchjs` process for each of these shards, 
meaning your Docker container is running 8 additional, separate processes _per 
design document_ to build those views. More databases and more design documents 
mean multiplicatively more external `couchjs` processes.
   
   There are ways to alter [how many processes can run 
simultaneously](http://docs.couchdb.org/en/latest/config/query-servers.html#query_server_config/limit),
 and ways to [adjust the number of shards for each newly created 
database](http://docs.couchdb.org/en/latest/api/database/common.html?highlight=shards#put--db)
 as well as a [global default for newly created 
databases](http://docs.couchdb.org/en/latest/config/cluster.html#cluster-options).
 You may also wish to pipeline your view builds at startup so that not all of 
the views are attempted to be built at once (by querying them one at a time). 
Finally, if you simply want to wait longer, you can increase the [os process 
timeout](http://docs.couchdb.org/en/latest/config/couchdb.html?highlight=os_process_timeout#couchdb/os_process_timeout),
 and have your startup script try multiple times to `GET` the results of a view 
before it gives up.
   
   If you're looking to reduce CPU requirements, look into whether or not you 
can replace your views with declarative Mango secondary indexes. With the 
addition of [Mango-powered secondary 
indexes](http://docs.couchdb.org/en/latest/api/database/find.html) to CouchDB, 
JS views are becoming less necessary. As Mango runs inside of the Erlang 
process, it shares CPU with the main process more reasonably.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to