RPC connection fails after too many queries 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?
I haven't had this issue before and I've been spamming my RPC pretty hard.

Does your bitcoind already contain the whole blockchain or is it still updating?

There's a debug.log and db.log in the bitcoind data directory, I guess those will tell you what's wrong.