Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for disk speed problem #723

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JuniorPolegato
Copy link

Issue: #489
The original code was accumulating sectors of disks/block devices and partitions, duplicating the read and write sectors counting.
Now the code gets the block device list and just accumulates their sectors.
I found a division of these sectors (512 bytes each) by 1024 and 8 (8192 => 8k) to get MiB, but that's not right, it is needed to divide by 2k (or *512/1024/1024) not 8k, maybe due to the accumulation of block devices and partitions, however, when operating on one partition (dd if=/dev/sda1 of=/dev/null bs=4k), it duplicates the accumulated sectors, so you need to divide by 4k, not 8k, getting half the speed. But if you are operating directly on a disk device (dd if=/dev/sda of=/dev/null bs=4k), does not duplicate the accumulated sectors, so you need to divide by 2k, not 8k, getting half of half the speed.
Nowadays, disk space is in MB, not in MiB, so I adjusted this too.

Issue: paradoxxxzero#489
The original code was accumulating sectors of disks/block devices and partitions, duplicating the read and write sectors counting.
Now the code gets the block device list and just accumulates their sectors.
I found a division of these sectors (512 bytes each) by 1024 and 8 (8192 => 8k) to get MiB, but that's not right, it is needed to divide by 2k (or *512/1024/1024) not 8k, maybe due to the accumulation of block devices and partitions, however, when operating on one partition (dd if=/dev/sda1 of=/dev/null bs=4k), it duplicates the accumulated sectors, so you need to divide by 4k, not 8k, getting half the speed. But if you are operating directly on a disk device (dd if=/dev/sda of=/dev/null bs=4k), does not duplicate the accumulated sectors, so you need to divide by 2k, not 8k, getting half of half the speed.
Nowadays, disk space is in MB, not in MiB, so I adjusted this too.
@NVieville
Copy link
Contributor

Hello,

Nowadays, disk space is in MB, not in MiB, so I adjusted this too.

Maybe this could be discussed without raising a troll (very old IT debate).

According to [1] usage of the units tends to be as this: "base 2 values for memory and disk space values, and base 10 values for space on physical hard drives".
But this is also not so clear according to [2].
There are also a lot of other WEB pages debating this subject.

Maybe, here, the user point of view should be the purpose of printing values and units.

In case 1, if the values measure the amount of files transmitted, it should be kept in MiB. This corresponds to values printed by OSes when dealing with files size, and usually matches what users are most proficient in. Differences between MiB and MB are in general difficult to apprehend for final users.

In case 2, if the values measure the hardware throughput of the hard disk, it should be printed in MB. This corresponds to values printed when measuring a flow of bytes. OSes administrators, hardware maintainers or designers sometimes need these units, even if iops tends to be preferred by some.

This is really a matter of usage.
One thing that could be great is to let the user choose in what units to print values between MB and MiB, but this is another story and a different implementation.

These comments should only be taken for what they are: my 2 cents and a way to think about it.
Hope this will help. Any comments are welcome.

Cordially,

--
NVieville

[1] https://www.ibm.com/docs/en/storage-insights?topic=overview-units-measurement-storage-data
[2] https://physics.nist.gov/cuu/Units/binary.html

@chrisspen
Copy link
Collaborator

This is failing the build due to some Javascript formatting errors caught by checkjs.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants