Recommended block size for Borg backup storage backend #6879
-
Hello, We're in the process of moving our backups to a different storage, from an ext4 backend to ZFS. Ext4 has a blocksize of 4KB (and has some limitations preventing it from becoming bigger). ZFS has 128KB by default. I was wondering, are there any recommendations on block size (recordsize in ZFS terms) for the Borg backup storage backend? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Borg by default creates files of about 500MiB size, so there is no need for a small fs blocksize. Of course, the larger you make the blocksize, the more loss by overhead you produce. But due to the large file size, only the last block will contribute to the overhead and the overall amount of files is relatively low. Guess I'ld just keep the ZFS default and disable zfs compression and zfs deduplication for the borg repo fs. |
Beta Was this translation helpful? Give feedback.
-
Apparently this is not so.
It's now recommended to increase it to 1M (1 MiB). |
Beta Was this translation helpful? Give feedback.
-
This thread eludes 2 important points about ZFS: 1- As @j77h wrote, when you set recordsize to 1M (for example) it means your maximum block size is 1M, smaller files will use smaller block size (lowest ^2 that can hold the data), BUT, by design, all blocks for a given file will have the same size. So technically you could have a non negligible overhead. Not something to worry about for 500MB files, though. 2- The file size is not necessarily what you have to take into account. For example, DBs or VM disks can be stored in massive files, but the way they are used matters a lot. PostgreSQL for example uses 8KB block size when it uses its DB file. So even if your DB file is enormous you must set recordsize to 8KB in order to maximize performance and minimize read/write amplification. This leads to a complementary question: how does Borg use those ~500MB files? Are these «write once» or «append only» files or are these like DB files where Borg will read/write small portions inside? edit: |
Beta Was this translation helpful? Give feedback.
Borg by default creates files of about 500MiB size, so there is no need for a small fs blocksize.
Of course, the larger you make the blocksize, the more loss by overhead you produce. But due to the large file size, only the last block will contribute to the overhead and the overall amount of files is relatively low.
Guess I'ld just keep the ZFS default and disable zfs compression and zfs deduplication for the borg repo fs.