Avoid freezing other applications during sync: Lower kernel priority for background sync #326

issue CrazyPython openend this issue on May 12, 2021
  1. CrazyPython commented at 11:44 pm on May 12, 2021: none

    Is your feature request related to a problem? Please describe. I’m on a dual-core (4 hyperthread) machine. I have many tabs open. When I open Bitcoin to sync, my browser randomly freezes for a couple seconds every minute or two, impeding my work, usually at the least convenient time.

    Describe the solution you’d like I’d like Bitcoin GUI to add a checkbox to lower the kernel-level priority of the Bitcoin process during Initial Block Download. (IBD)

    By making it more convenient for ordinary users who have their resources already near-saturated, we can improve decentralization. #KeepBitcoinDecentralized

    When I used renice to lower the priority of Bitcoin to +20 on macOS 10.14.6, I experienced almost no freezes while waiting for Bitcoin to sync.

    Describe alternatives you’ve considered

    • Only syncing Bitcoin when I’m idle on the computer: Too inconvenient to set up
    • Only syncing Bitcoin at night: Not convenient for most laptop users whose laptops automatically sleep, and impossible for people who prefer to fully shutdown their computers at night to avoid distractions

    Happy to write the code for this myself if someone can explain where to start.

  2. CrazyPython added the label Feature on May 12, 2021
  3. jarolrod commented at 1:28 am on May 13, 2021: member

    The GUI is just a wrapper over the core engine. This should be opened up in the main repo instead as it’s related to the performance of bitcoind.

    Changing the kernel-level priority of a GUI process is not something that we would implement on the GUI side. This is very much a user-centric option to be able to do so using renice.

    If you’re looking to increase Bitcoin Core’s performance on your system, which is at times used for other purposes, you can try adjusting the following in your bitcoin.conf:

    • par value
      • This is the amount of threads to use for script verification. Lowering this will use less threads.
    • dbcache value
      • Bitcoin Core performs a lot of I/O. Increasing the cache value should slightly lower the amount of times Core has to write to disk.
  4. CrazyPython commented at 12:07 pm on May 14, 2021: none

    Changing the kernel-level priority of a GUI process is not something that we would implement on the GUI side

    I am suggesting changing the kernel-level priority of bitcoind.

    If Bitcoin GUI is a parent process of bitcoind, and is therefore responsible for it– as it is a wrapper– perhaps the nice-level of bitcoind should be controlled from the GUI.

    This is very much a user-centric option to be able to do so using renice.

    Yes, but most operating systems lack a convenient interface for doing so. Most normal people do not know this option exists, and even most developers will not think of this option while running Bitcoin.

  5. hebasto commented at 8:36 am on July 4, 2021: member

    @CrazyPython

    I am suggesting changing the kernel-level priority of bitcoind.

    Suggesting to move this issue to the main repo.

    Closing here.

  6. hebasto closed this on Jul 4, 2021

  7. bitcoin-core locked this on Aug 16, 2022

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-23 09:20 UTC

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