Many times we notice that the performance of a server is not what it should, there we wonder, where is the problem? … Will it be insufficient bandwidth? … Lack of CPU or RAM? … Or the writing and reading in the HDD will not be the best?
Here I will show you how to know what maximum speed your HDD supports, the current speed it can work at etc, we will use the tool: hdparm
Install hdparm
First and it is something obvious, we must install the software that we will use. If you use Ubuntu or Debian you can install it with:
sudo apt-get install hdparm
If you use ArchLinux or some other distro based on this it would be:
sudo pacman -S hdparm
Using hdparm
The first is know the maximum speed of our HDD, that is, if it is Sata1, Sata2 or 3, how much does it support. For this we will use the following command:
sudo hdparm -I /dev/sda | grep -i speed
It will show us something like this:
* Gen1 signaling speed (1.5Gb / s) * Gen2 signaling speed (3.0Gb / s) * Gen3 signaling speed (6.0Gb / s)
Depending on how sophisticated the HDD is, and of course, if they have the maximum supported speed enabled in the BIOS.
Now let's see current speed with which the HDD is working:
sudo hdparm -tT /dev/sda
It will show us something like this:
/ dev / sda: Timing cached reads: 22770 MB in 2.00 seconds = 11397.43 MB / sec Timing buffered disk reads: 432 MB in 3.01 seconds = 143.59 MB / sec
The end!
I hope you have been helpful.
By the way, you can see a complete and detailed information about your HDD by removing the grep of the command that I put previously, that is, like this:
sudo hdparm -I /dev/sda
Enjoy!
Ha, I don't know why but I had read "Improve performance" instead of "measure" and I was going to jump in and ask the tricks you used. Thanks Gaara.
HAHAHAHA well ... the most obvious trick is to get an SSD hehe, but it is the most expensive 😀
Some time ago I had 3 disks in a desktop pc and it occurred to me that the original purpose of RAID was speed and I did a RAID 0 (stripping), I copied almost triple the speed but with the disadvantage that if I lost a disk I would lose it everything.
By the way before RAID was "Redundant Array of Inexpensive Disks" now it is "Independent Disks" because we generally don't need so much speed but data reliability.
The exact same thing happened to me!
With an IDE disk (PATA) something old, the maximum speed that you say comes out with -I does not come out for me. On the other hand, the current ones do come out, which to give you an idea are:
/ dev / sda:
Timing cached reads: 334 MB in 2.01 seconds = 166.40 MB / sec
Timing buffered disk reads: 148 MB in 3.03 seconds = 48.77 MB / sec
Thanks for the comment 😀
For more tests I recommend phoronix
http://www.phoronix-test-suite.com
I wouldn't play hard with the puck tests at home. Without any scientific and mathematical explanation, the less you stop it in rotations (turn it off), the better you are going to do. You can spoil it by defragmenting it, compressing it, encrypting it, etc., many times. Disk check utilities are not harmless, the more you use them, the more you wear out the disk. Like SSDs and USB drives, they have a limited number of writes. Using them from time to time is fine, but without overdoing it.
And the less you stop / boot the disk the better.
Spend the disc as little as you can.
A greeting.