10

I have a full node on both an Ubuntu 16.04 LTS and a Windows 10 device.

Why is the database file containing blockchain a different size on each OS?

15

You are probably looking at a database file with the blockchain in it. The main variation cause is that the database library Monero uses, LMDB, preallocates some space for writing. Every so often, when that space falls too low, LMDB will resize the file to get more breathing space.

Some OSes do not support sparse files - that is, files with "holes without data" in them. So these will actually have allocated space with data there, instead of just nothing, which makes the file larger than it'd be on an OS which supports sparse files.

It also depends on the version of Monero that is running. Recent versions have made optimizations which shrink the size of the database without impacting performance.

Last, it should be noted that this database is a few times larger than the actual blockchain data. This is because a database is geared towards reading the data back in an efficient matter, so data is stored denormalized (ie, with some duplicated parts, etc).

  • You are correct, I was looking at the database file not the blockchain itself. I edited my question to avoid causing further confusion. Thank you – animal instinct Jul 22 '16 at 20:43
  • 2
    Actually "Recent versions have made optimizations which shrink the size of the database" - while improving performance. – hyc Aug 1 '16 at 15:43
7

The previous answers are correct, but there are plenty of other reasons for size variations. The timing and order in which records are written will also affect the way space is allocated in the database, and if the two nodes didn't run in lockstep then they'll get batches of blocks at different times as well as alternate blocks at different times.

7

Probably because Windows, by default, reports file sizes in KiB/MiB/GiB/TiB (1024 bytes in a kilobyte, 1024 kilobytes in a megabyte, etc.), while Ubuntu, by default reports file sizes using the "proper" SI definition of those prefixes (1000 bytes in a kilobyte, 1000 kilobytes in a megabyte, etc.).

Here's some website I Googled, with pictures of the two OSes reporting a file size, for reference.

There's also the issue that the underlying file systems are different, so they don't store files the same way, which can lead to different sizes for the same data, depending on configuration. You haven't shared any of that information with us, but various file system configurations, such as cluster size can have a noticeable effect on how much disk space it takes to store a file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.