CouchDB heart-beat time-out
Asked Answered
B

2

5

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?

Brandenburg answered 20/12, 2010 at 9:49 Comment(1)
The issue you referenced states that the problem is related to the erlang vm version and seemes to be fixed in R13B. Which version are you using?Roister
L
6

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.

Landri answered 7/1, 2011 at 8:46 Comment(1)
I gave up on using CouchDB's built-in restart, and relied on external scripts — everything from a simple while/sleep loop to an upstart script would end up being more reliable. (This may have improved after 1.6.1, according to someone who may have finally taken the time to figure out the underlying cause: issues.apache.org/jira/browse/COUCHDB-1917)Execrative
S
1

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?

Shauna answered 20/12, 2010 at 15:33 Comment(2)
I'm using a repository to maintain my CouchDB installation: rpmfind.net/linux/RPM/dag/redhat/el5/x86_64/…Brandenburg
try to modify bin/couchdb.tpl.in (HEART_BEAT_TIMEOUT) but it is a wild guess, so maybe someone more experienced can help you.Shauna

© 2022 - 2024 — McMap. All rights reserved.