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 Good Gear Guide newsletter!

Error: Please check your email address.

Tags redditstorageNetworkinginternetFacebook

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

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

Essentials

Lexar® JumpDrive® S57 USB 3.0 flash drive

Learn more >

Microsoft L5V-00027 Sculpt Ergonomic Keyboard Desktop

Learn more >

Mobile

Lexar® JumpDrive® S45 USB 3.0 flash drive 

Learn more >

Exec

Audio-Technica ATH-ANC70 Noise Cancelling Headphones

Learn more >

HD Pan/Tilt Wi-Fi Camera with Night Vision NC450

Learn more >

Lexar® Professional 1800x microSDHC™/microSDXC™ UHS-II cards 

Learn more >

Lexar® JumpDrive® C20c USB Type-C flash drive 

Learn more >

Budget

Back To Business Guide

Click for more ›

Most Popular Reviews

Latest News Articles

Resources

PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?