chaingraph icon indicating copy to clipboard operation
chaingraph copied to clipboard

BCHN: improve network responsiveness during IBD

Open bitjson opened this issue 4 years ago • 1 comments

When deploying a new Chaingraph instance from scratch, the cluster includes one or more nodes which need to initially download and verify the blockchain (Initial Block Download, IBD). The Chaingraph agent is able to start syncing from these nodes even before IBD is complete because the nodes are configured to whitelist the agent.

However in practice, Bitcoin Cash Node (BCHN) is very slow to respond to requests from the agent during IBD, and can sometimes take over a minute to send a block back (even for the <1KB blocks from the early years.)

Because of this latency, it typically takes ~2.5 hours for a well-provisioned cluster to begin syncing blocks at the maximum speed of the database. After this initial delay, the Chaingraph sync requires 6-7 additional hours to complete.

If we could configure BCHN to prioritize these network requests during IBD, we could likely cut down Chaingraph's total sync time by >2 hours. (Combined with #5, we may be able to cut total sync + indexing times down to just a few hours.)

I also suspect that IBD for BCHN is usually bound on CPU/memory rather than disk read/write, so tuning BCHN to respond faster would allow Chaingraph to start syncing that data without significantly impacting the IBD time of the BCHN instance.

The only eventual change required in Chaingraph will be to upgrade the BCHN image once some release with this improvement is available, but I'll leave this issue open to track progress. I'll open and link to an issue in the BCHN issue tracker too.

bitjson avatar Nov 20 '21 00:11 bitjson

Issue opened: https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/issues/346

bitjson avatar Nov 20 '21 00:11 bitjson