Bitcoind JSON-RPC is very slow for dumping GetRawTransaction even with a high perf computer. #12224

issue Harold-Glitch opened this issue on January 19, 2018
  1. Harold-Glitch commented at 9:40 AM on January 19, 2018: none

    <!-- This issue tracker is only for technical issues related to Bitcoin Core. General bitcoin questions and/or support requests are best directed to the Bitcoin StackExchange at https://bitcoin.stackexchange.com. For reporting security issues, please read instructions at https://bitcoincore.org/en/contact/. If the node is "stuck" during sync or giving "block checksum mismatch" errors, please ensure your hardware is stable by running memtest and observe CPU temperature with a load-test tool such as linpack before creating an issue! -->

    <!-- Describe the issue -->

    I'm running a JSON/RPC query program, in mode parallel with 100 Threads dumping GetRawTransaction . My bitcoin.conf is:

    server=1 txindex=1 dbcache=2048 rpcworkqueue=128 rpcthreads=128 rpctimeout=220

    This remains very slow the CPU usage is only 20% the disks 1% (very fast M2 SSDs). This is like there is a lock or a json/rpc serialization. Impossible to go faster.

    <!--- What behavior did you expect? -->

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    <!--- How reliably can you reproduce the issue, what are the steps to do so? -->

    <!-- What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)? -->

    <!-- What type of machine are you observing the error on (OS/CPU and disk type)? -->

    Windows 10 - 8700K with 32GB and M2 Samsung 960 SSD

    <!-- Any extra information that might be useful in the debugging process. -->

    <!--- This is normally the contents of a `debug.log` or `config.log` file. Raw text or a link to a pastebin type site are preferred. -->

  2. laanwj added the label RPC/REST/ZMQ on Jan 19, 2018
  3. laanwj commented at 1:26 PM on January 19, 2018: member

    You could try to use REST (see https://github.com/bitcoin/bitcoin/blob/master/doc/REST-interface.md):

    GET /rest/tx/<TX-HASH>.<bin|hex|json>

    Given a transaction hash: returns a transaction in binary, hex-encoded binary, or JSON formats.

    If you use the binary format, the serialization overhead will be smallest.

    Edit: Also, are you re-using the HTTP connection, instead of closing and opening a new one every time? Doing that is also very important for performance.

  4. Harold-Glitch commented at 6:27 PM on January 20, 2018: none

    Perfect!

  5. Harold-Glitch closed this on Jan 20, 2018

  6. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me