{"id":254089,"date":"2021-05-20T02:37:00","date_gmt":"2021-05-19T23:37:00","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-test-your-linux-servers-disk-and-ram-speed-cloudsavvy-it\/"},"modified":"2021-05-20T02:37:00","modified_gmt":"2021-05-19T23:37:00","slug":"how-to-test-your-linux-servers-disk-and-ram-speed-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-test-your-linux-servers-disk-and-ram-speed-cloudsavvy-it\/","title":{"rendered":"#How to Test Your Linux Server\u2019s Disk and RAM Speed \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a42c9da31e28\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a42c9da31e28\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-test-your-linux-servers-disk-and-ram-speed-cloudsavvy-it\/#How_Is_IO_Performance_Measured\" >How Is IO Performance Measured?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-test-your-linux-servers-disk-and-ram-speed-cloudsavvy-it\/#Install_fio_for_Random_ReadWrite_Tests\" >Install fio for Random Read\/Write Tests<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-test-your-linux-servers-disk-and-ram-speed-cloudsavvy-it\/#Testing_Memory_Performance\" >Testing Memory Performance<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Test Your Linux Server\u2019s Disk and RAM Speed \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<figure style=\"width: 1000px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage wp-image-4451 size-full\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/11\/c265634c-e1587393087184.png?width=1200&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"server rack install\" width=\"1000\" height=\"510\" src=\"https:\/\/www.shutterstock.com\/image-photo\/young-administrator-installing-new-rack-mount-112274039\" data-credittext=\"Arjuna Kodisinghe\/Shutterstock\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><figcaption class=\"wp-caption-text\"><span class=\"type:primaryImage imagecredit\"><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.shutterstock.com\/image-photo\/young-administrator-installing-new-rack-mount-112274039\">Arjuna Kodisinghe\/Shutterstock<\/a><\/span><\/figcaption><\/figure>\n<p>If you\u2019re regularly writing or reading files, your disk speed can affect your server\u2019s performance. We\u2019ll show you how to measure your server\u2019s speed, and how to understand how it stacks up to the competition.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"How_Is_IO_Performance_Measured\"><\/span>How Is IO Performance Measured?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>There are many different ways to read and write to disks, so no single number exists for \u201cspeed\u201d that you can measure.<\/p>\n<p>The simplest way to measure performance is to time how long it takes to read large files or perform large file copies. This measures sequential read and write speed, which is a good metric to know, but you\u2019ll rarely see speeds this high in practice, especially in a server environment.<\/p>\n<p>A better metric is random access speed, which measures how fast you can access files stored in random blocks, mimicking real-world usage much more.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-2381 size-full\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/10\/6250c08a.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"List of read versus write speeds.\" width=\"700\" height=\"350\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>SSDs usually have fast random access speeds compared to hard drives, which makes them much more suited for <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/general\/\" data-internallinksmanager029f6b8e52c=\"3\" title=\"General\" target=\"_blank\" rel=\"noopener\">general<\/a> use. Hard drives still have decent sequential read and write speeds, which makes them good for data archival and retrieval.<\/p>\n<p>However, disk performance may not matter much for certain workloads. A lot of <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>lications cache objects in memory (if you\u2019ve got enough RAM), so the next time you want to read that object, it will be read from memory instead (which is faster). For write-heavy workloads though, the disk still must accessed.<\/p>\n<p>Speed is often measured in MB\/s, but certain providers may measure in IOPS (Input\/Output Operations Per Second). This is simply a bigger number meaning the same thing; you can find what IOPS from MB\/s with this formula:<\/p>\n<pre>IOPS = (MBps \/ Block Size) * 1024<\/pre>\n<p>However, some providers may not do a great job of telling you which benchmark they use for measuring IOPS, so it\u2019s good to do testing yourself.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Install_fio_for_Random_ReadWrite_Tests\"><\/span>Install fio for Random Read\/Write Tests<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>While Linux does have the built in <code>dd<\/code>\u00a0command, which can be used to measure sequential write performance, it isn\u2019t indicative of how it will behave under real-world stresses. You\u2019ll want to test your random read and write speed instead.<\/p>\n<p><code>fio<\/code>\u00a0is a utility that can handle this. Install it from your distro\u2019s package manager:<\/p>\n<pre>sudo apt-get install fio<\/pre>\n<p>Then, run a basic test using the following command:<\/p>\n<pre>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<\/pre>\n<p>This runs random read and write tests using a 250 MB of data, at a ratio of 80% reads to 20% writes. The results will display in terms of IOPS and in MB\/s:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-2508 size-full\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/10\/b72ff2b8-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"700\" height=\"169\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The above test was run on an AWS <code>gp2<\/code>\u00a0SSD, a fairly average SSD, which shows fairly average performance. Write performance will always be lower with any type of IO; many SSDs and HDDs have built in cache for the drive controller to use, which makes many reads fairly quick. However, whenever you write, you must make physical changes to the drive, which is slower.<\/p>\n<p>Running the test on a hard drive shows low random mixed IO performance, which is a common problem with hard drives:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2506\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/10\/391cf99b-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"fio hard drive test results\" width=\"700\" height=\"145\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Hard drives, though, are typically used for large sequential reads and writes, so a random IO test doesn\u2019t match the use case here. If you want to change the test type, you can pass in a different argument for <code>--readwrite<\/code>.\u00a0<code>fio<\/code>\u00a0supports a lot of different tests:<\/p>\n<ul>\n<li>Sequential Read: <code>seqread<\/code><\/li>\n<li>Sequential Write:<code>seqwrite<\/code><\/li>\n<li>Random Read: <code>randread<\/code><\/li>\n<li>Random Write:\u00a0<code>randwrite<\/code><\/li>\n<li>Random Mixed IO: <code>randrw<\/code><\/li>\n<\/ul>\n<p>Additionally, you can change the block size with the <code>--bs<\/code>\u00a0argument. We set it to 4K, which is fairly standard for random tests, but sequential reads and writes may show better or worse performance with larger block sizes. Sizes 16KB to 32KB may be closer to what you\u2019ll encounter under real load.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Testing_Memory_Performance\"><\/span>Testing Memory Performance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><code>fio<\/code>\u00a0can\u2019t test RAM speed, so if you want to benchmark your server\u2019s RAM, you must install <code>sysbench<\/code>\u00a0from your distro\u2019s package manager:<\/p>\n<pre>sudo apt-get install sysbench<\/pre>\n<p>This package can benchmark a lot of performance metrics, but we\u2019re only focused on the memory test. The following command allocates 1 MB of RAM, then performs write operations until it has written 10 GB of data, (Don\u2019t worry, you don\u2019t need 10 GB of RAM to do this benchmark.)<\/p>\n<pre>sysbench --test=memory --memory-block-size=1M --memory-total-size=10G run<\/pre>\n<p>This will display the memory speed in MiB\/s, as well as the access latency associated with it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\" alignnone wp-image-2522 size-full\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/10\/b72ff2b8-3.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Results of the testing of memory speed in MiB\/s, as well as the access latency associated with it.\" width=\"700\" height=\"291\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>This test measures write speed, but you can add <code>--memory-oper=read<\/code>\u00a0to measure the read speed, which should be a bit higher most of the time. You can also test with lower block sizes, which puts more stress on the memory.<\/p>\n<p>Realistically though, most RAM will be good enough to run just about anything, and you\u2019ll usually be limited more by the amount of RAM than the actual speed of it.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/2521\/how-to-test-your-unix-servers-disk-and-ram-speed\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Test Your Linux Server\u2019s Disk and RAM Speed \u2013 CloudSavvy IT&#8221; Arjuna Kodisinghe\/Shutterstock If you\u2019re regularly writing or reading files, your disk speed can affect your server\u2019s performance. We\u2019ll show you how to measure your server\u2019s speed, and how to understand how it stacks up to the competition. How Is IO Performance Measured?&#8230;<\/p>\n","protected":false},"author":1,"featured_media":254090,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/11\/c265634c-e1587393087184.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-254089","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/254089","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=254089"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/254089\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/254090"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=254089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=254089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=254089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}