Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: WindListener on November 10, 2015, 01:08:13 PM



Title: Bitcoind gets extremely slow after running for a while
Post by: WindListener on November 10, 2015, 01:08:13 PM
Even commands like bitcoin-cli getbalance or getinfo take minutes to execute!

It's running on a 1GB ram VPS, with 4GB of swap. It's using most of the ram and 1GB of swap. It's a HDD vps, but nothing else is running on it but bitcoind.
So should be enough right?

Yet after running for several days it's becoming so slow I have to restart it. That fixes it for a while.
It's with the latest version for Ubuntu 14.04, all updated.


Title: Re: Bitcoind gets extremely slow after running for a while
Post by: Nexious on November 11, 2015, 07:06:39 AM
More RAM would most likely help, are you running a full node? Also check the mempool size when it starts to run slow, as with some of the 'attacks' lately the mempool can grow huge and cause some slow downs.


Title: Re: Bitcoind gets extremely slow after running for a while
Post by: unamis76 on November 11, 2015, 12:59:27 PM
My node with 4GB RAM struggles and crashed during the stress test so your node with 1GB is definitely struggling and swapping a lot... :)


Title: Re: Bitcoind gets extremely slow after running for a while
Post by: shorena on November 12, 2015, 07:38:46 AM
My node with 4GB RAM struggles and crashed during the stress test so your node with 1GB is definitely struggling and swapping a lot... :)

Have a VPS with 2 GB and can confirm this.

This is the memory usage from yesterday. As you can see the node is almost constantly at or over 1GB.

Code:
                | transactions  |memory usage   
yyyy-mm-dd-hh:mm|count|size in b|used|free     
------------------------------------------------
2015-11-11-00:00|6372|81348654|1055|992
2015-11-11-00:30|7433|81846914|1051|996
2015-11-11-01:00|5635|80818380|1052|995
2015-11-11-01:30|6015|80587507|1054|993
2015-11-11-02:00|5423|80351940|1052|995
2015-11-11-02:30|5684|80280093|1051|996
2015-11-11-03:00|6122|80514567|1051|996
2015-11-11-03:30|5002|80027616|1051|996
2015-11-11-04:00|5892|80907061|1051|996
2015-11-11-04:30|6918|81742174|1058|989
2015-11-11-05:00|4987|79836673|1052|995
2015-11-11-05:30|4709|79721534|1052|995
2015-11-11-06:00|5025|80065499|1056|991
2015-11-11-06:30|7727|81430918|1052|995
2015-11-11-07:00|8320|82095438|1053|994
2015-11-11-07:30|4698|79703537|1052|995
2015-11-11-08:00|5713|80191484|1052|995
2015-11-11-08:30|5781|80212697|1052|995
2015-11-11-09:00|4766|79682062|1052|995
2015-11-11-09:30|4869|79650538|1052|995
2015-11-11-10:00|5435|79756952|1052|995
2015-11-11-10:30|4968|79589412|1052|995
2015-11-11-11:00|5828|80225334|1052|995
2015-11-11-11:30|4874|79654212|1052|995
2015-11-11-12:00|6198|80526772|1052|995
2015-11-11-12:30|5418|80113424|1052|995
2015-11-11-13:00|4799|79558251|1052|995
2015-11-11-13:30|4934|79464049|1052|995
2015-11-11-14:00|4577|79301228|1053|994
2015-11-11-14:30|7489|80638846|1052|995
2015-11-11-15:00|8137|81405928|1052|995
2015-11-11-15:30|5464|79994536|1052|995
2015-11-11-16:00|4758|79503424|1052|995
2015-11-11-16:30|8436|81436653|1052|995
2015-11-11-17:00|5865|80435564|1052|995
2015-11-11-17:30|5641|80373791|1051|996
2015-11-11-18:00|9205|82948359|1049|998
2015-11-11-18:30|4781|79621596|1052|995
2015-11-11-19:00|6357|80456702|1052|995
2015-11-11-19:30|7142|80824997|1052|995
2015-11-11-20:00|7497|81500873|1051|996
2015-11-11-20:30|5299|79997235|1052|995
2015-11-11-21:00|5471|80057779|1052|995
2015-11-11-21:30|6840|80812994|1053|994
2015-11-11-22:00|6252|80725703|1052|995
2015-11-11-22:30|7014|81084155|1053|994
2015-11-11-23:00|5175|80314667|1053|994
2015-11-11-23:30|7824|81681685|1052|995

@OP
You might want to reduce the impact core has on memory.

Easiest way is to modify the bitcoin.conf, mainly the following settings

Code:
disablewallet=1 # no wallet 
dbcache=4    # limits database cache to 4 MB
minrelaytxfee=0.00002 # limits the number of TX that are held in memory, default for 0.11 is 0.00005, the higher the value the less TX are stored and passed along


Title: Re: Bitcoind gets extremely slow after running for a while
Post by: WindListener on November 12, 2015, 08:20:24 PM
I guess it's the RAM then.
But is it realistic that the swap use is making it THAT slow? yeah the swap is on HDD but still?

how do I check the mempool size?


shorena, thanks for the suggestions! I'll play with them tomorrow.
The node uses a wallet and it's a big one, so I'll skip the first setting but that reminds, can a huge wallet be a problem for the slowness too?


Title: Re: Bitcoind gets extremely slow after running for a while
Post by: shorena on November 12, 2015, 10:42:03 PM
I guess it's the RAM then.
But is it realistic that the swap use is making it THAT slow? yeah the swap is on HDD but still?

how do I check the mempool size?

getmempoolinfo[1]

shorena, thanks for the suggestions! I'll play with them tomorrow.
The node uses a wallet and it's a big one, so I'll skip the first setting but that reminds, can a huge wallet be a problem for the slowness too?

Probably, but Im not sure how a wallet influences the speed. The machine I use my wallet on has no speed issues.

[1] https://bitcoin.org/en/developer-reference#getmempoolinfo


Title: Re: Bitcoind gets extremely slow after running for a while
Post by: vayvanne on December 10, 2015, 10:55:13 PM
my guess is this is DDoS related issue.
I see the same on machine with 16GB RAM. there may be also the memory leak as I see constantly increasing mempoolsize.
most effect on this has -limitfreerelay=<n>