Eliminating the I/O bottleneck
HDD vs. SSD: Why difference matters
There’s an ongoing battle between HDDs and SDDs, both of which have their own pros and cons. An HDD is composed
Now that we understand the difference, then what exactly is an SSD cache? It is the temporary storage space of frequently accessed data (aka hot data) on flash memory chips in an SSD. Reserving a certain portion as the cache where hot data is stored, lower-latency SSDs can respond to data requests more readily, accelerating read/write speeds and boosting the overall performance.
When running applications requiring higher random IOPS or when large amounts of data are written to non-contiguous blocks (e.g., OLTP databases and email services), building an all-SSD system can burn a hole in your pocket. But fear not, there’s a way out — SSD cache. You can mount an SSD cache to a single storage volume or block-level iSCSI LUN to create a read/write buffer, enhancing random access performance. Note that since large sequential read/write operations such as HD video streaming lack re-reading patterns, such workload patterns cannot benefit much from SSD caching.
The SSD cache can be categorized into the following two modes:
- Read-only cache: When you set an SSD as the read-only cache, only frequently accessed data is stored in the cache to accelerate random read speeds. Because it’s not involved in writing data, data will remain safe and sound even when the SSD breaks down.
- Read-write cache: Compared to the read-only cache, the read-write cache writes data synchronously to the SSD. To ensure data safety, you need at least two SSDs to set up RAID 1 to allow fault tolerance of one SSD. But there’s still a risk of data loss if the number of worn-out SSDs exceeds the fault tolerance in a RAID configuration.
Choosing it right
The more frequently an SSD writes data, the shorter its lifespan will be. Finding an adequate SSD that fits your IO demands is paramount since you don’t want your cache drive to wear out too quickly. When picking the right SSDs to set up an SSD cache for your NAS, you should evaluate SSD endurance by looking closely at two specifications: TBW (Terabytes Written) & DWPD (Drive Writes Per Day). TBW means the cumulative amount of data that can be written to an SSD over its entire lifetime, while DWPD refers to how many times you can overwrite the entire SSD every day during the warranty period. If you know your drive’s capacity and its warranty period, then you can simply convert TBW to DWPD or vice versa with the equation below:
- TBW = DWPD X 365 X Warranty (yr) X Capacity (TB)
- DWPD = TBW / (365 X Warranty (yr) X Capacity (TB))
Say your SSD is 2TB with a 5-year warranty. If the DWPD is rated 1, it means that you can write 2TB of data into it on a daily basis for the following 5 years. Based on the above equation, the TBW figure will be 1 * 365 * 5 * 2 = 3650TB. You’d better replace it before it reaches 3650TB. Keep track of your everyday NAS usage to evaluate the amount of written data and see if the TBW rating meets your needs.
If your day-to-day NAS usage involves write-intensive applications, it’s recommended to go for enterprise SSDs to make sure they can withstand heavy write activity. Consumer SSDs usually have a DWPD figure below 1. It is suitable to use it as a boot drive, but it cannot endure continued read/write workloads, though. Most enterprise SSDs, by contrast, have a higher DWPD ranging from 1 to 10 and therefore provides better endurance.
Starting off on the right track
Apart from SSD endurance, you should also consider the memory requirements of SSD caching. As an SSD cache requires a certain amount of system memory depending on the cache size, you may have to upgrade your memory if you want to mount a larger SSD cache. To maintain system stability, only 1/4 of the pre-installed system memory is allocated for SSD caching.
Since a 1 GB SSD takes up approximately 416KB system memory (including expandable memory), a 2 X 128GB SSD read-only cache (total 256GB) requires at least 104MB memory, while a 2 X 128GB SSD read-write cache (total 128GB) consumes 52MB memory. It should be noted that a lack of memory will, therefore, limit the SSD cache size.
Optimizing storage efficiency
If your NAS features a PCIe slot, you can consider installing a dual M.2 SSD adapter card which supports both SATA and NVMe SSDs to boost cache performance. With Synology M2D18, not only can you reserve more drive bays for data storage, but you also have flexible SSD options, for it supports M.2 modules in format 2280/2260/2242.
When considering adding an SSD cache to optimize performance, aside from referring to the compatibility list to find out compatible SSDs, we also highly recommend that you look up TBW and DWPD ratings in drive spec sheets to make sure SSD endurance meets your workload requirements.