To Write-Cache or not to Write-Cache, that is the question

saixbot

Senior Member
Joined
May 23, 2006
Messages
587
Reaction score
8
I have a PCI-express x1 RAID controller and just setup Win7Pro x64 on a RAID 1 set. Browsing around the Silicon Image device properties I came across an option that got me thinking, so I wanted to put it out there and see what y'all have to say:

Under the Write Caching policy its defaulted to Enable write caching on the device enabled.
All good and well and the splurb below the tick box makes reference to improving system performance etc but the down side is if there is a power outage/equipment failure you lose any unwritten data to the HDD RAID set.

The next option below that makes reference to [and is not ticked by default]:
Turn off Windows write-cache buffer flushing on the device
Here the splurb says to prevent data loss, do not select this check box unless the device has a separate power supply that allows the device to flush its buffer in case of power failure.

Now this PC is connected to a UPS so do I turn off one or the other, leave them as is, or enable both of them? It will mainly be used to receive remote connections (VPN) so I don't want the HDD's to fall into sleep mode either. Not sure if the above will influence power management to the drives but that said I will still set them to always on mode.

The UPS is an APC2200 SmatUPS so I am sure there is some software and an interface I will have to install as well, just haven't got to that part yet.

Please help, many thanks in advance.
 
Hi Saix,

Good point.
write cache on a RAID card is nice (fast) but it can quickly turn into a double edged sword (when used without battery backup).


In my experience: Expensive RAID cards all have a write cache battery backup on-board the card (a separate battery).
The bigger the write cache obviously the faster the RAID.

When power or UPS fails (or the server crashes), the data still left in the RAID cache (which the OS thinks has been written to HDD) is saved (by the on-board battery) until the server is restarted.
The data is THEN written to HDD or the writes (if they're corrupt) are reverted to the OS/application.

Write cache makes writing data faster (the data is written from cache to HDD when the RAID card thinks it's good to do so).
The RAID controller doesn't wait for the physical writes to take place before telling the OS it can continue.

If you don't have a battery backed up cache (just plain old fashioned write cache) and the power fails or the server crashes, chances are you'll lose data or corrupt your swop file (if it's also on RAID)
This is more true for "busy" databases (SQL, Exchange etc).

The UPS software & cable is super important.
Once the UPS battery runs out (and there's no software telling the PC to do a graceful shutdown) the PC will basically just crash (as-if someone pulled the power cord)

Best practice: Install the serial or USB cable between UPS & PC + install the UPS software and set the shutdown threshold. (amount of battery life remaining when the server should do a shutdown - usually about 5 minutes for a PC, MUCH longer for servers as their shut down sequence takes much longer)

For a PC I'd maybe do some tests, test the performance with RAID caching enabled/disabled.
see if it actually makes such a big difference.
My experience with RAID write caching only covers database servers where multiple concurrent writes are involved (and caching obviously helps a lot in these instances)
 
The expensive RAID cards with Write Cache batteries are awesome.

If you're running a desktop PC with RAID 1 on an APC SmartUPS, then I would definitely enable Write Cache.
Just make sure that your UPS is connected to the desktop PC via USB cable, so that the PC would safely turn off once the UPS' batteries are low.
 
Top
Sign up to the MyBroadband newsletter
X