[RFC] dbwrapper: Set global leveldb mmap limit #32447

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2025-05-leveldb-mmap-file-limit changing 1 files +34 −0
  1. laanwj commented at 11:03 am on May 8, 2025: member

    Set the default leveldb mmap limit to 4096 files from dbwrapper, before creating the first leveldb context.

    The motivation here is to remove the need for a custom leveldb patch, see google/leveldb#1265.

    After looking into this i’m not as sure whether this is what we want to do:

    • The interface here is really ludicrous.
    • Why is 4096 a good number, specifically? As the files are closed after mmap, the mmapped files don’t take up a file descriptor slot.
    • After #30039, the number of ldb files created is 16 times smaller. 1000 files with the new default of 32MB is 32GB of database. Maybe there’s nothing left to do here and we can better drop the patch.
  2. laanwj added the label UTXO Db and Indexes on May 8, 2025
  3. DrahtBot commented at 11:03 am on May 8, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32447.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  4. dbwrapper: Set global leveldb mmap limit
    Set the default leveldb mmap limit to 4096 from dbwrapper, before
    creating the first leveldb context.
    
    The motivation here is to remove the need for a leveldb patch, see
    https://github.com/google/leveldb/pull/1265.
    e331216fbe
  5. laanwj force-pushed on May 8, 2025
  6. laanwj commented at 11:15 am on May 8, 2025: member
    Yeah no even “when to call this initialization” isn’t clear, this breaks the tests as-is.
  7. laanwj closed this on May 8, 2025

  8. laanwj commented at 11:29 am on May 8, 2025: member
    See bitcoin-core/leveldb-subtree#52 instead.

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: 2025-05-09 15:12 UTC

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