How to make RPC calls faster? #14462

issue ghost opened this issue on October 11, 2018
  1. ghost commented at 10:27 AM on October 11, 2018: none

    Bitcoin Latest version.

    I increased memory to 10GB and still one RPC call takes around 30 seconds. The blockchain is still syncing. Is that the reason why RPC calls are slow?

  2. ch4ot1c commented at 1:49 PM on October 11, 2018: contributor

    When it stops syncing, they should be faster. Your CPU is probably hogged.

    Try it with bitcoind -regtest and bitcoin-cli -regtest getblockchaininfo.

  3. ghost commented at 2:21 PM on October 11, 2018: none

    The CPU usage is atmost around 5% only. Yes the regtest works instatly but mainnet RPC calls are slow. Whats your latency?

  4. ch4ot1c commented at 3:15 PM on October 11, 2018: contributor

    I get an immediate response, even before syncd, on my Macbook Pro (MacOS 10.12.6, 2.5GHz i7, 16GB RAM).

    Before IBD begins:

    ➜  bitcoin git:(b23e41edb) ✗ time nc -zw30 127.0.0.1 8332
    Connection to 127.0.0.1 port 8332 [tcp/*] succeeded!
    nc -zw30 127.0.0.1 8332  0.01s user 0.01s system 75% cpu 0.026 total
    

    After:

    ➜  bitcoin git:(b23e41edb) ✗ time nc -zw30 127.0.0.1 8332
    Connection to 127.0.0.1 port 8332 [tcp/*] succeeded!
    nc -zw30 127.0.0.1 8332  0.01s user 0.00s system 86% cpu 0.015 total
    

    Also immediate on my fully syncd RPi3. However, I did notice RPC sluggishness during block sync / validation, on both devices, in the past.

  5. ghost commented at 3:34 PM on October 11, 2018: none

    Yes the connect to rpc port was quick even in my case but its gettting slow when data was fetched. For example, can you try the same thing with getblockchaininfo or getnetworkinfo.

  6. ch4ot1c commented at 4:04 PM on October 11, 2018: contributor

    getblockchaininfo works immediately. I have had this problem you're mentioning though; I don't know its cause, but it seems to be during block validation (it happened even with just a -reindex).

  7. ghost commented at 4:06 PM on October 11, 2018: none

    Cool. Will try reindex. Thanks.

  8. unknown closed this on Oct 11, 2018

  9. ghost commented at 8:24 PM on October 11, 2018: none

    I disabled the wallet on node ( disablewallet=1 ), the RPC calls got faster.

  10. DrahtBot locked this on Sep 8, 2021
Contributors

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-17 15:15 UTC

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