Linux Server: How To Test Disk And RAM Speed

The disk and RAM speed of your Linux server can affect its performance: here are the tests to perform to measure the speed of your server. When you consistently work with documents, both perusing and composing, the speed of the plate being used directly affects the exhibition of the worker. While there is no single method to quantify circle and RAM speed, execution tests can be performed to screen I/O execution, for example, information info and yield. 

The most straightforward way is to gauge the time it takes to peruse enormous records or make duplicates of huge documents.  This permits you to estimate the consecutive peruse and compose speed, which is a decent measurement to comprehend and assess the exhibition of your circle; however, by and large, the velocities in the worker climate will be lower. 

Another viable technique estimates the speed with which you can get to records that are put away in arbitrary squares, not situated consistently. This strategy offers a superior measurement because it decides the speed boundaries is more like how gadgets are utilized in reality. Here are how to run the circle speed tests and the RAM of the Linux worker.

Disk And RAM: How Speed Is Measured

Before continuing, you need to distinguish between hard drives HDD ( Hard Disk Drive ) and SSD disks in the solid-state ( Solid State Disk ). SSD disks are extremely fast in the operations of random reading and writing of many small files scattered in different positions of the disk and the sequential reading and writing of large files. 

Therefore, they are the ideal choice in any usage scenario, but they cost much more than HDDs which, in turn, are cheap but offer good performance only in sequential read and write. This makes HDDs a good choice only if the server is used to store and retrieve a copy of user data, i.e., for online backup. But choosing a drive, be it rugged or SSD is not enough to guarantee good performance. 

RAM also plays a key role, as many applications cache (i.e., in RAM) large amounts of data. Consequently, when a user tries to read that data, it will be quickly read directly from memory. Of course, provided that the installed RAM is sufficient to contain all the cache data, which, otherwise, will be transcribed at least in part on the disk. 

This means that, for applications with a high data flow in reading and writing, it will be necessary to have a server with a lot of RAM and a high-speed disk. Otherwise, the overall performance will be below.  The units of measurement for the data transmission speed to be taken into account are mainly two. The most used is the Megabyte per second ( MB / S ), but some providers measure the speed of their servers in IOPS, i.e., input/output operations per second. 

The conversion between the two units of measurement can be done with the following formula: IOPS = (MB / s / Block size) x 1024. The term “block” refers to a group of sectors (in HDDs) or memory cells (in SSDs), which can have different sizes depending on the type of disk or its configuration. For this reason, it is impossible to know the actual speed of a disk when expressed in IOPS if we do not know the exact block size.

How To Use FIO For Performance Testing

The server Linux has an integrated command dd, an application that converts and copies a file. For this reason, it can be used to measure sequential write performance of blocks of data, but it has a limitation: it is not a test capable of reproducing stressed disc usage conditions in the real world.

Furthermore, this command also allows you to wipe and partition the disk so that improper use could result in the loss of essential files. The best way to measure the speed of random read and write is to use the fio utility software, which can be installed from the package manager of the Linux distribution in use through the command: sudo apt-get install fio

Once the utility is installed, you can proceed with a basic test that performs random reads and writes using 250MB of data and shows the speeds in IOPS and MB / s. To run the test, you need to use the command: fio –randrepeat = 1 –ioengine = libaio –direct = 1 –gtod_reduce = 1 –name = test –filename = random_read_write.fio –bs = 4k –iodepth = 64 –size = 250M – readwrite = randrw –rwmixread = 80

Typically, write performance is always lower with any I / O, but many hard drives and SSDs have a built-in cache, making read operations faster. Users will perform other types of tests by modifying some parameters in the command string mentioned above. For example, by substituting one of the following commands in place of -readwrite , FIO allows you to do the following:

seqread : sequential reading

seqwrite : sequential writing

Vandread : casual reading

randwrite : random writing

randrw : Random mixed I / O.

Furthermore, it is possible to change the size of the block being analyzed in the test by modifying -bs with the parameter that best suits the actual load that you want to test.

How To Test RAM Performance

If, on the other hand, a user wants to test the RAM speed of their server, the best utility to install is not fio but sysbench. To install the utility from your distribution’s package manager, the command to use is: sudo apt-get install sysbench

It is a package that allows you to monitor different metrics to run the benchmark of the server, but in particular, allows you to test the performance of RAM. Using the following command, 1 MB of RAM will be allocated, and writes will be performed until 10 GB of data is written:

sysbench –test = memory –memory-block-size = 1M –memory-total-size = 10G run.

The memory speed thus measured will be expressed in Mebibytes per second (MiB / s). The Mebibyte is the unit of measurement of the amount of data and is very similar to the Megabyte. For convenience, we can consider that a Mebibyte is equivalent to a Megabyte plus 4.9%.

In addition, the sysbench command also provides a measure of the RAM access latency, which is generally very low. If not, then there is likely a problem with the memory connectors with the motherboard, or the memory itself is terrible. Also, thanks to sysbench, it is also possible to measure the reading speed by adding the command –memory-oper = read to the string.

Combining these two measurements, the returned values ​​will evaluate the RAM speed in the write and read operations. By combining these results with the disk speed results, you can test the performance of the Linux server and discover any bottlenecks. In most cases, however, it is the disk that slows down the server and not the RAM: at most, it is possible that it is low, not that it is slow.

Also Read: Ubuntu Linux Distributions: How To Choose The Most Suitable One

Techno Publish: Technopublish.com is a reliable online destination for tech news readers who want to keep themselves updated on current innovations and advancements on topics related to technology.