<p>Are you sure 9051 is the right port for tor? 9050 is the default port.
You can check it by using <code>sudo netstat -plnt | grep ':9051'</code>.</p>

<p>And is the tor service active?</p>

<p>When it still doesn't works try disabling selinux(If you are running linux). I had some problems with tor because selinux was blocking it. But don't forget to put it back on. If it is selinux you can make a rule for tor/bitcoin in selinux.</p>

CC BY-SA 3.0
2016-11-13T23:55:48.160Z
Not having a network connection will not crash bitcoind. Only a hardware problem, a bug, or memory exhaustion can.
Pieter Wuille
CC BY-SA 3.0
2016-11-13T20:30:17.107Z
2016-11-13T20:30:17.107Z
Jan Wytze
<p><strong>EDIT 3</strong></p>

<p>Bumping my VPS to 1GB of physical RAM stopped the crashing issue... UNTIL said VPS ran out of disc space.</p>

<p>I added <code>prune=10240</code> to my <code>~/.bitcoin/bitcoin.conf</code> file such that the blockchain file would start pruning transaction history upon reaching 10GB filesize (1024 MB * 10 = 10GB).</p>

<p><strong>EDIT 2</strong></p>

<p>This seems to be a memory issue, not a VPN networking issue. I turned OpenVPN off and restarted <code>bitcoind</code> only to see it silently crash again.</p>

<p>I've now added a 1GB swapfile to expand the available memory space (risk is this will cause performance issues for the OS). Will update once again if this solves the issue. If not, I will probably end up trying to upgrade the VPS instance to 1GB of physical RAM from 512MB.</p>

<hr>

<p><strong>EDIT</strong>
Found some interesting stuff in the log relating to tor...</p>

<p><code>
root@sf-vps:~# cat ~/.bitcoin/debug.log | grep tor -i
2016-11-13 16:52:21 Default data directory /root/.bitcoin
2016-11-13 16:52:21 Using data directory /root/.bitcoin
2016-11-13 16:52:21 Using at most 125 connections (1024 file descriptors available)
2016-11-13 16:52:29 torcontrol thread start
2016-11-13 17:08:43 Default data directory /root/.bitcoin
2016-11-13 17:08:43 Using data directory /root/.bitcoin
2016-11-13 17:08:43 Using at most 125 connections (1024 file descriptors available)
2016-11-13 17:08:50 torcontrol thread start
2016-11-13 17:08:50 tor: Error connecting to Tor control socket
2016-11-13 17:08:50 tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect
2016-11-13 17:08:51 tor: Error connecting to Tor control socket
2016-11-13 17:08:51 tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect
2016-11-13 17:08:52 tor: Error connecting to Tor control socket
2016-11-13 17:08:52 tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect
</code></p>

<hr>

<p>I've installed the Bitcoin software on Ubuntu 16.04. I'm able to run <code>bitcoind -daemon</code> for a few minutes, but after a while the process crashes. </p>

<p>Interestingly, I don't see any reasons in <code>~/.bitcoin/debug.log</code> explaining why the program might have terminated.</p>

<p>I suspect a couple of things:</p>

<ol>
<li><strong>Not enough disc space to store the entire blockchain.</strong> However, I don't think this is the case as running <code>df - h</code> shows a combined total of only ~41% disc consumption:</li>
</ol>

<p><code>
root@sf-vps:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            241M     0  241M   0% /dev
tmpfs            50M  3.1M   47M   7% /run
/dev/vda1        20G  6.3G   13G  34% /
tmpfs           247M     0  247M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           247M     0  247M   0% /sys/fs/cgroup
tmpfs            50M     0   50M   0% /run/user/0
</code></p>

<ol start="2">
<li><strong>Server is not able to receive inbound messages as I'm running a VPN.</strong> Is it possible that I'm experiencing a networking issue, e.g. inbound traffic to port 8333 (the default for <code>bitcoind</code>) is not being allowed through my VPN? I can't remember how to change the VPN config to allow connections on specific ports, but that's where I'm looking next...</li>
</ol>

<p><code>
root@sf-vps:~# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         159.203.240.1   0.0.0.0         UG        0 0          0 eth0
10.8.0.0        10.8.0.2        255.255.255.0   UG        0 0          0 tun0
10.8.0.2        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
10.12.0.0       0.0.0.0         255.255.0.0     U         0 0          0 eth0
159.203.240.0   0.0.0.0         255.255.240.0   U         0 0          0 eth0
</code>
Thanks in advance for your help :)</p>

