Skip to content

stored: change default block size to 1 MiB#1396

Merged
arogge merged 10 commits intobareos:masterfrom
arogge:dev/arogge/master/enlarge-default-blocks
Jun 7, 2023
Merged

stored: change default block size to 1 MiB#1396
arogge merged 10 commits intobareos:masterfrom
arogge:dev/arogge/master/enlarge-default-blocks

Conversation

@arogge
Copy link
Member

@arogge arogge commented Feb 28, 2023

Historically Bareos uses a default block size of 63k (64.512 bytes). This usually works fine, until you use a modern tape drive. We already have a whilepaper on how to achieve good performance with tape drives, but you need to reconfigure the block sizes and there are a lot of ways you can break Bareos that way.
With the default block size set to 1M (1.048.576 bytes), there is no need to configure a custom block size for tapes anymore, as this new default now provides optimum performance for recent tape drives out of the box.
The default has been chosen carefully to provide optimum performance while retaining maximum interoperability. As there are still hostadapters (e.g. smartpqi) that cannot handle I/O larger than 1M and tape performance does not show significant increase when using a blocksize larger than 1M, this seems to be the reasonable choice.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@arogge arogge marked this pull request as draft March 2, 2023 17:09
@arogge arogge force-pushed the dev/arogge/master/enlarge-default-blocks branch 2 times, most recently from 6ca926c to 38f11b6 Compare April 26, 2023 10:22
@arogge arogge marked this pull request as ready for review April 26, 2023 10:22
@arogge arogge requested a review from pstorz April 26, 2023 10:22
@pstorz pstorz changed the title Change default block size to 1 MiB stored: change default block size to 1 MiB Apr 26, 2023
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! Please see comments.

@pstorz pstorz self-requested a review May 30, 2023 14:09
Copy link
Member

@pstorz pstorz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only two points are left:
1: Adapt the documentation with your last suggestion of the sentence
2: Merge the latest docs commits into one.

Good work!

@arogge arogge force-pushed the dev/arogge/master/enlarge-default-blocks branch from 6339634 to 5cef926 Compare June 1, 2023 14:00
@arogge arogge requested a review from pstorz June 1, 2023 14:00
arogge added 10 commits June 7, 2023 14:57
move initialization from default ctor to the class itself.
Historically Bareos uses a default block size of 63k (64.512 bytes).
This usually works fine, until you use a modern tape drive. We already
have a whilepaper on how to achieve good performance with tape drives,
but you need to reconfigure the block sizes and there are a lot of ways
you can break Bareos that way.

With the default block size set to 1M (1.048.576 bytes), there is no
need to configure a custom block size for tapes anymore, as this new
default now provides optimum performance for recent tape drives out of
the box.

The default has been chosen carefully to provide optimum performance
while retaining maximum interoperability. As there are still
hostadapters (e.g. smartpqi) that cannot handle I/O larger than 1M and
tape performance does not show significant increase when using a
blocksize larger than 1M, this seems to be the reasonable choice.
Using gentestdata you can generate a pseudo-random binary data that you
can use during testing.
This will produce the same data every time, but it looks random and the
data is neither sparse nor compressible.
The checkpoint test was relying on smaller blocksizes, so it had to be
adapted to the new 1M blocksize.
We now also create special testdata for that with the new gentestdata
tool and use that for the tests.
When taking a backup that fits entirely in a single block (i.e. the SOS
and the EOS together with at least one file are in the same block), the
SD would write the EOS record with JobFiles=0.
If you bscan such a job, restore will not be possible.

This patch updates JobFiles immediately before writing the EOS, ensuring
it is not zero if a file was actually saved.
@arogge arogge force-pushed the dev/arogge/master/enlarge-default-blocks branch from d24b2b4 to 39c4cba Compare June 7, 2023 12:57
@arogge arogge merged commit 882194f into bareos:master Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants