Hey everyone,
I've been checking out how Bitcoin stores data in those blk*.dat files, and I see they usually sit around 128 to 134MB. How did they settle on this size? Is there any proof that this is the best setup?
Why is the average size of blk*.dat files set at 128MB?
2 replies 452 views
matrix2021Full Member
Posts: 92 · Reputation: 612
#2Apr 21, 2017, 04:49 AM
The files are capped at 128 MiB. When a block would make the file too big, a new one just gets created.
That size was picked to help with disk fragmentation, according to a pull request. But honestly, I don't think there's anything that shows it's the "most efficient" size or whatever. A lot of these limits just come from a gut feeling, you know?
Yeah, it makes sense not to have tons of tiny files. But when I say efficiency, I'm thinking about how that size impacts read/write speeds. Like, in the Google File System study, they found 64 MB chunks worked best for user needs, cutting down on back-and-forth with the server. Just saying, maybe we should look at how size affects performance too.
Related topics
- Advice on Channel Size for Lightning Network 5
- Need help migrating my old wallet.dat to the latest version 4
- Wallet Issues After Editing.dat File, Need Help! 19
- Is Mempool.space Accurate for Fee Estimates? 19
- HD Wallet vs Descriptor Wallet: What's the Deal? 3
- New Wallet Regulations for Crypto Purchases Over $10K in the US 15