Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to maximize bitcoind JSON-RPC performance?

Does anyone have suggestions for optimizing a script that reads the blockchain from JSON-RPC? Is it possible to use HTTP/1.1 keepalive to avoid re-stablishing a TCP connection for each query? Does the JSON-RPC service support concurrency?

UPDATE

I am able to telnet to the port in two different terminals at the same time, so it can definitely handle multiple simultaneous connections. I'd still like to know more about how it's implemented internally (threads? events?), and how increasing the number of simultaneous clients would affect total throughput.

like image 642
odigity Avatar asked Oct 26 '25 07:10

odigity


1 Answers

Did some more searching and found some answers! Assuming this post can be trusted:

https://bitcointalk.org/index.php?topic=110243.0

JSON-RPC API

  • Internal HTTP server is now thread-per-connection, rather than a single-threaded queue that would stall on network I/O.
  • Internal HTTP server supports HTTP/1.1, pipelined requests and connection keep-alive.
  • Support JSON-RPC 2.0 batches, to encapsulate multiple JSON-RPC requests within a single HTTP request.

Going to go implement keep-alive, pipelining and/or JSON-RPC 2.0 batches and see what kind of performance gains I can get.

like image 50
odigity Avatar answered Oct 29 '25 05:10

odigity



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!