Write Cache – Things are too slow. Finding and Fixing Log Jams

STB Suite | The Industry Standard in Peripheral Testing.

Write Cache – Things are too slow! Finding & Fixing Log Jams

 

This article is written to ensure the testing is being completed as quickly as possible.

Some potential log-jams

Mixing slow and fast hardware

If you have a mixture of slow and fast hardware in your test system,  everything will slow down to match the slowest component.

For example – a 6Gb/s SAS HBA, testing 6Gb/s SAS or SATA disks, but in a 3Gb/s drive enclosure…will only run at 3Gb/s max.

Or, a 6Gb/s HBA, testing 6Gb/s disks, in a 6Gb/s enclosure, using a damaged/discarded interconnect cable – may run much slower than 6Gb/s.

 

How to tell?

  • Check your HBA part number (via Google, etc) to see what it’s max rated speed is. Same with your drive enclosure. Your drives should be labelled as to their speed.
  • Use the STB Suite to confirm your information
    • To see what your SAS drive reports it can do, right-click on it in STB Original Mode, choose “Edit Mode Pages”, and look at page 0x18-SAS SSP Page. Here is an example –


This is a drive rated/labeled at 6Gb/s, but it is actually connecting at 3Gb/s, as show in the yellow highlight at the top of the page. This likely indicates that it is in a 3Gb/s enclosure, or is attached to a 3Gb/s HBA.

    • To see what your SATA drive reports it can do, in STB Original Mode go to the top menu ATA/SATA->Commands->View IDENTIFY information. Select your drive from the drive list.
    • Use the search function and search for “speed” here is an example of a drive which can run (maximum) at 6Gb/s –
      Unfortunately at this time the SATA specification doesn’t provide a way to display what speed the drive has actually negotiated to.

Some potential log-jams – 2

Bad caching settings

The difference in write speeds with a drive set with Write Cache turned off, versus on, is amazing! An example drive tested with Write Cache OFF sustained a write transfer rate of 12 MB/s. With Write Cache turned ON that same drive sustains 125 MB/s! An order of magnitude, a 10-times speed logjam!

Checking Write Cache settings –

If you are curious to see what a drives Write Cache setting is, do the following-

  • SAS drive
    In STB Original mode, double-click on the drive, then select the Mode Pages tab –

    “WCE” stands for Write Cache Enable – 1 = On, 0 would = Off. One (1) is good, zero (0) is bad!
  • SATA drive 
    In STB Original Mode – go to top menu ATA/SATA->Commands->View/Set Features, then select the drive you are interested in. Here is a drive with Write Cache Enabled (On) –
  • Here is one which has Write Cache disabled (Off) –

Breaking the Log Jams

Mixed/Mismatched hardware

  • The way to fix the first example log jam (mixing slow and fast hardware) is to replace or insure that the entire data path in your test system is all the fastest you need. To confirm that bad cables aren’t causing problems you would look at the SAS/SSP mode page to make sure that your drives are indeed negotiating to their maximum speed.

Write Cache problems

It’s all well and good to look at individual drives using STB Original mode. And as you no doubt noticed, in the SAS Mode Pages and in the SATA View/Set Features functions you can change the drives cache settings.

Multiple drive environment

But that’s not going to work in a multi-drive test setup. So here’s how to make sure that all drives under test have their Write Cache turned on for testing –

 

 

SAS drives 
First, select a SAS drive in STB Original mode. Make sure that the drive has it’s WCE set to 1 using the Mode Page edit function. While you are there set up any other Mode Pages settings to the way you want them set.

Now, select the drive and go to top menu Disk->Create ModePage File for Diskscreening –

Use the Browse button and create your modepage.mpf (ModePageFile) file in the folder you want to keep it in. Might as well put it in your STB folder…

 

Now, in DMM, select the Pre-Test Actions tab, check the MODE Pages checkbox, the Set MODE Pages with file checkbox, and use the browse button to enter the name of your .mpf file previously created –

OK! Now, when you run any of your DMM Test Sequences, DMM will first set all drives Mode Pages to match the “Golden” drive you used to create your .mpf file. In this case – it will insure that WCE is enabled. As you run your test sequence you will see the Mode Pages being changed in the Test Progress window.

No more slow non-WCE-enabled drives slowing things down!

 

For SATA Drives 
As we all know, SATA drives do not have Mode Pages. Things like Write Caching are controlled via SATA Features.

Instead of using Pre-Test Actions, for SATA drives we will use a DMM Add-in external program called DMMSATASetFeatures.exe. This can be found in your STB folder in the sub-folder named DMM External Tests.

Copy the file DMMSATASetFeatures.exe to your test systems C:/ drive/folder. Open and read the file SATASetFeatures.pdf

You will see that the feature to turn on Write Cache is feature #2. So in DMM Test Setup click the External Test selection. At the Command Line Parameter pop-up enter “2” (no quotes) to set Feature 2. Use the browse button to select the file C:/DMMSATASetFeatures.exe”, and finally click “Add this test to test sequence” to put this test step at the top of your sequence.
 
You can confirm that all this was done correctly by clicking “View Test Sequence Details”

When you run your test sequence the first thing DMM will do is to use the SATA SET FEATURES command to set Write Cache on for all SATA drives under test.

Summary

We’ve covered two common log jams which can have severe effect on your test times.

Making sure that the entire hardware path is optimized for the highest possible speeds, and making sure that Write Cache is turned on for all drives under test.

You will be able to verify your results by looking at your DMM log pages – you should NOT see any outrageously slow drive speeds… During test you can also look at real-time performance numbers by either right-clicking on a particular drive and choosing Get Status. This will show you transfer rate information for the test step currently running.

Or you can go to the DMM Test Status tab and view and drive and any test step to see what transfer rates were attained.