Facebook is releasing mcrouter, its software for turning many cache servers around the world into one distributed system, as open source.
The company announced the release on Monday at its @Scale conference in San Francisco, where it also launched a new open-source project called TODO (Talk Openly, Develop Openly) to make it easier for organizations to use open-source software.
By offering mcrouter as open source, under a BSD (Berkeley Source Distribution) license, Facebook is making the tool available to more users. Facebook is already using it to handle traffic involving thousands of cache servers at the company's data centers around the world, and recent Facebook acquisition Instagram used it on AWS (Amazon Web Services) before switching over to its new parent company's infrastructure, Facebook engineer Rajesh Nishtala said at the conference.
Facebook claims mcrouter can handle almost 5 billion requests per second. The company does more than 4 billion operations per second through its cache tier, while Instagram does about 100 million, Nishtala said.
Cache servers keep the data most used for an application available in RAM for quick delivery, saving applications from having to dig those bits out of storage, Nishtala said. But what was once a nice-to-have performance booster is now relied on for some services, so how it's implemented is critical.
"Sites could become dependent on cache, and the loss of cache could have adverse effects for any site that leverages cache," Nishtala said.
To take full advantage of all the caches in a distributed infrastructure, Facebook developed mcrouter.
Specifically, mcrouter handles traffic for cache infrastructures that use Memcached, a popular distributed memory caching system. It uses the standard ASCII Memcached protocol as an API (application programming interface), because all clients capable of talking to Memcached servers understand that protocol, Facebook said. To clients, mcrouter looks like a Memcached server, and to servers, it looks like a client.
All the features of mcrouter were developed to solve real-world challenges at Facebook and Instagram, so they're all production quality, he said. All of the companies' cache operations go through mcrouter.
Mcrouter handles a wide range of tasks required to keep a cache infrastructure running and efficient, including monitoring, automatic failover detection and cold cache warmup, Nishtala said. Facebook used to implement those functions in its PHP stack. "As you can imagine, this stack got pretty loaded, pretty quickly," Nishtala said. Inconsistent implementations can lead to corrupted data, so Facebook wanted to rein in its caching infrastructure.
Among other things, mcrouter can act as a front end to many Memcached servers, allowing companies to distribute a growing data set across multiple servers when it no longer fits on one. It can also divide memory space into separate pools for different workloads, saving those workloads from having to share space.
Sign up for MIS Asia eNewsletters.