4

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.

odigity
  • 7,568
  • 4
  • 37
  • 51

1 Answers1

3

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.

odigity
  • 7,568
  • 4
  • 37
  • 51