Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Anonymous on August 12, 2011, 02:18:03 AM



Title: Stop and restart bitcoind every day?
Post by: Anonymous on August 12, 2011, 02:18:03 AM
I was wondering. Can bitcoind stay open all the time without any issues. I am having problems where bitcoind gets "hung up" every week of constant running or so. "hung up" meaning that it is not responding to any RPC calls. Do you think it is wise for me to have a cron job every day at that performs the command "bitcoind stop; sleep 10; bitcoind &". Or is that not necessary.

Thanks,
macintosh264


Title: Re: Stop and restart bitcoind every day?
Post by: JoelKatz on August 12, 2011, 02:22:07 AM
First, use
Code:
bitcoind -daemon
instead of &. Second, it shouldn't be necessary. I've never had an issue. When it's hung, what are the last few lines in your debug log? (The 'debug.log' file in your bitcoin data directory.)


Title: Re: Stop and restart bitcoind every day?
Post by: markm on August 12, 2011, 05:12:41 AM
I used to be able to regularly hang bitcoind simply by asking for the address of several different accounts.

I eventually worked-around it by always asking for a new address of an account named "throwaways" before asking for an account's actual current address.

Probably people who always ask for a new address instead of a current address never even saw this problem, and I do not know if it was ever fixed because all my scripts use the work-around.

-MarkM-


Title: Re: Stop and restart bitcoind every day?
Post by: Anonymous on August 12, 2011, 07:04:51 PM
I used to be able to regularly hang bitcoind simply by asking for the address of several different accounts.

I eventually worked-around it by always asking for a new address of an account named "throwaways" before asking for an account's actual current address.

Probably people who always ask for a new address instead of a current address never even saw this problem, and I do not know if it was ever fixed because all my scripts use the work-around.

-MarkM-


Thanks for that and thank you JoelKatz for that tip.


Title: Re: Stop and restart bitcoind every day?
Post by: BitVapes on August 13, 2011, 05:10:03 AM
I haven't had any issues leaving bitcoind -daemon running for days at a time.  You might want to restart it occasionally, only because the debug.log file can grow to a large size and it gets trimmed when you restart.  You can also handle this with logrotate instead.


Title: Re: Stop and restart bitcoind every day?
Post by: jfreak53 on August 16, 2011, 08:28:20 PM
It's not hard to restart every day once a day, we do this on all our servers bitcoind clients since bitcoind has some major major memory leak problems.  Hence a quick, killall -9 bitcoind or "bitcoind stop" then bitcoind -daemon works great to clear out ram usage since it can grow quite large and it doesn't seem to clean itself out as it goes either.


Title: Re: Stop and restart bitcoind every day?
Post by: Furyan on August 17, 2011, 12:42:54 PM
I have set up Monit on my server to monitor bitcoind's memory usage.  When it rises above a particular threshold, it is restarted.

I don't like having to do that since work records are lost (bitcoin keeps track of the work units it issues until the next block is generated) but it's better to do that than have the server lock up.