{"id":28,"date":"2015-03-02T19:34:59","date_gmt":"2015-03-02T19:34:59","guid":{"rendered":"http:\/\/lisas.de\/~alex\/?p=197"},"modified":"2026-03-30T22:41:23","modified_gmt":"2026-03-30T20:41:23","slug":"raid-tuning","status":"publish","type":"post","link":"https:\/\/lisas.de\/luges\/index.php\/2015\/03\/02\/raid-tuning\/","title":{"rendered":"RAID Tuning"},"content":{"rendered":"<p>In order to get maximum performance with the newly setup RAID, I added some udev rules (by placing them in \/etc\/udev\/rules.d\/83-md-tune.rules) to increase caching. The file has one entry for each of the involved disks (sd<span style=\"color: #ff9900\">X<\/span>) to adjust the read-ahead:<\/p>\n<pre>ACTION==\"add\", KERNEL==\"sd<span style=\"color: #ff9900\">X<\/span>\", ATTR{bdi\/read_ahead_kb}=\"6144\"<\/pre>\n<p>And one for the md<span style=\"color: #ff9900\">X<\/span> device to adjust the read-ahead as well as the size of the stripe cache:<\/p>\n<pre>ACTION==\"add\", KERNEL==\"md<span style=\"color: #ff9900\">X<\/span>\", ATTR{bdi\/read_ahead_kb}=\"24576\", ATTR{md\/stripe_cache_size}=\"8192\"<\/pre>\n<p>With these settings dd yields the following results when copying a large file:<\/p>\n<pre>$ sync; echo 3 &gt; \/proc\/sys\/vm\/drop_caches $ dd if=largefile of=\/dev\/null bs=16M 20733648232 bytes (21 GB) copied, 60.4592 s, 343 MB\/s<\/pre>\n<p>Which is nice &#8211; and rather pointless as the clients connect with 1G links so they see only one third of that performance at best&#8230; Note that the caches will cost extra kernel memory, so if you&#8217;re low on RAM you might want to opt for lower cache sizes instead.<\/p>\n<p>Update: I forgot to mention that I also switched from the <em>deadline<\/em> (which is the default for current Ubuntu systems when installed as servers) to the <em>cfq<\/em> I\/O scheduler as the <a href=\"http:\/\/www.admin-magazin.de\/content\/download\/1173\/10683\/file-Scheduler-und-RAID-Performance.pdf\">test results from this article<\/a> suggest that it is the optimal scheduler for RAID Level 5 no matter whether it is HW or SW controlled.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In order to get maximum performance with the newly setup RAID, I added some udev rules (by placing them in \/etc\/udev\/rules.d\/83-md-tune.rules) to increase caching. The file has one entry for each of the involved disks (sdX) to adjust the read-ahead: ACTION==&#8221;add&#8221;, KERNEL==&#8221;sdX&#8221;, ATTR{bdi\/read_ahead_kb}=&#8221;6144&#8243; And one for the mdX device to adjust the read-ahead as well [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-luges"],"_links":{"self":[{"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":8,"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":1854,"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions\/1854"}],"wp:attachment":[{"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lisas.de\/luges\/index.php\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}