[Ethereum] Restrict CPU/memory usage of geth while syncing

cpugo-ethereummemory

I'm trying to run a geth node and a bitcoin core node on one server. I started with a DigitalOcean droplet with 2 CPU and 2GB memory, but both the geth and bitcoin node would run out of memory. I upgraded it to 2 CPU and 4GB memory, but I notice that geth will take up 99% of the servers resources, no matter what configuration (unless maybe running a 16GB memory droplet, which is no option).

This results in the bitcoin node running out of memory and exiting.

Is there a way to ensure that geth only takes up max 50% cpu/memory? I don't want to split my setup to several nodes, increasing the complexity of my project's architecture.

Thanks

Best Answer

For CPU try cpulimit, you will find guide here for RAM you can use ulimit, please refer here

PS. for my machine geth is resource hogging no matter what. Right now, it uses almost 10 GB of RAM, while system has 12 GB total. So I guess that's normal for eth.

Related Topic