bitcoin main window takes a long time (20 minutes+) to appear #540

issue runeksvendsen opened this issue on September 29, 2011
  1. runeksvendsen commented at 1:24 AM on September 29, 2011: contributor

    When I start bitcoin, it takes a very long time for the main window to appear. About 10-30 minutes. The following is added to ~/.bitcoin/debug.log when bitcoin is started, and nothing more appears until the main window appears:

    Bitcoin version 0.4.0-beta
    OS version Linux 2.6.38-11-generic x86_64
    System default language is 66 en_DK.UTF-8
    Language file locale/en_DK/LC_MESSAGES/bitcoin.mo (English (Denmark))
    Default data directory /home/rune/.bitcoin
    Bound to port 8333
    Loading addresses...
    dbenv.open strLogDir=/home/rune/.bitcoin/database strErrorFile=/home/rune/.bitcoin/db.log
    

    After the main window appears, the following information is added to debug.log

    Loaded 249074 addresses
     addresses            627873ms
    Loading block index...
    LoadBlockIndex(): hashBestChain=000000000000077a9c9a  height=147002
     block index          436502ms
    Loading wallet...
    nFileVersion = 40000
    fGenerateBitcoins = 0
    nTransactionFee = 1000000
    fMinimizeToTray = 0
    fMinimizeOnClose = 0
    fUseProxy = 0
    addrProxy = 127.0.0.1:9050
    fUseUPnP = 1
     wallet                  435ms
    Rescanning last 106 blocks (from block 146896)...
     rescan                 5251ms
    Done loading
    mapBlockIndex.size() = 147005
    
  2. tcatm commented at 1:28 AM on September 29, 2011: none

    As a first measure you could delete addr.dat from your bitcoin folder. This is completely safe and should improve startup time a lot.

    What kind of hardware are you running it on? Either your CPU or disk is a little slow.

  3. runeksvendsen commented at 1:47 AM on September 29, 2011: contributor

    I deleted addr.dat, this is the output now:

    Bitcoin version 0.4.0-beta
    OS version Linux 2.6.38-11-generic x86_64
    System default language is 66 en_DK.UTF-8
    Language file locale/en_DK/LC_MESSAGES/bitcoin.mo (English (Denmark))
    Default data directory /home/rune/.bitcoin
    Bound to port 8333
    Loading addresses...
    dbenv.open strLogDir=/home/rune/.bitcoin/database strErrorFile=/home/rune/.bitcoin/db.log
    Loaded 0 addresses
     addresses               190ms
    Loading block index...
    LoadBlockIndex(): hashBestChain=000000000000085dbedd  height=147225
     block index          443179ms
    Loading wallet...
    nFileVersion = 40000
    fGenerateBitcoins = 0
    nTransactionFee = 1000000
    fMinimizeToTray = 0
    fMinimizeOnClose = 0
    fUseProxy = 0
    addrProxy = 127.0.0.1:9050
    fUseUPnP = 1
     wallet                  118ms
    Done loading
    mapBlockIndex.size() = 147228
    nBestHeight = 147225
    setKeyPool.size() = 100
    mapWallet.size() = 2
    mapAddressBook.size() = 4
    

    I have an Intel Q9550 CPU (four cores, downclocked to 2 GHz) and my home folder is on an Intel X-25M SSD. This was never a problem with versions before 0.4, the main window appeared instantly back then. blkindex.dat is 254.7 MB in size.

  4. runeksvendsen closed this on Sep 29, 2011

  5. runeksvendsen reopened this on Sep 29, 2011

  6. alexwaters commented at 9:32 PM on October 10, 2011: contributor

    I believe this has been fixed with the QT implementation - load times are now much shorter.

  7. alexwaters closed this on Oct 10, 2011

  8. TheBlueMatt commented at 10:40 PM on October 10, 2011: member

    I dont think load times have changed with QT as the load methods in AppInit2 haven't changed. This issue appears to be specifically about slow load times loading the block index, which should effect both bitcoind and bitcoin-qt.
    Since no developer (AFAIK) can reproduce this error, is there any way the original reporter can profile bitcoin while it is loading?

  9. runeksvendsen commented at 11:11 AM on October 11, 2011: contributor

    This bug is now gone for me. I believe the cause was an SSD drive that had slowed down. The read speeds had dropped to ~700KB/s which corresponds to about 15 minutes to read the 600MB block chain file. After the read speed have returned to normal this issue is no longer present; loading takes 15 seconds now.

    I do still think 15 seconds to load the GUI is a long time, though. Perhaps it would be a good idea display the GUI as soon as the bitcoin process is started, and not wait until the block chain has been read from the hard drive? The GUI could say "Loading block chain from disk: 3%..." while reading the data, so as to let the user know that everything is working, it's just a slow storage medium that is causing the wait.

  10. TheBlueMatt commented at 2:28 PM on October 11, 2011: member

    Actually the new qt gui does just that.

    runeksvendsen reply@reply.github.com wrote:

    This bug is now gone for me. I believe the cause was an SSD drive that had slowed down. The read speeds had dropped to ~700KB/s which corresponds to about 15 minutes to read the 600MB block chain file. After the read speed have returned to normal this issue is no longer present; loading takes 15 seconds now.

    I do still think 15 seconds to load the GUI is a long time, though. Perhaps it would be a good idea display the GUI as soon as the bitcoin process is started, and not wait until the block chain has been read from the hard drive? The GUI could say "Loading block chain from disk: 3%..." while reading the data, so as to let the user know that everything is working, it's just a slow storage medium that is causing the wait.

    Reply to this email directly or view it on GitHub: #540 (comment)

  11. runeksvendsen commented at 6:51 PM on October 11, 2011: contributor

    Excellent. I just built bitcoin-qt, looks very nice!

  12. embatbr commented at 11:13 PM on May 7, 2014: none

    In my case, it's very slow too. And each time I start bitcoin-qt, it take more time to load the entire application than the previous one.

  13. ptschip referenced this in commit e07bc94a9a on May 11, 2017
  14. kallewoof referenced this in commit a409d015e9 on Oct 4, 2019
  15. rajarshimaitra referenced this in commit 40ea885477 on Aug 5, 2021
  16. 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-21 18:16 UTC

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