Right to left: SCSI, PATA, and SATA cables. The black device on the right is a SCSI Terminator.
SAS is the new SCSI
SAS stands for “Serial attached SCSI. It is a step forward from the old SCSI’s parallel-based transmission. SAS is quite similar SATA since it uses cabling with the same number of wires.
So, what is the difference between SAS and SATA cabling?
In a SATA cable, all data wires are grouped in one cable tree. In a SAS cable, the 4 data wires are separated into 2 cable-groups – each containing 2 wires. Each group contains one incoming and one outgoing wire. This segregation allows us to connect more devices to each other.
- With SATA cables, you can only connect the motherboard directly to the disk. True, you could attach an expansion device, but that costs money and takes up room inside the server. They also run for a short distance of up to one metre.
- With a SAS cables, you can daisy-chain devices – just like old SCSI. You can connect the motherboard to both a disk and another piece of hardware that has SAS connectors. SAS also supports longer cable lengths of up to 20 metres.
Which is disk drive option, SAS or SATA?
The answer greatly depends on your use case.
Comparing the mechanical version of both disk types (more on SSDs later), SATA drives have great storage capacities at a reasonable price. But, because of their relatively basic performance levels, SATA disks are more suitable for dense storage installations where you usually have tens, hundreds or even thousands of them. This way you can harvest the collective performance of the drives. On the other hand, SAS drives spin faster, have twice the bandwidth and IOPS of SATA, and are a bit more expensive. They also consume a bit more power, run hotter, and are noisier.
Looking at the spinning (mechanical) version only, we can see that:
SATA disks generally offer the following:
- 80 IPOS average
- 7200 RPM
- Larger capacity at the best price per Terabyte
- Good Cache Data Buffer (64 and 128 MB of flash cache are common. Enterprise versions have up to 512MB)
- Reasonable MTBF
- Average power consumption
- Lower operating noise and temperature
SAS disks generally offer the following:
- 150 IPOS average
- 10K and 15K RPMs
- Large capacities, although at a higher price per Terabyte
- Bigger Cache Data Buffer (256 and 512 MB of flash cache is the norm)
- Power consumption is slightly higher than SATA ones
- Operating noise levels are also higher than SATA disks due to the higher RPMs.
NL-SAS
Near-line SAS is a SAS variant spinning at 7200 RPM. NL-SAS offers a middle-ground between enterprise SAS and enterprise SATA disks. They are basically 7200RPM enterprise SATA with a SAS interface, making the only difference between them the protocol that they speak with the server. Under the hood, and except for the board/interface, they are mechanically identical. This makes them an attractive option for many users since they offer the high capacities and the good performance of SATA – paired with a SAS interface – at a lower price than 10K/15K RPM SAS.
SAS JBODS
One other advantage of SAS is that SAS controllers can have External ports to which you can attach JBOD enclosures. Those enclosures contain only backplane boards and can host additional drives to help increase your server’s capacity. No PC mainboard, CPU or RAM required, which means less expenditure.
Time Limited Error Recovery
Time Limited Error Recovery (TLER), Error Recovery Control (ERC), and Command Completion Time Limit are three different names for the same technology. It is a function available in NAS and enterprise-grade storage drives’ firmware.
When your hard drive encounters an error while reading or writing to its platters the drive will automatically keep trying to recover from that read or write error. While the disk is trying to recover from the error, the system has to wait on the disk to respond. If the disk takes too long the system will slow down. If the disk never completes the recovery the system might freeze or even halt – forcing you to reboot it with your fingers crossed that your data would still be accessible.
TLER improves this situation by limiting the disk recovery attempts to a defined number of seconds. 7 seconds is the recognised industry standard here, which should be enough for the disk to recover from a still readable/writable block. If the disk cannot complete the recovery within the given 7 seconds it will abort the recovery and move forward. Any corruption will then be corrected using the redundant data within the OpenZFS RAIDZ array.
One critical difference between how OpenZFS and conventional RAID controllers handle TLER-enabled drives is that, with a RAID controller, when an error occurs on the disk the RAID controller may stop using that disk altogether, mark it as faulty, and may even send the entire server into recovery mode to force you to replace the drive and imposing downtime.
OpenZFS, on the other hand, will recognise the issues with the drive, log the errors, and continue to use the drive – while keeping an eye on the errors. If the drive continues to produce errors ZFS will eventually mark it as degraded, and alert you to replace it – completely leaving the decision to you.
Some desktop drives’ firmware supports TLER but it is not enabled in the firmware at the factory and there is plenty of information online on how to enable the feature in the firmware. Just remember that, even if you manage to enable TLER on those drives, that will not make them any better suited for storage servers because they are still rated for 8-hours of daily load.
Avoid the SMR trap!
In mechanical disks, data is stored in concentric (parallel) tracks on the surface of their spinning platters – with a micro distance separating each track from the next. This technology is called Perpendicular Magnetic Recording (PMR) and it is the standard in enterprise storage drives.
SMR drives, on the other hand, use a Shingled layout to shrink the area those data tracks occupy thus increasing the total number of tracks and the overall amount of data that could be written on a single platter – thus, increasing disk capacity without having to increase the number of platters. A smart idea which could add up to 20% more capacity to the disk, except that the physics of the universe does not like it much.
Shingling meant that tracks must overlap each other, just like an array of roof tiles. This means that, during a write process at an area where data has been previously saved, data from the bottom tracks must be erased for the new data to be written over. To avoid data loss in this situation the disk must read all the data stored in that specific area (SMR Zone) and save it to its cache, before writing the new data. When the drive is idle it will retrieve the data that was stored in its cache and start writing it on the physical platters. This process takes time and results in slower disk performance. This is also why SMRs have such attractive cache amounts that the manufacturers make sure you can see on the label 😉
SMR drives have the worst I/O ever. Especially for random reads and writes. And during resilvering (OpenZFS’s term for RAID rebuild) the process will take much longer, especially when your pool is full.
SMR disks may make sense in archival systems. But in demanding storage applications SMRs is not worth the few cents you think will save by purchasing them. Soon you will have to throw those away to rescue your server’s deteriorating I/O. Do your research before buying a disk and watch out for disk manufacturers submarining SMR drives as non-SMR ones.