High CPU load when network traffic page left open #768

issue willcl-ark openend this issue on October 11, 2023
  1. willcl-ark commented at 1:20 pm on October 11, 2023: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    Possibly related to #466

    Running Bitcoin Core version v25.99.0-04265ba9378e

    When running bitcoin-qt with an additional network traffic window open, after some time CPU usage on a single core starts to thrash between 60-100%. The CPU thrashing will (immediately) drop when the network traffic window is closed.

    Expected behaviour

    Viewing the network traffic page should not use 100% CPU or cause thrashing.

    Steps to reproduce

    steps

    • Run bitcoin-qt, open network traffic and wait some time? I think the graph needs to include a wide range of datapoints for this (rendering?) bug to occur (see below screenshots).

    actions

    I ran perf for 30 seconds on bitcoin-qt while CPU was thrashing, but it seemed to only show a lot of time spent in libQT5Gui.so, which doesn’t seem particularly helpful.

    I noticed that the CPU spikes seem to only be present when the graph is well-populated with many variously-valued data points, like this:

    image

    However CPU usage drops if there is a large spike in network activity, which causes a low level of datapoint variation (plus one large spike), like this:

    image

    Relevant log output

    Nothing of interest was present in the logs.

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    v25.99.0-04265ba9378e

    Operating system and version

    Ubuntu 23.04

    Machine specifications

    OS: Ubuntu 23.04 x86_64 CPU: 11th Gen Intel i7-11700K (16) @ 3.800GHz GPU: NVIDIA GeForce RTX 3060 Ti Memory: 64162MiB HDD: Samsung SSD 990 PRO 2TB MB: Z590 AORUS ELITE AX Kernel: 6.2.0-33-generic Resolution: 3840x2160 WM: i3 Terminal: tmux Shell: fish 3.6.1

  2. willcl-ark commented at 10:55 am on October 12, 2023: contributor

    This graph “shape” also exhibited the same behaviour, so it seems reproducible (for me).

    image

  3. fanquake commented at 3:41 pm on October 12, 2023: member
    Is this only an issue with master (regression) or also a problem if you run 25.0 or 25.1rc1?
  4. willcl-ark commented at 12:46 pm on October 13, 2023: contributor

    This also appears to occur for me on v25.0, So not a regression on master. e.g. with the following graph:

    image

    I see CPU thrashing of 50 - 90%, and get this similar-looking perf report: https://tmp.256k1.dev/23_10_bitcoin_qt_25.0_cpu.svg

  5. maflcko commented at 2:25 pm on October 16, 2023: contributor
    Which version of qt? Does it also happen with a previous release (statically compiled)?
  6. willcl-ark commented at 1:01 pm on October 24, 2023: contributor

    Sorry for the slow reply, these were both compiled with libqt5gui5 version 5.15.8+dfsg-3.

    Which previous release would you like me to try?

  7. maflcko commented at 3:53 pm on October 24, 2023: contributor
    any previous release, or the 26.0rc1 (I am only wondering about guix compilation vs local compilation)
  8. willcl-ark commented at 12:16 pm on November 6, 2023: contributor

    Tested again with 26.0rc2 binary from bitcoincore.org, and the issue is still present for me. So long as the graph content is relatively “varied”, then one CPU constantly thrashes between ~60-100%.

    image

    Seems to happen even more readily if I set the scale to 5m where even with fewer data points shown (I think) it pretty much just pins a single core to 100%

    image

    I guess it’s possible that this is something specific to my setup, and not a Bitcoin Core/QT issue; if so then I’m not too worried as I don’t use the QT program that often (and don’t need to leave the network traffic page open in any case).

    Let me know if there’s anything else useful I can do to help debug. I think first it might be good to have a reproduction from someone else…


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-24 03:20 UTC

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