Linux testing hdd speed

Скорость Диска (Чтения/Записи): Тест HDD, SSD в Linux

Выполните следующую команду для определения скорости ЗАПИСИ на накопитель:

dd: ТЕСТ Скорости ЧТЕНИЯ Диска

Файл tempfile , сгенерированный предыдущей командой, был закэширован в буфер и скорость его чтения будет намного выше чем реальная скорость чтения непосредственно с жесткого диска.

Чтобы получить реальную скорость, необходимо предварительно очистить кэш.

Выполни следующую команду, чтобы узнать скорость ЧТЕНИЯ из буфера:

Очистите кэш и измерьте реальную СКОРОСТЬ чтения непосредственно с жесткого диска:

dd: ТЕСТ Скорость Чтения/Записи Внешнего Накопителя

Для проверки производительности какого-либо внешнего HDD, SSD, USB Флэшки либо другого съемного носителя или удаленной файловой системы, просто перейдите в точку монтирования и выполните приведенные выше команды.

Либо, вместо tempfile , можно непосредственно прописать путь к точке монтирования, например:

Напоминание: Все приведенные выше команды используют временный файл tempfile . Не забудьте удалить его по окончанию тестов.

hdparm: Проверка Производительности HDD, SSD, USB Флэш Накопителья

hdparm — это утилита для командной строки в Linux, которая позволяет просматривать и менять параметры жестких дисков.

Так же она может использоваться в качестве простой утилиты для сравнительного анализа, которая позволяет быстро узнать скорость ЧТЕНИЯ с диска.

hdparm доступен из стандартных репозиториев в большинстве Linux дистрибутивах.

Установите hdparm , в зависимости от вашего Linux дистрибутива.

В Linux Mint, Ubuntu, Debian:

Источник

How to Test Disk Speed Using the Linux Command Line?|(Measure Disk Performance with fio,dd and Graphical Method)🏎️

Test Disk Speed Using the Linux Command Line?|(Measure Disk Performance with fio,dd and Graphical Method)

Let’s talk about storage tech and disk speed. The invention of SSD showed everyone just how much difference a faster storage disk can make. And when it comes to speed, there is also the matter of measuring disk speed. You may be interested in testing your PC storage device or perhaps you want to know if your VPS provider actually delivers on their promises of SSD storage — for these and many other reasons, you can use this guide to measure disk speed . Instead of obtaining a single number as ‘speed’, we are interested in measuring what better represents the real-world speed of storage devices such as Hard Disk Drive (HDD), Solid State Drive (SSD), SD cards, and USB memory stick/flash drives, etc. Every storage device provides a certain level of efficiency at a certain financial cost and we’ll run different disk speed tests to discover just how fast each of them is.

Читайте также:  Linux размеры разделов при установке

As a case in point, HDDs are rather more affordable but also are only appropriate for transferring bulk files to/from disks which has a sequential read/write pattern as opposed to having a random read/write pattern. Accordingly, not every speed measurement method may be good for every disk.

In this article, I will walk you through how to use the “dd”, “hdparm” utility, and “fio” methods to test disk speed in Linux.

We’re also going to cover Linux disk speed test using the Graphical Method. Also, I will be elaborating on why the first two mentioned approaches provide rather poor estimates in certain use cases.

Linux Hosting Simplified

Want a better way to host your websites and web apps? Developing something new? Simply don’t like Windows? That’s why we have Linux VPS.

Test disk speed in Linux using commands

Well, there are multiple approaches to do this and you can use any of them.

Test Disk Speed in Linux using dd

dd is a Linux built-in tool and can be used to generally indicate how much time it takes to complete an operation.

Step 1: Getting Disk Speed Test Result

To obtain a single digit as Write speed of the disk, you are supposed to run the following command and the output will look like the one in the picture below.

use dd to test disk speed

Also, you may use the two following commands to first delete the cached-in temporary file created in a buffer by our previous command, and then to measure the Read speed of the disk.

Step 2: Clearing Cache and Re-testing

test disk speed in linux

If you run the above commands repeatedly, you will see different results. To extract a better result, you can calculate the average of 4 measurements. Yet, the final result is far off the experience a user might have with the disk.

Test your HDD, SSD Read Speed using Hdparm

“hdparm” is another Linux command-line tool that can be used to derive a sequential read speed of a storage device.

Step 1: Install hdparm

First, you need to install “hdparm” on your Linux, and following that you may run a command to get a digit as the reading speed of the disk.

To install “hdparm” on CentOS, RHEL distributions:

To install “hdparm” on Mint, Ubuntu, Debian:

sudo apt-get install hdparm

Step 2: Run hdparm

Run the hdparm utility by entering the command below into the Linux Terminal

The output should look like this:

Better Test Disk Speed in Linux via fio

The previous benchmarks only account for sequential read/write speed tests. In practice, read/write interaction with the disk more often than not follows a random access pattern. This unqualifies sequential-based methods from estimating the real-world write/read speed of a disk. To overcome this shortcoming, “fio” has been developed.

Please note that speed is basically calculated in MBps. In this method, IOPS (Input/Output operations Per Second) is introduced for the sake of convenience. IOPS is just the same MB/s multiplied by BlockSize/1024, i.e. a bigger digit with the same unit.

Step 1: Install fio

“fio”, which is not available on Linux by default, can be installed easily nonetheless . To install this utility:

Читайте также:  Linux mint tools livecd usb

Step 2: Run an SSD Disk Speed Test

Let’s first run a basic test with the following specifications:

Data volume: 250MB, Reads: 80% of the whole data, Write: 20% of the whole data

Block Size: 4k, Disk: SSD, Performance Indicators: IOPS and MB/s, Type of test: Random read/write

Test disk speed using fio

The results are as follows:

Step 3: Run an HDD Disk Speed Test

Now let’s run the exact same commands for an HDD:

This random write speed test on HDD shows weaker performance than that of an SSD. Overall, an SSD outperforms an HDD in random access usage and that is why it is more recommended.

The advantage of “fio” is that you can go for sequential reads and writes tests as well. To do that for our HDD, we will need to type in “seqread” and “seqwrite” for – – readwrite.

Linux Hosting Simplified

Want a better way to host your websites and web apps? Developing something new? Simply don’t like Windows? That’s why we have Linux VPS.

Linux Disk Speed Test Using the Graphical Method

You can also use the native Linux Disk utility to perform disk speed tests without entering commands into the Terminal. Here, we’re going to use Ubuntu 21 as an example, but most Linux distros have the same utility.

Step 1: Open the Disk Utility

You can easily open the Disk Utility by entering the application menu and searching for “Disk” or by finding it in the menu under System → Administration → Disk Utility

Step 2: Select the disk for the test

On the left panel, you’ll see a list of all the disks available on your computer. Select the one you want to test by clicking on it.

Step 3: Run the Benchmark Feature

On the Disk Utility’s right panel, find and click on the ”Benchmark – Measure Drive Performance” button to start Benchmark up.

Step 4: Perform Tests

On the new screen with the chart, you’ll find two buttons. The first one is “Start Read-Only Benchmark” and it does just what it says: measure how fast your disk is when just reading from it. The other one is “Start Read/Write Benchmark” and it measures the speed of both I/O operations, which is bound to be slower. Click on each one in turn or simply select the one you want.

Linux Disk Speed Test Using the Graphical Method

Improving Linux Disk Speed Using NVMe

Linux readily has a built-in tool named dd for measuring disk speed, which is particularly efficient for HDDs speed test as the hard drives are commonly used for large sequential writes and read. However, dd and also “hdparm” are two easy-to-use methods to test disk speed in Linux, they only address sequential access patterns. In other words, they miserably fail to provide a decent speed estimate of disks like SSDs that are used for both large and small files. also, you can read my detailed comparison of NVMe vs SSD.

This is because an SSD can have a random read and write usage. “fio” is a more reliable utility as it mimics the real-world condition for speed test and runs a disk speed test for both random access and large sequential writes and reads. So the next time you purchase a service, make sure you rightly test the throughput to and from your disk so that you do not experience latency.

Читайте также:  Команда линукс просмотр свободного места

FAQ

How do I check disk read and write speed in Linux?

You can use different command-line utilities like hdparm and fio, or you can use the graphical GONME application Disk Utility for a disk speed test.

How do I increase disk read speed in Linux?

There are several ways to do that, but without getting into too many technical details, I can say using hdparm with the “–direct” option is a good example since it lets you bypass cache.

What is the command to check disk speed in Linux?

There are three commands for disk speed test in Linux: dd, hdparm, and fio. This article will tell you how to use these commands in the Terminal.

Источник

Как измерить скорость жесткого диска

Иногда хочется быстро прикинуть, как работает дисковая подсистема, либо сравнить 2 жестких диска. Очевидно, что измерить реальную скорость дисков практически невозможно, она зависит от слишком большого числа параметров. Но получить некое представление о скорости дисков можно.

Если у вас есть желание научиться администрировать системы на базе Linux, рекомендую познакомиться с онлайн-курсом «Linux для начинающих» в OTUS. Курс для новичков, для тех, кто с Linux не знаком. Подробная информация.

Проверка скорости чтения диска

Проще всего измерить скорость диска с помощью программы hdparm. Установить ее очень просто:

Теперь нужно вывести список дисков и разделов в системе:

disk-speed-01

Выбираем нужный раздел и проверяем скорость чтения:

disk-speed-02

Обращаю ваше внимание еще раз на то, что мы видим очень примерные цифры, которые имеют значение только в сравнении с другими цифрами, полученными в схожих условиях. hdparm выполняет последовательное чтение с диска. В реально работе скорость чтения диска будет другой.

Проверка скорости записи на диск

Для того, чтобы измерить скорость записи на диск, можно воспользоваться стандартной утилитой linux — dd. С ее помощью мы создадим на диске файл размером 1 Gb частями по 1Mb.

Измеряем скорость записи на диск:

# sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync

disk-speed-03

Я измерял скорость на виртуальной машине, диск которой был размещен на RAID5, собранным из 5-ти дисков SAS 10к. В принципе, неплохой результат. Можно изменить размер файла и блоков, из которого он записывается. Если сделать файл побольше, результат скорости диска может получиться более приближенный к реальности.

А вот скорость диска на VDS, который я арендую. Результат в разы хуже:

disk-speed-04

Скорость диска на виртуальной машине, расположенной на втором SATA диске моего рабочего ноутбука:

disk-speed-05

Результат не очень, надо разбираться в чем дело. Давно возникли подозрения, что с диском что-то не то, заметно подтормаживают виртуальные машины, хотя раньше это было не заметно. Жаль, результатов более ранних тестов не сохранилось.

Интересно было бы посмотреть на ваши результаты тестов. Если же вы хотите серьезно измерить скорость дисков, то вам сюда — Как правильно мерять производительность диска.

Если у вас есть желание научиться администрировать системы на базе Linux, но вы с ними никогда не работали и не знакомы, то рекомендую начать с онлайн-курса «Linux для начинающих» в OTUS. Курс для новичков, для тех, кто с Linux не знаком. Цена за курс минимальная (символическая). Информация о курсе и цене.

Источник

Оцените статью
Adblock
detector