Skip to content

Instantly share code, notes, and snippets.

@sdmg15
Last active February 27, 2026 12:02
Show Gist options
  • Select an option

  • Save sdmg15/bd8c96ab56a346265c4c2e8323455cb5 to your computer and use it in GitHub Desktop.

Select an option

Save sdmg15/bd8c96ab56a346265c4c2e8323455cb5 to your computer and use it in GitHub Desktop.

Reducing bandwidth and memory

  • -dbcache=n: This represents the UTXO database size. A lower value during IBD will make sync slower but once the sync is done it should be fine

  • -maxmempool=<n>: Limit the mempool size to n. A lower value obviously means transactions will be evicted faster

  • -maxconnections=<n>: number of connections to keep, the lower the better for memory

  • -par=<n>: number of script verification threads. (Should be 0 for us)

  • -prune=<n>: Reduce storage requirements by enabling pruning (deleting) of old blocks. For value ≥ 550 the node will automatically prune block files to stay under the specified targe size.

  • -maxmeepool=<n>: Keep the transaction memory pool below MB (default is 300)

  • -loadblock=file: This could be use to import blocks that are downloaded from clients startup.

Build optimization command

Build options:

cmake -B build
  -DWITH_ZMQ=OFF \
  -DENABLE_IPC=OFF \
  -DINSTALL_MAN=OFF \
  -DENABLE_EXTERNAL_SIGNER=OFF \
  -DBUILD_UTIL=OFF \ 
  -DBUILD_TESTS=OFF \ 
  -DBUILD_CLI=OFF \
  -DBUILD_WALLET_TOOL=OFF \
  -DENABLE_WALLET=OFF \ 
  -DINSTALL_MAN=OFF \
  -DBUILD_TX=OFF \ 
  -DBUILD_BITCOIN_BIN=OFF

Build type binary size comparison :

Build type Binary size
Release (-DCMAKE_BUILD_TYPE=Release) 13M ./build/bin/bitcoind
MinSizeRel (-DCMAKE_BUILD_TYPE=MinSizeRel) 11M ./build/bin/bitcoind
RelWithDebInfo (-DCMAKE_BUILD_TYPE=RelWithDebInfo) 211M ./build/bin/bitcoind

LINKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment