Managing SSD tools with TKperf
No Detour
![](/var/linux_magazin/storage/images/issues/2016/187/tkperf/coverstoryimage-1_187.png/671120-1-eng-US/CoverStoryImage-1_187.png_medium.png)
TKperf combines several SSD tools under one roof. You can use TKperf to investigate SSDs before deployment and even to measure performance.
Linux offers several low-level tools for investigating solid state drives (SSDs). Admins are well advised to deploy these tools immediately, because they overwrite all data, which is a problem for SSDs in production use. One example of an SSD tool is FIO [1], an I/O-benchmarking application by Jens Axboe. Upon request, FIO bypasses the Linux page cache, starts multiple jobs in parallel, and runs with different I/O depths and workloads.
The tool can even claim Linus Torvalds' blessings. "It does things right, including writing actual pseudo-random contents, which shows if the disk does some "de-duplication" (aka "optimize for benchmarks)," Torvalds posted on Google Plus in 2012. "Anything else is suspect – forget about bonnie or other traditional tools," he added.
Hdparm [2] is also an old friend that can set and read parameters on (S)ATA hard disk drives; recent versions of Hdparm even support SSDs. Hdparm is capable of obtaining information about SSDs, and it also has a secure erase feature that erases the contents of the pages.
Hosting service provider Thomas Krenn has bundled these and other tools into a text-based open source utility called TKperf [3]. TKperf performs many long-winded performance tests for the connected SSDs and outputs graphics and files with the results of latency and data throughput measurements.
The TKperf bundle includes sg3-utils
(for Serial Attached SCSI), nvme-cli
(for NVMe devices, [4]), and the fusion
tools that take care of Apple's Fusion drives. In our lab, I replaced the hard disk in my laptop with an SSD (see the box "Installing TKperf"). I then ran TKperf on a USB stick (8GB) with an Ubuntu 14.04 Live system and 3GB permanent memory. As mentioned, you do not want any important data on the SSD, because TKperf will overwrite the contents.
Installing TKperf
Our lab team installed version 2.1 of TKperf on Ubuntu 14.04 LTS; the installation was a trouble-free process. The first task was to add the Thomas Krenn repository and then add the universe
and multiverse
entries to the /etc/apt/sources.list
file. It was then easy to install tkperf
and some additional packages, as well as the dependencies:
wget -O - http://archive.thomas-krenn.com/tk-archive.gpg.pub | sudo apt-key add - cd /etc/apt/sources.list.d sudo wget http://archive.thomas-krenn.com/tk-main-trusty.list sudo wget http://archive.thomas-krenn.com/tk-optional-trusty.list #Possibly manually add the "universe" and "multiverse" entries to your /etc/apt/sources.list sudo apt-get update sudo apt-get install tkperf screen rst2pdf
To use the tools on SSDs to which you do not have direct access, the developers recommend the screen
tool. rst2pdf
converts the reports created by TKperf to PDF format.
Unfrozen
When we called the tool during testing, we saw a warning message stating that TKperf would delete all the data. Shortly after starting, it canceled this activity, however. A look at the log showed that the device was in frozen mode. Frozen mode provides protection against accidental deletion. To unlock this mode, you need to unplug the disk on the fly and then push it back into the slot. This somewhat unconventional approach worked, and it seems to be a requirement for first time use in a new computer. Admins should take this into account before installing an SSD.
Measure What?
FIO, which runs in the background, can operate with different workloads and configurations [5]. FIO is based on the Solid State Storage Performance Test Specification (SSS PTS) Enterprise v1.0 [6].
You can test complete drives or simply access to individual files. Whether with sequential reading (--rw=read
) and writing (--rw=write
), random reading (--rw=randread
) and writing (--rw=randwrite
), or a mixed sequential (--rw=readwrite,rw
) or random (--rw=randrw
) workload, the software can handle several types of I/O tests. After the first call to
sudo tkperf ssd samsung850pro /dev/sda -nj 2 -iod 16 -rfb
you can see which tests [7] the tool puts the SSD through. It measures the latencies for average and maximum workloads (lat
), input and output operations per second (iops
), the write saturation (writesat
), and the data throughput (tp
).
In the preceding command, the -nj
parameter states the number of jobs, and the -iod
option sets the I/O depth [8]. The -rfb
parameter repopulates the buffers after each pass, so that the drives (in the example below /dev/sda
) do not start to compress. You can define the name samsung850pro
yourself.
When launched, the software works for several hours; an optional runtime display would be nice because nothing happens for a long time after starting. You can, however, manually limit the time using --runtime
and --times_based
limits.
Curve Sketching
The software generates numerous files that bear the name specified for the SSD (samsung850pro
). The files include data for charts that immediately convert measurement results into graphics (Figure 1). An XML file with the main test data is included, which is useful for comparisons with XML files from other SSDs. For example, to start a comparison with an Intel DC S3700 and generate appropriate graphics, you would type:
tkperf-cmp ssd intelDCS3700.xml samsung850pro.xml
The tkperf-cmp
file has been included since version 1.3; tkperf-cmp
generates comparison graphics. Finally, you also get an RST
file. Typing:
rst2pdf samsung850pro.rst
generates a PDF with a report on the test, including graphics.
![](/var/linux_magazin/storage/images/issues/2016/187/tkperf/figure-1/671123-1-eng-US/Figure-1_large.png)
Aside from the preparatory work and the long test period, TKperf offers an easy option for gathering meaningful data on SSDs. You can then do without vendor-specific SSD tools such as Samsung's Magician [9] or Intel's SSD Toolbox [10].
Infos
- Fio: http://freecode.com/projects/fio
- Hdparm: https://sourceforge.net/projects/hdparm/
- TKperf: https://www.thomas-krenn.com/en/wiki/TKperf
- NVMe: https://en.wikipedia.org/wiki/NVM_Express
- Fio basics: https://www.thomas-krenn.com/en/wiki/Fio
- Snia spec: http://www.snia.org/sites/default/files/SSS_PTS_Enterprise_v1.0.pdf
- Snia tests: http://www.snia.org/forums/sssi/ptstest
- I/O depth: http://www.qdpma.com/Storage/IoQueueDepthStrategy.html
- Samsung Magician: http://www.samsung.com/samsungssd/
- Intel SSD Toolbox: https://downloadcenter.intel.com/download/18455/Intel-Solid-State-Drive-Toolbox
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.