[Ethereum] How to run geth at 512Mb RAM Digital Ocean droplet

digitaloceango-ethereummemory

When geth process consumes too much memory it gets killed (not at all gracefully) by Digital Ocean.

Partly solved the problem by implementing swap – Setting up geth Ethereum node to run automatically on Ubuntu. But still recieved one kill within 2 mln blocks download running geth –fast –cache=16.

Similar question: Is it possible to decrease RAM usage of go-ethereum(geth)? The answer here is – NO.

Is there a way to limit geth memory usage or maybe kill it "more gracefully" than Digital Ocean with something like monit?

Best Answer

It seems like 2 Gigs of swap and swappiness 30 is enough to run geth with no crashes with just 512 Mb of RAM.

It is almost 2 months now. I'm in full sync (block 3097083). And had no crashes ever. So I'm marking this answer as the right one.

I'm also monitoring geth with monit which will restart geth if it crashes.

My config in detail is here - How to run geth at 512Mb RAM Digital Ocean droplet