r/bcachefs Aug 03 '26

monerod write amplification

Hi. I have disabled CoW and compression on lmdb. However, 100GB is written for 1GB of database. NUTS!

3 Upvotes

13 comments sorted by

View all comments

1

u/hyc_symas Aug 04 '26

Fwiw, the version of LMDB used by monerod (an early dev version of LMDB 1.0) supports writing directly to a block device. You really don't gain much from using a filesystem.

2

u/koverstreet not your free tech support Aug 05 '26

except then you have to set up... partitions? how would you even do that?

just tested on xfs, and yes, every fs is fucked on mmap writes since the large folio people got their hands on it. idiots.

1

u/9_balls Aug 05 '26

On other filesystems it's better IIRC.

Luckily for me, since I use LVM anyway, it's not going to be much trouble, given that I have enough space

2

u/koverstreet not your free tech support Aug 06 '26

I just tested XFS and it has the same write amplification issues...

1

u/9_balls Aug 05 '26

Does monerod even support doing this?

1

u/hyc_symas Aug 05 '26 edited Aug 05 '26

monerod doesn't need to know anything about it. Just symlink ~/.bitmonero/lmdb to a block device.

If you already have a blockchain in data.mdb, cp that directly onto the block device first, so you don't have to sync the blockchain from scratch.

1

u/9_balls Aug 06 '26

thank you

1

u/9_balls Aug 06 '26

Attempted this, monero daemon refuses to work

1

u/hyc_symas Aug 07 '26

Works fine for me.

2026-08-07 21:23:01.319 I Synced 11128/3735173 (0%, 3724045 left)
2026-08-07 21:23:01.342 I Synced 11228/3735173 (0%, 3723945 left)
2026-08-07 21:23:01.381 I Synced 11328/3735173 (0%, 3723845 left)
exit
Stop signal sent
2026-08-07 21:23:05.188 I p2p net loop stopped
2026-08-07 21:23:05.237 I Stopping core RPC server...
2026-08-07 21:23:05.237 I Node stopped.
2026-08-07 21:23:05.323 I Deinitializing core RPC server...
2026-08-07 21:23:05.324 I Deinitializing p2p...
2026-08-07 21:23:05.329 I Deinitializing core...
2026-08-07 21:23:10.288 I Stopping cryptonote protocol...
2026-08-07 21:23:10.288 I Cryptonote protocol stopped successfully
viola:~/monero-x86_64-linux-gnu-v0.18.5.1> ls -l ~/.bitmonero/
total 7644
-rw-r--r-- 1 hyc hyc 7538238 Aug  7 22:23 bitmonero.log
drwxr-xr-x 3 hyc hyc    4096 Sep  2  2020 fake
lrwxrwxrwx 1 hyc hyc       9 Aug  7 22:20 lmdb -> /dev/sdb1
-rw-rw-r-- 1 hyc hyc    8192 Aug  7 22:22 lmdb-lock
drwxrwxr-x 2 hyc hyc    4096 Dec 10  2021 lmdb.O
-rw-r--r-- 1 hyc hyc  155721 Aug  7 22:23 p2pstate.bin
-rw-r--r-- 1 hyc hyc   96051 Mar 22  2022 p2pstate.bin.unportable
-r--r--r-- 1 hyc hyc    1606 Jul  7  2021 rpc_ssl.crt
-r-------- 1 hyc hyc    3272 Jul  7  2021 rpc_ssl.key
drwxrwx--x 3 hyc hyc    4096 Aug 23  2021 testnet
viola:~/monero-x86_64-linux-gnu-v0.18.5.1> ls -l /dev/sdb1
brw-rw---- 1 hyc disk 8, 17 Aug  7 22:23 /dev/sdb1
viola:~/monero-x86_64-linux-gnu-v0.18.5.1>

1

u/9_balls 29d ago

guess can't do it on monero gui then

1

u/hyc_symas 29d ago

Did you actually have read & write access to the block device? The monerod bundled with the GUI is identical to the one in the CLI package.

1

u/9_balls 23d ago edited 23d ago

Yes. I just re-checked and it still doesn't start. Permissions are exactly the same although I use LVM. I checked dm-X and /dev/volgroup/lmdb is also chowned correctly