How was the average size of blk*.data chosen?

How was the average size of blk*.data chosen?
2024-05-30 18:20 ` Peter Todd
  
From: Juan David Peña Melo @ 2024-05-07  1:23 UTC (permalink / raw)
  To: Bitcoin Development Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 646 bytes --]

I notice that the Bitcoin database is stored sequentially in blk*.dat 
files, with an average size between 128 to 134MB. I would like to know how 
this average size is determined and if there are any tests that demonstrate 
this size is the most efficient.

-- 
2: Type: text/html, Size: 1043 bytes --]

 permalink raw reply	[|nested]
2024-05-07  1:23 [bitcoindev] How was the average size of blk*.data chosen? Juan David Peña Melo

  
From: Peter Todd @ 2024-05-30 18:20 UTC ( / )
  To: Juan David Peña Melo;  Bitcoin Development Mailing List



On Mon, May 06, 2024 at 06:23:47PM -0700, Juan David Peña Melo wrote:
> I notice that the Bitcoin database is stored sequentially in blk*.dat 
> files, with an average size between 128 to 134MB. I would like to know how 
> this average size is determined and if there are any tests that demonstrate 
> this size is the most efficient.

Most likely someone just picked a number at random. For things like this, there
is a very wide range of values that are probably fine. The main limiting factor
at the high end, is some older file systems still don't support files >4GB, so
you'd want to pick a value below that; Monero all block data in a single file,
and that occasionally leads to issues when, eg, copying that file from one
place to another. At the low end, having tens of thousands of files in one
directory tends to cause problems.

-- 
https://petertodd.org 'peter'[:-1]@petertodd.org

--