AddAddress causes excessive IO #258

issue stuhood opened this issue on May 23, 2011
  1. stuhood commented at 7:23 PM on May 23, 2011: none

    On a system with mining disabled and doing nothing but AddAddress calls according to the debug log, there are 80-120 IOPs per second (likely very small ops, because the total throughput is only ~1MB/s), which can bog a system down considerably.

    Some avenues of improvement might be:

    • Bulk puts
    • More selective storage of addresses
    • Disabling fsync for the address db
  2. TheBlueMatt commented at 9:32 PM on May 29, 2011: member

    Overall transaction handling in db.cpp is terrible. BDB has good transaction support, but it is only used in one or two places.

  3. stuhood commented at 11:35 PM on May 29, 2011: none

    I looked into this a bit: I think disabling fsync for the address database is the way to go, but since we need to leave it enabled for the rest (?) of the databases, that will require creating a separate BDB DbEnv.

  4. stuhood commented at 7:35 AM on June 17, 2011: none

    This appears to be at least an order of magnitude worse in the OSX build than in the Linux build. Might OSX be handling the fsync'ing differently?

  5. sneak commented at 12:56 PM on June 18, 2011: none

    Yeah, it's absolutely abysmal on osx.

  6. jrmithdobbs commented at 2:15 AM on June 19, 2011: contributor

    I didn't really notice since the macs I run it on all have SSDs. But yes, it is demonstrably worse on OS X.

  7. davidljung commented at 5:13 PM on June 24, 2011: none

    With a high-end Mac Pro (gobs of RAM, 2 quad-core CPUs) this issue makes Bitcoin essentially unusable in conjunction with other day-to-day use of the machine. It causes the HD to click noisily all day (with brief pauses) and degrades performance of other applications - web browsing etc. I keep Bitcoin terminated during the day when working and just run it at night.

    How large is the address DB typically and is it expected to grow with network size? (mine is ~15MB). If it remains of that order, perhaps an option to keep it in memory would be appropriate?

    I'm assuming the 'fsync' suggestion above involves modification of the code, but if there is any 'quick fix' available, that would be a useful temporary workaround for Mac users.

    Cheers (- everyones work is appreciated).

  8. TheBlueMatt commented at 5:52 PM on June 29, 2011: member

    You might try -noflushwallet, but that probably wouldnt work and could lead to the loss of data in the wallet or the corruption of the wallet if the bitcoin client crashes while it is writing to the wallet.

  9. sneak commented at 9:52 PM on July 7, 2011: none

    Does every address need an fsync? It seems that just fsyncing after key/wallet operations would be more than acceptable. Can the address cache fsyncs be batched into blocks of 1000 or something?

  10. hartrock commented at 12:27 AM on August 3, 2011: none

    With OS X adding addresses is much slower than with Linux: it takes a very long time until it starts fetching new blocks after startup. Note: I'm using an encrypted *.dmg for all Bitcoin data (inclusive debug.log), which could make things more worse.

    Just to confirm this as a serious problem (0.3.24-beta, OS X Lion): the difference between Linux and OS X is so big (with OS X it has taken >15min until fetching first block!), that something seems to be buggy.

  11. sgimenez commented at 2:34 PM on August 10, 2011: contributor

    Try with some revision that is more recent than 24271c542b9a0d6016badf5438fb7e5ff7961ace. This patch reduces db commits when addresses are added.

  12. sipa commented at 7:15 PM on February 19, 2012: member

    Addrman (#787) fixes this completely, as it only writes addr.dat asynchonously.

  13. gavinandresen closed this on Apr 4, 2012

  14. gavinandresen commented at 7:26 PM on April 4, 2012: contributor

    Addrman pulled.

  15. sipa referenced this in commit 0350c7e4b8 on Jul 28, 2015
  16. sipa referenced this in commit 7863d105ea on Aug 4, 2015
  17. sipa referenced this in commit 780d5b3c7b on Aug 23, 2015
  18. dexX7 referenced this in commit 5abd9b8fef on Oct 12, 2015
  19. TheBlueMatt referenced this in commit a671356e1f on Oct 20, 2015
  20. sipa referenced this in commit 9177950c74 on Oct 21, 2015
  21. sipa referenced this in commit f4787d1caf on Oct 21, 2015
  22. sipa referenced this in commit 6557a8cd46 on Oct 26, 2015
  23. sipa referenced this in commit ea06490d14 on Oct 27, 2015
  24. sipa referenced this in commit 003bb87153 on Nov 5, 2015
  25. sipa referenced this in commit bfd83199c3 on Nov 11, 2015
  26. sipa referenced this in commit b437ea7ec9 on Nov 12, 2015
  27. sipa referenced this in commit 1d84107924 on Nov 12, 2015
  28. rebroad referenced this in commit 40ead34fbe on Dec 7, 2016
  29. deadalnix referenced this in commit b0a60e6d33 on Jan 19, 2017
  30. deadalnix referenced this in commit 8c4038dfc8 on May 10, 2017
  31. lateminer referenced this in commit 8cac22070a on Dec 9, 2017
  32. classesjack referenced this in commit e5fa359040 on Jan 2, 2018
  33. nining referenced this in commit 5abe30575c on Jan 3, 2018
  34. 0xartem referenced this in commit 593fa7ce88 on Nov 10, 2018
  35. sdaftuar referenced this in commit 25c0600f6c on Nov 12, 2018
  36. 0xartem referenced this in commit cab5b07d55 on Nov 15, 2018
  37. attilaaf referenced this in commit 1c6f201546 on Jan 13, 2020
  38. MarcoFalke referenced this in commit 4a1751a929 on Apr 17, 2021
  39. cryptapus referenced this in commit bcfa192771 on May 3, 2021
  40. rajarshimaitra referenced this in commit 5f858278d7 on Aug 5, 2021
  41. 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-15 15:16 UTC

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