CC BY-SA 3.0
2016-11-13T17:18:00.063Z
How much memory? Bitcoind needs around 1 GB of free RAM.
Pieter Wuille
CC BY-SA 3.0
2016-11-14T17:36:13.917Z
@PieterWuille I have 512MB physical memory in the instance. I created a swap file with 1GB of virtual memory (believe I'm using these terms correctly here). It lasted a little longer after turning the swapfile on (`swapon /swapfile`) but crashed once again. Perhaps I just need a beefier VPS?
mecampbellsoup
CC BY-SA 3.0
2016-11-14T17:59:10.337Z
Yes, you definitely need more memory.
Pieter Wuille
CC BY-SA 3.0
2016-11-14T19:20:30.597Z
Read your system logfiles (`/var/log/syslog`).  If the system runs out of memory and kills bitcoind, you'll see it logged there.  It may also be helpful to run bitcoind without `-daemon` as a test; it will be easier to see what happens when it dies.
Nate Eldredge
CC BY-SA 3.0
2016-11-15T13:46:45.817Z
@PieterWuille would adjusting any of the following configuration options reduce the memory footprint consumed by `bitcoind`: `disablewallet`, `dbcache`, `prune`, `maxorphantx`, `maxmempool`?
mecampbellsoup
<blockchain><bitcoind><storage-footprint><memory>
bitcoind crashing due to insufficient memory?
mecampbellsoup
# bitcoind crashing due to insufficient memory?

(Asked by: username_0 on 2016-11-13)

**EDIT 3**

Bumping my VPS to 1GB of physical RAM stopped the crashing issue... UNTIL said VPS ran out of disc space.

I added `prune=10240` to my `~/.bitcoin/bitcoin.conf` file such that the blockchain file would start pruning transaction history upon reaching 10GB filesize (1024 MB \* 10 = 10GB).

**EDIT 2**

This seems to be a memory issue, not a VPN networking issue. I turned OpenVPN off and restarted `bitcoind` only to see it silently crash again.

I've now added a 1GB swapfile to expand the available memory space (risk is this will cause performance issues for the OS). Will update once again if this solves the issue. If not, I will probably end up trying to upgrade the VPS instance to 1GB of physical RAM from 512MB.

---

**EDIT**
Found some interesting stuff in the log relating to tor...

`root@sf-vps:~# cat ~/.bitcoin/debug.log | grep tor -i
2016-11-13 16:52:21 Default data directory /root/.bitcoin
2016-11-13 16:52:21 Using data directory /root/.bitcoin
2016-11-13 16:52:21 Using at most 125 connections (1024 file descriptors available)
2016-11-13 16:52:29 torcontrol thread start
2016-11-13 17:08:43 Default data directory /root/.bitcoin
2016-11-13 17:08:43 Using data directory /root/.bitcoin
2016-11-13 17:08:43 Using at most 125 connections (1024 file descriptors available)
2016-11-13 17:08:50 torcontrol thread start
2016-11-13 17:08:50 tor: Error connecting to Tor control socket
2016-11-13 17:08:50 tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect
2016-11-13 17:08:51 tor: Error connecting to Tor control socket
2016-11-13 17:08:51 tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect
2016-11-13 17:08:52 tor: Error connecting to Tor control socket
2016-11-13 17:08:52 tor: Not connected to Tor control port 127.0.0.1:9051, trying to reconnect`

---

I've installed the Bitcoin software on Ubuntu 16.04. I'm able to run `bitcoind -daemon` for a few minutes, but after a while the process crashes.

Interestingly, I don't see any reasons in `~/.bitcoin/debug.log` explaining why the program might have terminated.

I suspect a couple of things:

1. **Not enough disc space to store the entire blockchain.** However, I don't think this is the case as running `df - h` shows a combined total of only ~41% disc consumption:

`root@sf-vps:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 241M 0 241M 0% /dev
tmpfs 50M 3.1M 47M 7% /run
/dev/vda1 20G 6.3G 13G 34% /
tmpfs 247M 0 247M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 247M 0 247M 0% /sys/fs/cgroup
tmpfs 50M 0 50M 0% /run/user/0`

2. **Server is not able to receive inbound messages as I'm running a VPN.** Is it possible that I'm experiencing a networking issue, e.g. inbound traffic to port 8333 (the default for `bitcoind`) is not being allowed through my VPN? I can't remember how to change the VPN config to allow connections on specific ports, but that's where I'm looking next...

`root@sf-vps:~# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 159.203.240.1 0.0.0.0 UG 0 0 0 eth0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
10.12.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
159.203.240.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0`
Thanks in advance for your help :)

**Tags:** blockchain, bitcoind, storage-footprint, memory

> **Comments:**
> **username_1**: How much memory? Bitcoind needs around 1 GB of free RAM.  
> **username_0**: @PieterWuille I have 512MB physical memory in the instance. I created a swap file with 1GB of virtual memory (believe I'm using these terms correctly here). It lasted a little longer after turning the swapfile on (`swapon /swapfile`) but crashed once again. Perhaps I just need a beefier VPS?  
> **username_1**: Yes, you definitely need more memory.  
> **username_2**: Read your system logfiles (`/var/log/syslog`).  If the system runs out of memory and kills bitcoind, you'll see it logged there.  It may also be helpful to run bitcoind without `-daemon` as a test; it will be easier to see what happens when it dies.  
> **username_0**: @PieterWuille would adjusting any of the following configuration options reduce the memory footprint consumed by `bitcoind`: `disablewallet`, `dbcache`, `prune`, `maxorphantx`, `maxmempool`?  

---

## 1 answers

### Answer by username_3 on 2016-11-13. Score: 0

Are you sure 9051 is the right port for tor? 9050 is the default port.
You can check it by using `sudo netstat -plnt | grep ':9051'`.

And is the tor service active?

When it still doesn't works try disabling selinux(If you are running linux). I had some problems with tor because selinux was blocking it. But don't forget to put it back on. If it is selinux you can make a rule for tor/bitcoin in selinux.

> **Comments:**
> **username_1**: Not having a network connection will not crash bitcoind. Only a hardware problem, a bug, or memory exhaustion can.  

---

