Facebook uses a seasoned Chef to keep servers simmering

Facebook found that the Chef configuration management system was best suited to controlling the company's massive infrastructure

When it comes to keeping its thousands of servers running smoothly, Facebook relies on the open source Chef configuration manager, modified slightly to handle the size of the social networking giant's huge infrastructure.

"Chef's biggest advantage for us is its flexibility," said Phil Dibowitz, a Facebook systems engineer.

Chef is one of a number of open source configuration management tools that have grown in popularity over the last few years.  As data centers grow ever larger, companies look to automate routine operations around deploying and upgrading servers, switches, OSes, databases and other components. Facebook's experience in managing its infrastructure may hold lessons for other organizations as well.  Facebook wanted "a new way to manage its systems," Dibowitz said.   Although Facebook does not reveal the total number of servers it runs, industry observers estimate it could be in the tens of thousands, at least. Surprisingly, the company only has a handful of employees -- four on latest count -- on the core infrastructure team, of which Dibowitz is a member. Prior to using Chef, Facebook had been using another open source configuration management package, called CFEngine. The deployment was growing increasingly unwieldy, however.  Using CFEngine version 2, Facebook was experiencing a rapid and unchecked proliferation of system control files.  With CFEngine, users could not edit a configuration management file directly. Instead, each time operations engineers needed to make a change to a system, they would copy a similar system file, make the necessary changes, and then submit the file back to CFEngine. "In doing so, they added a couple hundred lines of stale configuration," Dibowitz said. As a result, the infrastructure team did not know all the various configuration permutations it had on hand, or even which of the configuration settings were outdated. "It became really unsupportable," Dibowitz said. To look for a new open source configuration management system, the team ran a number of tests comparing Chef, Puppet, and Spine, which was developed by Ticketmaster.

Chef best fit the bill for a number of reasons, Dibowitz explained.

Chef offers great flexibility on how to write configuration changes, thanks in part to how it is based on Ruby, a full-fledged programming language that can be easy to learn for administrators and engineers.

"There's no limiting factor. You don't have to be in the Domain Specific Language [DSL] that CFEngine or Puppet gives you," Dibowitz said. "From there, we had a lot of power to do what we wanted."

Chef offered a number of other advantages as well. It could manage settings at a  much more granular level. It also offered more flexibility in how to manage the configuration files themselves, Dibowitz said.

Specifically, Chef provides the ability to modify a configuration file for a specific user.

"The database administrators, the Web foundation guys, the cache guys -- all these people can write just a little bit of code for just the settings they care about, and not have to worry about anything else," Dibowitz said.

For instance, if MySQL administrators need more memory for a database, they can just enter that single requirement into Chef. Any change made to a configuration file is then propagated across all of Facebook within minutes.

"If you make a change, it goes across the world in 30 minutes or less," Dibowitz said.

Giving line-of-business engineers this control, in turn, helps the core infrastructure team. "This allows us to do way more work with way fewer people," Dibowitz said.

Facebook, however, had to modify the way Chef handles out-of-date configuration changes. The software offers no easy way of automatically deleting changes when they are no longer needed. "This is not a comfortable thing to do when you are at the scale of hundreds of thousands of systems," Dibowitz said.

Typically, organizations use Chef by building their own "cookbooks," or list of configuration changes that Chef then applies to a system.

Facebook, however, took the process a step further. The company's engineers developed a set of templates for defining the defaults in each configuration file, calculating a numerical hash to match the original template.

Each time Chef runs a configuration file it can then use the hash value to delete all entries that have been designated as no longer needed.

It is an uncommon way of using Chef, Dibowitz admitted. This way of working with Chef does not require any additional tooling, though. "This is all stuff built into Chef, we're just using it differently," he said.

The company has rolled out Chef to manage all of its servers and is in the process to migrating other software and hardware onto Chef as well.

Facebook has also fed some of the code modifications it has made back to the company shepherding the Chef code base, also now called Chef, after changing its name from Opscode in December.

The engineers also wrote some additional open source utilities for Chef, some of which have been posted on GitHub. One such tool is called Grocery Delivery, which allows multiple Chef clusters to keep their cookbooks in sync. As a result of the code being on GitHub, others have contributed additional changes back to Facebook.

Perhaps most importantly for Facebook though, Chef allows system managers to have greater control of their own configurations, an approach that Dibowitz admitted has attracted some criticism, which he doesn't mind

"Our job at Facebook is to get out of the way of our engineers and let them do their jobs," Dibowitz said. "Our job is not only to make these systems reliable but also to give everyone the access they need to get their jobs done."

Joab Jackson covers enterprise software and general technology breaking news for The IDG News Service. Follow Joab on Twitter at @Joab_Jackson. Joab's e-mail address is Joab_Jackson@idg.com

Join the PC World newsletter!

Error: Please check your email address.

Tags softwareIT managementFacebook

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.

Joab Jackson

IDG News Service
Show Comments

Essentials

Microsoft L5V-00027 Sculpt Ergonomic Keyboard Desktop

Learn more >

Lexar® JumpDrive® S57 USB 3.0 flash drive

Learn more >

Mobile

Lexar® JumpDrive® S45 USB 3.0 flash drive 

Learn more >

Exec

Lexar® JumpDrive® C20c USB Type-C flash drive 

Learn more >

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

Learn more >

Audio-Technica ATH-ANC70 Noise Cancelling Headphones

Learn more >

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

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?