I am running unit tests against bitcoind which do JSON-RPC requests in high rate. Random failures are an issue. E.g. if you have something like this in printconsole logs:
ThreadRPCServer method=gettransaction
ThreadRPCServer method=gettransaction
ThreadRPCServer method=gettransaction
ThreadRPCServer method=gettransaction
....
ThreadRPCServer method=gettransaction
ThreadRPCServer method=gettransaction
sending: inv (37 bytes)
ThreadRPCServer method=gettransaction
ThreadRPCServer method=listtransactions
sending: inv (37 bytes)
You start getting:
synced with network?".format(name)) from e
cryptoassets.core.backend.bitcoind.BitcoindJSONError: Got timeout when doing bitcoin RPC call listtransactions.
I have tried with both reusing HTTP connection and not reusing HTTP connection with various results.
Are there any low hanging fruits to make bitcoind
RPC interface more stable (increase threads, concurrency, etc.?)
I am using the following Python JSON-RPC implementation:
https://github.com/jgarzik/python-bitcoinrpc/blob/master/bitcoinrpc/authproxy.py
UPDATE: Looks like the problematic call might be listtransactions
. When called at the same the time from command line using curl
there is no response either:
[~]% curl --user foo:bar --data-binary '{"id":"t0", "method": "listtransactions", "params": ["cryptoassets"] }' http://127.0.0.1:8332/ |python -m json.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:--100 70 0 0 100 70 0 58
rpcthreads=64
seems to work around the issue, but doesn't explain what's happening.