I'm building a node.js app that uses a json-rpc connection to fetch information from the bitcoin daemon.
It works great, except every once in a while, the RPC connection "fails." It goes down for anywhere from 1-20 seconds. Querying it via the command line gives the response:
error: couldn't connect to server. I have built in an error handling mechanism that waits a progressively larger amount of time for each unsuccessful connection, and it works well.
My problem, is over the course of progressively scanning the blockchain, over half of the running time is spent waiting for the daemon to come alive.
My thought was maybe its my hard drive/something with my computer, so I moved it to an ec2 instance (specifically c3.2xl) and moved the blockchain to the SSD. This actually increased the amount of time waiting versus running the node app locally.
Has anyone experienced this before and came up with a solution?