3ware raid controller along with Adaptec and LSI are among the more      popular Raid controllers.  If you do have have right configurations you  will not get the performance you are looking for, even after spending  reasonable amount of money on these expensive controllers.

If you have write cache disabled on a 3ware raid controller , you may see very degraded performance for the raid array and enabling the cache can improve the performance reasonably. Though it is recommended that if you enable the write cache you must have battery backup for your Raid controller, else there could be chance for some data loss from the cache in case of an unexpected server outage. However battery backups add some more costs to the controller and many small operations may not able to afford them, so many admins still enable the write cache to gain the major performance benefits compared to small risk of possible data loss.

And practically for Raid10, I have not seen any major issues with write cache enabled for 3ware raid controllers without battery backups, so the trade-off is not that bad idea in this case, though it also depends on kind of operation you are running and how critical data you are hosting on the server.

You can check the current cache status and then enable or disable it using the 3ware command line utility tw_cli. First lets see how we can check the current status :

root@centos [~]# tw_cli info c0

Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy
------------------------------------------------------------------------------
u0 RAID-10 OK - - 64K 465.641 OFF OFF
Port Status Unit Size Blocks Serial
---------------------------------------------------------------
p0 OK u0 466.76 GB 490234752 WD-WCANKXXXXX34
p1 OK u0 466.76 GB 490234752 WD-WCANKXXXXX57
p2 OK u0 466.76 GB 490234752 WD-WCANKXXXXX82
p3 OK u0 466.76 GB 490234752 WD-WCANKXXXXX18

root@centos [~]#

As you can see in this case , its a Raid10 array and the write cache is set to OFF i.e. disabled.

Now to enable it, you need to note the controller and unit number so then it can enabled accordingly, in above case our command to enable write cache would be :

tw_cli set cache c0 u0 on

And below is a real time example on how it should look like for a successful operation :

root@centos [~]# tw_cli set cache c0 u0 on
Setting Write Cache Policy on /c0/u0 to [on] ... Done.

root@centos [~]#

Now lets check the status of the raid array again.


root@centos [~]# tw_cli info c0
Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy
------------------------------------------------------------------------------
u0 RAID-10 OK - - 64K 465.641 ON OFF
Port Status Unit Size Blocks Serial
---------------------------------------------------------------
p0 OK u0 466.76 GB 490234752 WD-WCANKXXXXX34
p1 OK u0 466.76 GB 490234752 WD-WCANKXXXXX57
p2 OK u0 466.76 GB 490234752 WD-WCANKXXXXX82
p3 OK u0 466.76 GB 490234752 WD-WCANKXXXXX18

root@centos [~]#

As you can see the write cache is enabled now, similarly you can disable the write cache using below command :

tw_cli set cache c0 u0 off

Now you know how to check and enable the write cache for 3ware raid controller, so go a head and try it on your server if you are not already using it, and you will see a good performance improvement.

Tags: , ,

2 Comments on How to enable write cache for 3ware Raid controller

  1. Jim Robinson says:

    Thanks for that – was looking at how to set write cache on remotely and this was just the ticket!

    Jim

  2. Ravi says:

    Really saved our life :)

Leave a Reply to Ravi Cancel reply