🌐 🇵🇱 Polski · 🇬🇧 EN
An important part of optimization tasks is the analysis of measurement data for various parameters such as CPU or memory utilization, etc. This data is presented in different units, which must be interpreted correctly. The most popular system of measurement in the world is the SI - International System of Units. In the case of IT environments, we deal with binary and decimal systems, which are similar but not identical. Understanding the different units of measurement that define computer hardware resource parameters is crucial for their proper specification and for the ability to improve system performance. This chapter covers the issues of collecting, reviewing, and analyzing data using available system tools.
Types of units and their prefixes.
INTERNATIONAL SYSTEM OF UNITS (SI) SI prefix is decimal:
kilo- (k) = 10^3 = 1 000
mega- (M) = 10^6 = 1 000 000
giga- (G) = 10^9 = 1 000 000 000
tera- (T) = 10^12 = 1 000 000 000 000
peta- (P) = 10^15 = 1 000 000 000 000 000
exa- (E) = 10^18 = 1 000 000 000 000 000 000
THE INTERNATIONAL ELECTROTECHNICAL COMMISION (IEC) binary prefix:
kibi- (Ki) = 2^10 = 1024
mebi- (Mi) = 2^20 = 1048 576
gibi- (Gi) = 2^30 = 1073 741 824
tebi- (Ti) = 2^40 = 1099 511 627 776
pebi- (Pi) = 2^50 = 1125 889 906 842 624
exbi- (Ei) = 2^60 = 1152 921 504 606 846 976
Considering how disk manufacturers define disk space for a drive that we say has 5 TB of space - this means:
5 TB is 5 x 10^12, which is 5 000 000 000 000 bytes.
Let's note that this understanding is possible as long as a terabyte is understood as 10^12. However, sometimes for various reasons, values returned by different tools may be presented in tebibytes. In such a situation, 5 TB is
5 TB gives 5 x 2^40, which is = 5497 558 138 880
Both results above differ by about 10%. Thus, a tool displaying the size of disk space that should be 2 TB might show it as 1.82 TB (measured in TiB).
The example above shows how important it is to understand in which unit the measurement results obtained from different tools are presented. Misreading a result can lead to an incorrect analysis of a performance problem later on.
It should be remembered that if we see a binary prefix, there is no doubt about the result - we immediately know that the given value is reported in binary form. However, if you see a normal decimal prefix, we no longer have such certainty whether it refers to a binary or decimal interpretation.
Partially, the above problem has been standardized to make it easier to understand how to interpret given prefixes. RAM manufacturers, when stating size in GB, mean 2^30. In telecommunications, the term gigabit usually means 10^9. Disk manufacturers usually use the decimal interpretation where a gigabyte means 10^9 bytes.
Unit conversions
When performing data analysis, it is also very important to be able to convert them correctly. A simple example of conversion is answering the question: how many seconds are in an hour?
1 hour = 60 min/hour x 60 seconds/minute = 3600 seconds/hour
Now let's try to convert 10,000 MiB/h to MiB/s.
10000 MiB/h x 1/60 h/min x 1/60 min/s = 2.778 MiB/s
Breaking the above down into prime factors, we have:
10000 MiB/h x 1/60 h/min = 166.7 MiB/min
166.7 MiB/min x 1/60 min/s = 2.778 MiB/s
Simply put, the operation consists of:
10000 / 60 / 60 = 2.778
Since there are 60 minutes in every hour and 60 seconds in every minute, to arrive at the result of MiB per second, the given amount of MiB must be divided by the number of minutes in an hour, and then by the number of seconds in a minute.
The above operation should not be difficult to understand, so let's try something harder. How to convert 50 GiB/h to MiB/s? First, we must convert GiB units to MiB, and then hours to seconds.
50 GiB/h x 1024 MiB/GiB x 1/60 h/m x 1/60 min/s = 14.222222... MiB/s
50x1024 / 60 / 60 = 14.2222 MiB/s
In a Linux environment, we can use the bc and dc calculators from the console for calculations.
For example, we can calculate how much data flows per second through a 1Gb network card, given in MiB?
[root@station1 ~]# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
scale=8
1*10^9/8/2^20
119.20928955
Previous calculation using the bc calculator:
[root@station1 ~]# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
scale=8
50*1024/60/60
14.22222222
The "scale" concept in the bc calculator defines the number of decimal places.
Exercises for training ;)
Convert 100 MiB/s to GiB/h?
To start, we convert seconds to hours:
100 x 60 (seconds in a minute) x 60 (minutes in an hour)
100 x 60 x 60 = 360000 MiB/h
Now we can convert MiB to GiB
360000 x 2^20 (bits in a mebibit) x 1/8 (bytes in a bit) x 1/2^30 (gigabits in bytes)
360000 x 1048576 / 8 / 1073741824 = 43.9453125 GiB/h
Using the bc calculator, the calculation process looks as follows:
[root@station1 ~]# bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
scale=8
100*60*60*2^20/8/2^30
43.94531250
Provide the value of 120KiB/sec in MiB/min?
173 transactions per second is how many millions of transactions per day?

Comments