What determines the average size of blk*.data files?

2 replies 368 views
seed420Newbie
Posts: 2 · Reputation: 37
#1Mar 23, 2026, 06:50 AM
Hey everyone, I've been looking into how Bitcoin stores its data in those blk*.dat files, and I see they're usually around 128 to 134MB each. I'm curious about how that average size was decided upon. Are there any tests or studies that show this size is the best choice for efficiency? Thanks.
4 Reply Quote Share
ryan_nodeSenior Member
Posts: 202 · Reputation: 852
#2Mar 23, 2026, 10:14 AM
blk*.dat files have a maximum size of 128 MiB, and new files are simply started if the block that is about to be written to disk would cause the file to exceed this size limit. The PR that introduced this limit, https://github.com/bitcoin/bitcoin/pull/1677, suggests that this limit was chosen to reduce disk fragmentation of the files. However, I don't think there is anything that determines or indicates that this size is "most efficient", whatever that means. This is often the case with many of the maximums that exist throughout Bitcoin and other protocols - maximums are often "it just feels like that's a big enough number".
3 Reply Quote Share
seed420Newbie
Posts: 2 · Reputation: 37
#3Mar 23, 2026, 03:43 PM
It seems that the limit was set to prevent excessive fragmentation, since the blocks range from 1 to 4 megabytes and we don't want to handle large numbers of files. I apologize, when I talk about efficiency I'm referring to how this size can provide better read/write performance within the node. For example, in the Google File System paper, a chunk size of 64 MB was determined by user behavior because a larger chunk size significantly reduces the amount of interaction required between clients and the master node for read/ write operations.
3 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics