<p>A very big chunk of memory usage for dbsync comes from <code>ledger-state</code> - you can disable this component if you do not require things like <code>epoch_stake</code>, <code>ada_pots</code>, etc.
You can read more about it <a href="https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/configuration.md#--disable-ledger" rel="nofollow noreferrer">here</a>.</p>
<p>If you do require these, 48GB RAM IMO is bar minimum, and 64GB is ideal (for instance, if you optimise Postgres configurations to serve more processing capacity and less IO dependency)</p>

CC BY-SA 4.0
2022-11-14T05:35:46.333Z
Was not aware of those options, I shall examine that, ty!
RelevantData
CC BY-SA 4.0
2022-11-14T05:45:14.133Z
"migrating to a no ledger schema"
was reported after relaunching db-sync with the --disable-ledger flag added!
RelevantData
CC BY-SA 4.0
2022-11-14T06:46:34.060Z
Appears to work like a charm @RdLrt = thank you!
RelevantData
CC BY-SA 4.0
2022-11-21T19:32:45.443Z
That is excellent advice mate. Absolutely beautiful!!!
Patrick Sturm
CC BY-SA 4.0
2022-11-22T02:08:17.897Z
I am doing this and the memory usage is MUCH less - thank you.
RelevantData
CC BY-SA 4.0
2022-11-14T00:34:17.083Z
2022-11-14T00:34:17.083Z
RdLrT
<p>Yes, you can do it. Run cardano-node on one of the machines and cardano-db-sync on the other, and use socat to connect from the cardano-db-sync machine to the cardano-node's socket file. This is how I am doing it.</p>

CC BY-SA 4.0
2022-11-15T17:37:10.390Z
Thank you. A machine that supports 64 GB RAM is more expensive than many that only support up to 32 GB, so this being an option - using socat, is a great option. I will try it too. Right now I am running without issue since using the  --disable-ledger option at db-sync startup as suggested by RdLrT.
RelevantData
CC BY-SA 4.0
2022-11-15T17:39:51.547Z
Is it fairly straightforward to use socat for this purpose? 
I have 2 machines, both with 32 GB RAM, both on the LAN, both running Ubuntu with cardano-node and cardano-db-sync installed and ready to be launched.
RelevantData
CC BY-SA 4.0
2022-11-16T09:57:42.997Z
Yes, it is very simple.On the machine where the cardano-node is running, you run this:
`/usr/bin/socat TCP-LISTEN:3081,reuseaddr,fork UNIX-connect:/path/to/your/node.socket`
On the machine with the cardano-db-sync, you run:
`socat UNIX-LISTEN:/run/cardano-node.socket,fork,reuseaddr,unlink-early,user=<your_user>,group=<your_group>,mode=755 TCP:<cardano-node-ip>:3081`
And you will have your socket as `/run/cardano-node.socket` (you can set any path you like). Use the user and the group you are running cardano-db-sync with. You can also use any port you want.
George - APEX Stake Pool
CC BY-SA 4.0
2022-11-22T02:08:55.513Z
Thank you for these detailed instructions! Very helpful!
RelevantData
CC BY-SA 4.0
2022-11-14T19:38:15.013Z
2022-11-14T19:38:15.013Z
George - APEX Stake Pool
<p>I currently have cardano-node and db-sync running on the same machine. The machine has a max RAM capacity of 32 GB and this is barely enough. Instead of buying a new machine that supports 64 GB RAM, I could use another machine I have of 32 GB RAM, to run only db-sync, on the same LAN as cardano-node.</p>
<p>I'd like to hear from anyone that has run cardano-node and db-sync both on the same machine as well as on different machines on the same LAN to see if you decided it had to be both cardano-node and db-sync on the same machine because on separate machines proved too slow?</p>

<cardano-node><cardano-db-sync>
Running db-sync on a separate machine from node on same LAN
# Running db-sync on a separate machine from node on same LAN

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

I currently have cardano-node and db-sync running on the same machine. The machine has a max RAM capacity of 32 GB and this is barely enough. Instead of buying a new machine that supports 64 GB RAM, I could use another machine I have of 32 GB RAM, to run only db-sync, on the same LAN as cardano-node.

I'd like to hear from anyone that has run cardano-node and db-sync both on the same machine as well as on different machines on the same LAN to see if you decided it had to be both cardano-node and db-sync on the same machine because on separate machines proved too slow?

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

---

## 2 answers

### Answer by username_3 on 2022-11-14. Score: 2 | Accepted answer

Yes, you can do it. Run cardano-node on one of the machines and cardano-db-sync on the other, and use socat to connect from the cardano-db-sync machine to the cardano-node's socket file. This is how I am doing it.

> **Comments:**
> **username_0**: Thank you. A machine that supports 64 GB RAM is more expensive than many that only support up to 32 GB, so this being an option - using socat, is a great option. I will try it too. Right now I am running without issue since using the  --disable-ledger option at db-sync startup as suggested by RdLrT.  
> **username_0**: Is it fairly straightforward to use socat for this purpose?  I have 2 machines, both with 32 GB RAM, both on the LAN, both running Ubuntu with cardano-node and cardano-db-sync installed and ready to be launched.  
> **username_3**: Yes, it is very simple.On the machine where the cardano-node is running, you run this: `/usr/bin/socat TCP-LISTEN:3081,reuseaddr,fork UNIX-connect:/path/to/your/node.socket` On the machine with the cardano-db-sync, you run: `socat UNIX-LISTEN:/run/cardano-node.socket,fork,reuseaddr,unlink-early,user=<your_user>,group=<your_group>,mode=755 TCP:<cardano-node-ip>:3081` And you will have your socket as `/run/cardano-node.socket` (you can set any path you like). Use the user and the group you are running cardano-db-sync with. You can also use any port you want.  
> **username_0**: Thank you for these detailed instructions! Very helpful!  

---

### Answer by username_1 on 2022-11-14. Score: 2

A very big chunk of memory usage for dbsync comes from `ledger-state` - you can disable this component if you do not require things like `epoch_stake`, `ada_pots`, etc.
You can read more about it [here](https://github.com/input-output-hk/cardano-db-sync/blob/master/doc/configuration.md#--disable-ledger).

If you do require these, 48GB RAM IMO is bar minimum, and 64GB is ideal (for instance, if you optimise Postgres configurations to serve more processing capacity and less IO dependency)

> **Comments:**
> **username_0**: Was not aware of those options, I shall examine that, ty!  
> **username_0**: "migrating to a no ledger schema" was reported after relaunching db-sync with the --disable-ledger flag added!  
> **username_0**: Appears to work like a charm @RdLrt = thank you!  
> **username_2**: That is excellent advice mate. Absolutely beautiful!!!  
> **username_0**: I am doing this and the memory usage is MUCH less - thank you.  

---

