Krona Rev (OP)
|
|
July 29, 2014, 08:30:49 PM |
|
I've been running bitcoind on a VPS for a few months. A few days ago it crashed. Since then every time I restart it it runs out of memory within a minute or two. The VPS has 1GB of RAM and I'm not running anything else. Here is exactly what it says: ************************ EXCEPTION: St9bad_alloc std::bad_alloc bitcoin in AppInit()
terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
The last time I was successfully running it I had version 0.9.1. When it wouldn't restart I upgraded to 0.9.2.1, but the same thing happens. Can anyone help? Thanks!
|
|
|
|
Challisto
Newbie
Offline
Activity: 13
Merit: 0
|
|
July 29, 2014, 08:38:57 PM |
|
I don't think 1GB is enough to run Bitcoin and an OS. Currently it's using 800MB on my machine.
|
|
|
|
Krona Rev (OP)
|
|
July 29, 2014, 08:50:42 PM |
|
If 1GB RAM isn't enough, I'll probably just give up the VPS and stop running a node. That would be a shame.
|
|
|
|
shorena
Copper Member
Legendary
Offline
Activity: 1498
Merit: 1562
No I dont escrow anymore.
|
|
July 29, 2014, 09:45:10 PM |
|
I have an 2Gig machine that runs a node just fine, its on win7 and testnet though. But I cant imagine that 1 gig shouldnt be enough.
Can you check how much ram (according to the OS) was used, how many connections where open and whether or not the VM actually gave you a full gig at the time of the crash?
It might just be bad VMWare running in the background.
|
Im not really here, its just your imagination.
|
|
|
oldbute
Jr. Member
Offline
Activity: 59
Merit: 10
|
|
July 30, 2014, 02:42:19 AM |
|
For what it's worth I run a full node with 1GB RAM. Dipping into swap a bit but it has never complained @AOpen:~# bitcoind getinfo { "version" : 90000, "protocolversion" : 70002, "walletversion" : 60000, "balance" : 0.00000000, "blocks" : 313092, "timeoffset" : -243, "connections" : 45, "proxy" : "", "difficulty" : 18736441558.31023788, "testnet" : false, "keypoololdest" : 1386727402, "keypoolsize" : 101, "paytxfee" : 0.00000000, "errors" : "" } @AOpen:~# free -m total used free shared buffers cached Mem: 1000 916 84 0 17 197 -/+ buffers/cache: 701 299 Swap: 1953 370 1583
|
|
|
|
AuroraHF
|
|
July 30, 2014, 02:44:21 AM |
|
I don't think 1GB is enough to run Bitcoin and an OS. Currently it's using 800MB on my machine.
It's perfectly fine to run BitcoinD on a 1 GB VPS. What OS are you using, OP?
|
lmao
|
|
|
gweedo
Legendary
Offline
Activity: 1498
Merit: 1000
|
|
July 30, 2014, 02:50:00 AM |
|
2GB is required, and you will probably want some swap as well.
|
|
|
|
AuroraHF
|
|
July 30, 2014, 02:51:45 AM |
|
2GB is required, and you will probably want some swap as well.
Well now that you mentioned it, my VPS had 512 MB VSwap. So yeah, OP you need to get a more robust VPS, or at least something with some VSwap.
|
lmao
|
|
|
Krona Rev (OP)
|
|
July 30, 2014, 06:32:11 AM |
|
Thanks for the help. The VPS is running Ubuntu 12.04.4 LTS. According to free -m there is no swap space, which might be causing the problem.
I don't get to the point where I can call bitcoind getinfo because bitcoind -daemon is still in the initial phase before it dies. After calling bitcoind I can use top or free -m to watch the memory usage climb until it hits 1GB and dies.
|
|
|
|
gweedo
Legendary
Offline
Activity: 1498
Merit: 1000
|
|
July 30, 2014, 06:37:16 AM |
|
You need swap, that is the problem.
|
|
|
|
Krona Rev (OP)
|
|
July 30, 2014, 05:10:09 PM |
|
Oh well. No full node for me.
I'm curious: Does anyone know why it worked for the past 3 months, but then stopped working now? My best guess is that the main use of RAM is the utxo set. Has the number of utxo's increased recently?
|
|
|
|
DeathAndTaxes
Donator
Legendary
Offline
Activity: 1218
Merit: 1086
Gerald Davis
|
|
July 30, 2014, 05:51:35 PM |
|
It has been slowly and continually increasing pretty much forever. There is no large and significant change to the UTXO in the last week it probably was just the straw which broke the VPS's back.
|
|
|
|
gmaxwell
Moderator
Legendary
Offline
Activity: 4326
Merit: 8971
|
|
July 30, 2014, 06:50:06 PM |
|
The UTXO set is not kept in ram, just caches. Block headers are, however... and there are various overheads related to peers and such. Beyond block headers the mempool is probably one of the biggest memory users.
|
|
|
|
ponzigo
Member
Offline
Activity: 92
Merit: 10
|
|
July 30, 2014, 07:08:33 PM |
|
You have 2 options
1 - Create a swap file. 2 - Run the client using a low number of connections so it uses less ram.
Im more concerned about using in a 30 gb server... because in 2 months we will need to switch to pay the double.
|
Don't bring to bitcointalk your shitty scams. I'll try them and tell the truth.
|
|
|
btchris
|
|
July 30, 2014, 07:18:29 PM |
|
Thanks for the help. The VPS is running Ubuntu 12.04.4 LTS. According to free -m there is no swap space, which might be causing the problem.
Oh well. No full node for me.
Silly question perhaps, but have you tried adding swap space? cat /proc/swaps sudo fallocate -l 1G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudoedit /etc/fstab # Add the following one line to the end of fstab, then save & exit: /swapfile none swap sw sudo swapon -a cat /proc/swaps
Just be aware that this might cost you $ with some VPS providers, e.g. Amazon EC2 (although it's free with others, e.g. Digital Ocean).
|
|
|
|
Krona Rev (OP)
|
|
July 30, 2014, 07:51:50 PM |
|
Thanks for the clarifications and suggestions everyone. I tried running it with maxconnections=1, but this also ran out of memory. I hadn't even considered creating a swap file on my own, so it wasn't a silly question at all. I have root access, so I tried. My VPS provider was prepared: fallocate -l 1G /swapfile fallocate: /swapfile: fallocate failed: Operation not supported
Edit: I now realize I might be able to do this in other ways than fallocate. I'll keep working on it.
|
|
|
|
Krona Rev (OP)
|
|
July 30, 2014, 08:09:23 PM |
|
I created a 1GB swapfile (using dd) and added it as swap space.
bitcoind runs again! Thanks!
|
|
|
|
rz20
Legendary
Offline
Activity: 1330
Merit: 1001
|
|
July 30, 2014, 08:35:48 PM |
|
Just for anybody that needs more than 1gb to run bitcoind.
This will create a 256mb swap file sudo dd if=/dev/zero of=/swapfile bs=1024 count=256k sudo mkswap /swapfile sudo swapon /swapfile
This will create a 1gb swap file sudo dd if=/dev/zero of=/swapfile bs=2048 count=512k sudo mkswap /swapfile sudo swapon /swapfile
If you want multiple files change /swapfile for /swapfile2
|
|
|
|
codegeek
Newbie
Offline
Activity: 42
Merit: 0
|
|
July 30, 2014, 09:48:40 PM |
|
You need far more memory than that, first of all.
|
|
|
|
Newar
Legendary
Offline
Activity: 1358
Merit: 1001
https://gliph.me/hUF
|
|
July 31, 2014, 02:36:41 AM |
|
Mine runs fine on 512 memory and 512 swap.
I had to ask the VPS operator to increase the swap space as the ways I tried wouldn't work.
|
|
|
|
|