How could a flash cache degrade database performance rather than improve it? Lessons to be learnt from multi-tiered storage
Abstract
Contrary to intuition, host-side flash caches can degrade performance rather than improve it. With flash write operations being expensive, cache hit-rates need to be relatively high to offset the overhead of writes. Otherwise, the end-to-end performance could be worse with flash cache. We believe that some lessons learnt from multi-tiered storage systems can be applied to flash cache management. Multi-tiered storage systems migrate data based on long-term I/O monitoring, carefully ensuring that the background data migration does not adversely affect foreground I/O performance. To test our hypothesis, we designed and implemented a new flash cache, named Scalable Cache Engine (SCE). In SCE, cache populations occur in the background in 1 MiB sized fragment units rather than the typical storage I/O size (4 KiB). By doing so, we warm-up the flash cache much faster while also benefiting from a prefetching effect that is very effective for improving cache hit-rates when the workload demonstrates strong spatial locality. Additionally, large, aligned writes to flash are much more efficient than small random ones and therefore reduce the cache population overhead. We show that our approach successfully tackles several issues of existing flash cache management approaches and works well for OLTP database workloads. For instance, the throughput under a TPC-E workload actually degraded by 79.1% with flashcache, a popular open-source solution, compared to the baseline performance. For the same conditions, SCE could achieve a 301.7% improved throughput.