Geth node sync always behind

1 min read Original article ↗

System information

Geth version: 1.8.8-stable-2688dab4
OS & Version: Ubuntu Server 16.04, 2 cores, 8GB of RAM, 170GB SSD storage (aws c5.large)

Expected behaviour

Geth should be able to sync with network

Actual behaviour

Geth node is always couple hundred blocks behind and is not able to be fully in sync, after 40 hours I get:

> eth.syncing
{
  currentBlock: 5667131,
  highestBlock: 5667209,
  knownStates: 111239860,
  pulledStates: 111225435,
  startingBlock: 5664481
}

Previosly Geth was crashing due out of memory, I increased swap to 20GB, node is stable now, but falls behind.

Steps to reproduce the behaviour

Launch geth node with these params:

geth --syncmode "fast" --cache=2048 --maxpeers=128 --metrics --rpc --rpcapi "db,eth,net,web3,personal,web3" --rpcaddr "0.0.0.0" --rpcport 8545 --rpcvhosts "geth.domain.com"