Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchDB heart-beat time-out

My CouchDB (production) server is sometimes shut down, without my wanting it to. While inspecting logs I noticed Erlang/CouchDB (one or the other) sends a heart beat, and that heart beat is monitored. When a time-out occurs, the server is brutally killed (couchdb -k). This is almost always unwanted behaviour, definitely on a production server.

I've come across this issue, which states the same and indicates this mostly occurs during heavy server loads, something I noticed also.

I'm looking for a solution to keep my server running, but to do that I need to know more about this behaviour. Unfortunately both the CouchDB wiki and the guide don't give much information about this (only the parameter in the changes API).

Can someone provide more info about this?

like image 427
Peter Kruithof Avatar asked Dec 20 '10 09:12

Peter Kruithof


2 Answers

The couchdb -k should kill the background process and then couch should be restarted. However by default the restart feature is disabled. To enable it you should use -r parameter with value greater than 0. You can do it in bin/couchdb script - change RESPAWN_TIMEOUT from 0 to e.g. 5.

like image 148
Marek Avatar answered Sep 25 '22 00:09

Marek


Most likely heart is the heart launched when erlang vm starts up.

Take a look at heart switch here http://erlang.org/doc/man/erl.html and its documentation here http://erlang.org/doc/man/heart.html.

Now, you can either give a link to couch repo you use, so we can find a script with 'erl something -heart' or grep it out yourself.

I am not sure what is the status of couch build system.. do you use cloudant version or pure apache?

like image 25
user425720 Avatar answered Sep 22 '22 00:09

user425720