As I am preparing to take the EMCISA (EMC Information Storage Associate) exam, there are some really interesting topics that the exam covers, I’d like to discuss these topics here. Part of the reason is to help me retain some of this information as it is going to be beneficial when doing any sort of storage sizing or performance benchmarking.
What is Native Command Queuing? It is a feature of a SATA (Serial ATA) disk that allows the drive itself to optimize/prioritize the sequence of read/write commands to improve the performance of the drive. For example, let’s say that in order for the drive to do reads and writes, it has to access different parts of the disk, that can lead to decreased performance, create delays, and so on. These delays can then impact application performance.
In order to determine the best and most efficient order of Reads and Writes, the drive will use an algorithm, this algorithm will essentially reduce the seek time, which in turn improves the efficiency of drive.
It is worth noting, that at times, there could be delays with NCQ as the reads and writes get prioritized, meaning some reads and writes will be pushed ahead of others, however the improvement in the seek times and reduction of mechanical positioning time will increase the efficiency of the drive by quite a bit.
SSD Native Command Queuing
NCQ on an SSD allows for the processing of multiple requests at the same time (parallel operations) and ensures that the SSD will continue to process data while the CPU is busy processing tasks.
Solid State Drives are completely different from the traditional hard drives as they don’t have any of the mechanical parts. Instead, SSD’s use NAND FLASH memory (Non-Volatile Memory) to store data which is a lot faster when compared to a traditional hard drive.
Next, we’ll discuss TRIM
Some of you are probably aware of TRIM and what it does, however for those that are not, I’ll explain why TRIM is important on an SSD.
Before I explain what TRIM does, we first need to understand how data is written to an SSD. You see, unlike mechanical hard disks, SSD’s are made up of flash memory (multiple Non-Volatile chips) where we can permanently write data to. Within these chips, we have Blocks (512KB) which are made up of Pages (4KB). Data is then written on to these blocks/pages through the SSD controller. Now in theory, this works great when the drive is empty, however things begin to change once we start populating the drive with data and we run into a problem called Block-Rewrite Penalty
Block-Rewrite Penalty occurs when we need to write data to an occupying page where data already exists. This means we need to rewrite the entire block even though the data is only on one page. This occurs due to the communication problem between the operating system and the SSD controller. On the OS side, the pages and blocks have been marked as available, however on the SSD, the pages are still occupied with data so the data still needs to be purged. This impedes performance due to the fact that that the contents of the block must be read and modified before the block can be rewritten.
So here is where the TRIM command feature comes into play. TRIM allows for the Operating System to communicate with the SSD controller and notify it of which pages the data has been deleted from. The SSD will then use this information to delete the pages from within the blocks instead of the whole block itself, which increases the performance of the drive.
TRIM and NCQ are definitely valuable features to look for when purchasing SSD’s. If you’ve already purchased an SSD and don’t have TRIM enabled, try and see if the vendor of the drive released a firmware update that will introduce this feature. You’ll also have to make sure that you have TRIM support enabled within the BIOS.