<p>RAM. That's it.
I have 32 GB on board, but although it was enough until recently the node &amp; db-sync combined on one machine are using about 26 GB - which on Ubuntu, unless I do some tweaking, makes 32 GB not quite enough.</p>
<p>Thanks George &amp; Erik.
here's a couple screen caps to show:</p>
<p><a href="https://i.sstatic.net/vSLg3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vSLg3.png" alt="enter image description here" /></a></p>
<p><a href="https://i.sstatic.net/aKdNa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/aKdNa.png" alt="enter image description here" /></a></p>
<p>Luckily the system tells me there's space enough to expand to 64 GB, so I will.</p>
<p><a href="https://i.sstatic.net/YMFFm.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/YMFFm.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-10-31T07:07:27.347Z
The best solution is to add RAM, but adding say 8G of swap space might be a good shorter term solution.
Erik de Castro Lopo
CC BY-SA 4.0
2022-10-31T06:49:49.883Z
2022-10-31T07:14:57.133Z
2022-10-31T07:14:57.133Z
RelevantData
<p><code>db-sync</code> has a rather high memory usage. We (I am one of the developers) are working on reducing it, but for now, the only solution is to provide more memory.</p>
<p>If you are running <code>node</code> on the same machine as <code>db-sync</code> (this is the recommended setup) the machine will likely need 32G of RAM.</p>

CC BY-SA 4.0
2022-10-30T07:48:53.707Z
I am not sure for the current version, but the previous version (which worked with cardano-node 1.34.1) did not run for many days with only 32 GB of RAM. I had to increase to 48 GB RAM to avoid it being killed for out of memory.
George - APEX Stake Pool
CC BY-SA 4.0
2022-10-30T17:08:47.877Z
ok, thank you George & Erik. I got a machine that has 32 GB of RAM as that was the spec given in the docs at the time I was setting it up. I will examine using dmesg -T to see if that msg is indicating RAM exhaustion is indeed the culprit. 
If so, I'll just be glad I have determined the cause and buy more RAM.
I will say though: pre-Vasil HF I was running on the 32 GB of RAM and never experienced the same over months of running.

I will leave this open and once examined, report back here.
RelevantData
CC BY-SA 4.0
2022-10-30T19:19:09.250Z
This has little or nothing to do with Vasil. Its caused by the growing size of the blockchain itself and the number of stake addresses slowly increasing.
Erik de Castro Lopo
CC BY-SA 4.0
2022-12-01T21:35:07.107Z
Even with 32G you will still need swap space.
Erik de Castro Lopo
CC BY-SA 4.0
2022-10-29T10:05:45.377Z
2022-10-29T10:05:45.377Z
Erik de Castro Lopo
<p>Most likely it is killed because the server's RAM is exhausted. How much RAM does the server have? I assume it is running on mainnet.
You can double check with <code>dmesg -T</code> to see if it was really killed for <code>Out of Memory</code> (oom).
You should see something like this (but for cardano-db-sync, not for cardano-node):</p>
<pre><code>[Wed Sep 21 15:18:41 2022] Out of memory: Kill process 77436 (cardano-node) score 637 or sacrifice child
[Wed Sep 21 15:18:41 2022] Killed process 77436 (cardano-node) total-vm:1075768476kB, anon-rss:13651644kB, file-rss:0kB, shmem-rss:0kB
</code></pre>

CC BY-SA 4.0
2022-10-29T07:58:48.880Z
2022-10-29T07:58:48.880Z
George - APEX Stake Pool
<p>I have cardano-node and db-sync running just fine, latest versions.
Every now and then though, db-sync stops and message in console says &quot;Killed&quot;.
This was not the case before the Vasil HF.</p>
<p>Why does db-sync stop and exit with message &quot;Killed&quot; ?</p>
<p>I start it back up, and it starts np - and runs fine for awhile, but sooner or later, after days...for some reason it will stop and the last thing in the console window is one line with the word: Killed.</p>

<cardano-node><cardano-db-sync>
db-sync "Killed" sometimes. Why?
# db-sync "Killed" sometimes. Why?

(Asked by: username_0 on 2022-10-29)

I have cardano-node and db-sync running just fine, latest versions.
Every now and then though, db-sync stops and message in console says "Killed".
This was not the case before the Vasil HF.

Why does db-sync stop and exit with message "Killed" ?

I start it back up, and it starts np - and runs fine for awhile, but sooner or later, after days...for some reason it will stop and the last thing in the console window is one line with the word: Killed.

**Tags:** cardano-node, cardano-db-sync

---

## 3 answers

### Answer by username_0 on 2022-10-31. Score: -1 | Accepted answer

RAM. That's it.
I have 32 GB on board, but although it was enough until recently the node & db-sync combined on one machine are using about 26 GB - which on Ubuntu, unless I do some tweaking, makes 32 GB not quite enough.

Thanks George & Erik.
here's a couple screen caps to show:

[![enter image description here](https://i.sstatic.net/vSLg3.png)](https://i.sstatic.net/vSLg3.png)

[![enter image description here](https://i.sstatic.net/aKdNa.png)](https://i.sstatic.net/aKdNa.png)

Luckily the system tells me there's space enough to expand to 64 GB, so I will.

[![enter image description here](https://i.sstatic.net/YMFFm.png)](https://i.sstatic.net/YMFFm.png)

> **Comments:**
> **username_1**: The best solution is to add RAM, but adding say 8G of swap space might be a good shorter term solution.  

---

### Answer by username_1 on 2022-10-29. Score: 5

`db-sync` has a rather high memory usage. We (I am one of the developers) are working on reducing it, but for now, the only solution is to provide more memory.

If you are running `node` on the same machine as `db-sync` (this is the recommended setup) the machine will likely need 32G of RAM.

> **Comments:**
> **username_2**: I am not sure for the current version, but the previous version (which worked with cardano-node 1.34.1) did not run for many days with only 32 GB of RAM. I had to increase to 48 GB RAM to avoid it being killed for out of memory.  
> **username_0**: ok, thank you George & Erik. I got a machine that has 32 GB of RAM as that was the spec given in the docs at the time I was setting it up. I will examine using dmesg -T to see if that msg is indicating RAM exhaustion is indeed the culprit.  If so, I'll just be glad I have determined the cause and buy more RAM. I will say though: pre-Vasil HF I was running on the 32 GB of RAM and never experienced the same over months of running.  I will leave this open and once examined, report back here.  
> **username_1**: This has little or nothing to do with Vasil. Its caused by the growing size of the blockchain itself and the number of stake addresses slowly increasing.  
> **username_1**: Even with 32G you will still need swap space.  

---

### Answer by username_2 on 2022-10-29. Score: 4

Most likely it is killed because the server's RAM is exhausted. How much RAM does the server have? I assume it is running on mainnet.
You can double check with dmesg -T to see if it was really killed for Out of Memory (oom).
You should see something like this (but for cardano-db-sync, not for cardano-node):
[Wed Sep 21 15:18:41 2022] Out of memory: Kill process 77436 (cardano-node) score 637 or sacrifice child
[Wed Sep 21 15:18:41 2022] Killed process 77436 (cardano-node) total-vm:1075768476kB, anon-rss:13651644kB, file-rss:0kB, shmem-rss:0kB


---

