Facebook open sources its mcrouter data-caching tool

The software is designed to make caches across multiple data centers more reliable and efficient

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.

Another common cache problem is the lag that can come when new or recently reset servers have to be repopulated with data in demand. When the local memory pool for a given client is empty and an application can't quickly get the data it needs, mcrouter can look in a neighboring "warm" pool that's already up-to-date with the bits that are in demand. After coming through in a pinch, mcrouter can then automatically start populating the new pool with data from the warm one.

This type of "reheating" problem has been a big one for Reddit, which is now testing mcrouter, said Ricky Ramirez, an operations engineer at the social media site. Reddit runs entirely on AWS and consumes up to 300 servers at a time, backed by 73 back-end cache nodes with 1TB of memory, he said in a presentation at the conference.

When memory pools have to be taken down for modification, reheating the cache can take days, during which some users get slow page loads and "random error messages," Ramirez said. Mcrouter gives Reddit automatic failover, pooling of connections and other benefits, he said.

Stephen Lawson covers mobile, storage and networking technologies for The IDG News Service. Follow Stephen on Twitter at @sdlawsonmedia. Stephen's e-mail address is stephen_lawson@idg.com

Join the newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection

Tags redditstorageNetworkinginternetFacebook

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Stephen Lawson

IDG News Service
Show Comments

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Ben Ramsden

Sharp PN-40TC1 Huddle Board

Brainstorming, innovation, problem solving, and negotiation have all become much more productive and valuable if people can easily collaborate in real time with minimal friction.

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

David Coyle

Brother PocketJet PJ-773 A4 Portable Thermal Printer

I rate the printer as a 5 out of 5 stars as it has been able to fit seamlessly into my busy and mobile lifestyle.

Kurt Hegetschweiler

Brother PocketJet PJ-773 A4 Portable Thermal Printer

It’s perfect for mobile workers. Just take it out — it’s small enough to sit anywhere — turn it on, load a sheet of paper, and start printing.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?