Jump to content

Drive write speeds really slow (SOLVED)

8 posts in this topic Last Reply

Recommended Posts

Hello all,


I've just build a new unraid server and after playing around with a bit before I really start using it I was finding it the drive writes seemed to be a bit slow.


I first noticed the slowness while I was doing a badblock run on the new drives and after 50 hours it had just finished the first pass. For 4TB drives I understand it should take a total of 40hours or so for this size of drive. I did not see any errors and killed the process and proceeded to build the array with the drives and when it was doing the parrity build the stated write speed to the drive with 47MB/sec which seemed to me a bit slow for the drives. I checked the spec's from the manufacturer and it said it should be closer to 200MB/sec so I'm getting about 25% of the speed.


Next thing I did was boot into windows and ran a few benchmarking tools from there and they all reported read/write speeds about 200MB/sec... I did find that one of the LSI cards was in a PCIe 4x slot instead of an 8X one so I moved it to a new slot. 


Next try was a live linux USB to see if the problem was with unix after things seem to be fine in windows. Used knoppix and ran a few tests and the drives speeds where in the 200MB/sec again?!? 


My conclusion is the Unraid distro is the problem and not with hardware.


Now for some hardware details of my system:

Supermicro x10DRi-ln4+

2x intel e5-2630's

3x LSI 9211 HBA's connected to a supermicro BPN-SAS-846A backplane

6x HGST 4tb 3.5" HDD HUS726040ALS214 SAS drives


root@Thor:~# hdparm -Tt /dev/sdh

 Timing cached reads:   21860 MB in  1.99 seconds = 10970.43 MB/sec
 Timing buffered disk reads: 570 MB in  3.00 seconds = 189.82 MB/sec

root@Thor:~# dd if=/dev/zero of=/dev/sdh bs=128k count=10k
10240+0 records in
10240+0 records out
1342177280 bytes (1.3 GB, 1.2 GiB) copied, 28.5249 s, 47.1 MB/s

I'm not really sure where to look at next.


Share this post

Link to post

After a ton of Google-fu I was able to resolve my problem.


TL;DR Write cache on drive was disabled


found an page called How to Disable or Enable Write Caching in Linux. The artical covers both ata and scsi drives which i needed as SAS drive are scsi and are a total different beast.


root@Thor:/etc# sdparm -g WCE /dev/sdd
    /dev/sdd: HGST      HUS726040ALS214   MS00
WCE           0  [cha: y, def:  0, sav:  0]

This shows that the write cache disabled


root@Thor:/etc# sdparm --set=WCE /dev/sdd
    /dev/sdd: HGST      HUS726040ALS214   MS00

This enables it and my writes returned to the expected speeds


root@Thor:/etc# sdparm -g WCE /dev/sdd
    /dev/sdd: HGST      HUS726040ALS214   MS00
WCE           1  [cha: y, def:  0, sav:  0]

confirms the write cache has been set


Now I'm not total sure why the write cache was disabled under unraid, bug or feature? While doing my googling there was a mention of a kernel bug a few years ago that if system ram was more then 8G it disables the write cache. My current system has a little more then 8G so maybe?

  • Upvote 1

Share this post

Link to post
3 minutes ago, Vexorg said:

Now I'm not total sure why the write cache was disabled under unraid, bug or feature?

First time I hear that, maybe if it's limited to SAS drives since they are not used by many, still would think other people would have complained by now it it's a general problem.

Share this post

Link to post

Thanks for this Vexorg. I was searching for a different issue (SAS spindown issues) and saw your post. I had been building a new server and had poor performance but hadn't had time to research. What I found was interesting - all my HP branded SAS drives had write cache disabled, while all my Seagate drives had it enabled. These drives were split across two servers so my assumption is that this was set on the drives themselves at some point and that this has nothing to do with unRAID. 


Enabled write caching on the HP drives and performance is back to where I'd expect, so you saved me a ton of time. Thanks again.

Share this post

Link to post

Thanks for the info, does this have to be done each boot?


Also anyone that finds this latter, spparm can be installed from the Nerd Pack Plugin.


@limetech Can this been fixed/added in the Options Menu under Disk Settings?


@Squid Maybe add this in to the Turbowrite Plugin?

Edited by AnnabellaRenee87

Share this post

Link to post
5 hours ago, AnnabellaRenee87 said:

Thanks for the info, does this have to be done each boot?


I didn't have to do it again. I just had to do a reboot and it seems the setting has suck so far.

  • Like 1

Share this post

Link to post

Glad I saw this post, ran the commands in the 3rd post with my disk name. Worked instantly, thanks a ton.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now