[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question: SSD speed





On 10/8/2020 5:13 PM, Stefan Monnier wrote:
	a container nears being full.  If one has 1 MB of storage available
	(allowing for file system overhead and block alignment), then 1 MB
	of data will fit, but 1 MiB will not.

In which way is the KB-vs-KiB discrepancy different from the "file
system overhead and block alignment"?

File system overhead is not primarily an artifact of the size of the blocks. Block alignment is related to the size of the blocks, but then I never said it was not.

Maybe it's a higher percentage, but the end result is the same: if your
FS says you have N bytes left, it does not guarantee you that an N byte
file will fit,

If it says you have 1.00 MB free, then it is guaranteed 1.00 MiB will not fit. If it (accurately) says you have 1.00 MiB free, then 1.00 MB is indeed guaranteed to fit.

so you need to include some slack.

	Not usually that much.  Again, it depends on the situation.

And since very few
people are able to quickly compute how many blocks are needed for
a file of size N on the specific filesystem they use, you're better off
using a "safe enough" estimate.  This notion of "safe" enough is one
learned empirically over the years, so whether it's 2% or 10% doesn't
really matter that much, as long as it's pretty much always the same.

Well, the point is it isn't the same. One PiB is 1,125,899,906,842,624 bytes. One PB is 1,000,000,000,000,000 bytes. That is a difference of 12.6%, vs. 2.4% difference between 1 KiB and 1 KB.


As an engineer, precision is absolutely of the essence.

When talking about the capacity of mass storage, you don't need
precision, since it just has to be large enough, rather than having to
have exactly the right size.

	Indubitably, but a 12.6% shortfall would be a problem.

Engineers are very familiar with such imprecise constraint and with
the use of safety margins to account for them.

Of course I am. There are plenty of cases where a safety margin is required. There are plenty of other cases where a tiny differential can mean the difference between working well and a catastrophic failure. Direction also matters. A cylinder that is just 0.001 mm oversize will not fit in a hole that is 0.001 mm undersize.


Reply to: