Facebook Delivers Flashcache 3.0

By Pedro Hernandez

Facebook has released Flashcache 3.0, disk caching software for Linux that employs flash storage to improve performance.

The social media giant, an early proponent of enterprise flash storage, employs solid-state storage to help deliver a responsive experience to the social network's 1 billion users. While hardware like Fusion-io's PCIe flash products perform much of the heavy lifting, the company also leans on software to optimize performance on a massive scale.

Used as a Linux kernel device mapper target, Flashcache has enabled Facebook to transparently improve database and application performance in hybrid storage environments since 2010. Now in version 3.0, the company has made significant strides in pushing SSDs further.

In a Facebook post, production database engineer Domas Mituzas revealed that after working on Flashcache 3.0 for the past few months, his team succeeded in "increasing the average hit rate from 60% to 80% and cutting the disk operation rate nearly in half." Describing Flashcache as "a building block in the Facebook stack," Mituzas reported that the new branch is already running on thousands of Facebook's servers "with much-improved performance over flashcache-1.x."

"Our busiest systems got 40% read I/O reduction and 75% write I/O reduction, allowing us to perform more efficiently for more than a billion users with a flip of a kernel module," boasted Mituzas.

To help attain those gains, the company took another look at read-write distribution. "Our analysis showed that a few regions on disk accounted for the majority of writes, and the distribution of reads was very uneven," wrote Mituzas.

A series of policy changes helped spread "hot data over more of the cache." Prior to the tweaks, "50% of the cache accounted for 80% of the disk operations," reported Mituzas. "After this change, 50% of the cache accounted for 50% of the disk operations," he added. Facebook also optimized cache eviction algorithms and tackled disk write efficiency with a "straightforward dirty data eviction method."

With the latest version of Flashcache out of the gate, work continues on integrating flash storage into the company's storage infrastructure. After some progress in driving efficiency with new metadata structures, Facebook is eyeing next-gen systems that support for multi-terabyte cache devices spanning tens of terabytes of disk-based storage, said Mituzas. The company is also working on "fine-grained locking to support parallel data access by multiple CPU cores."

Pedro Hernandez is a contributing editor at InfoStor. Follow him on Twitter @ecoINSITE.

This article was originally published on October 10, 2013