Keeping Up
Keeping Up
Almost two million new users from around the world sign up for Facebook each week—and we couldn't be happier. It's tremendously rewarding to see so many people find what we work on useful and fun. As we continue to add new users and features, however, the load on our thousands of servers continues to increase at a pretty astounding rate. A few weeks ago we reached full capacity in our California datacenters. In the past we handled this problem by purchasing a few dozen servers, hooking them up, and getting on with our lives, but this time we didn't have it so easy. We'd actually run out of space in our datacenters for new machines.
Fortunately we saw this problem coming a long time ago and started work on a new datacenter in Virginia. Now, we identify whether a user would be better off talking to the east coast datacenter or a west coast data center. For people in Europe and the eastern half of the US, it's noticeably faster to talk to a server in Virginia than in California. For these users we direct them to Virginia whenever they're browsing the site and not making any changes.
Whenever that person goes to change some data—uploading a photo album, or changing profile info for example—we send them off to California so that all our modifying operations happen in the same location. This decision was made to prevent two or more modifications from conflicting with each other and messing up our data. It might sound like we're forcing our users to go to California a lot but only about 10% of our traffic causes a modifying operation. MySQL has a great replication feature that allows us to, in real time, stream all the modifications happening on a California MySQL server to another one in Virginia. Replication happens so fast, even across the country, that the Virginia servers are almost never more than one or two seconds behind the California servers.
Even though all of the modification happens in California and streams instantly to Virginia, we were faced with another problem. Although Facebook's data is stored in MySQL database servers, we use a large number of memcached servers to store copies of the data. Memcached is much faster and able to keep up with requests quicker than the databases themselves can keep up. We had to figure out a way for memcached servers to replicate data concurrently with the MySQL databases. Because of various technical limitations of our architecture there was no easy way to do so.
Fortunately MySQL is open source software, meaning we can actually change the way it works by modifying the code. We did just that—embedding extra information in to the MySQL replication stream that allows us to properly update memcached in Virginia. This ensures that the cache and the database are always in sync. Over the last seven months a great team of Facebook employees has been building new software and setting up new servers like I described above. Over Thanksgiving we finally flipped the switch and since then almost 30% of our traffic has been served from Virginia.
The east coast datacenter is a great first step towards keeping Facebook fast and reliable as the site grows. Going forward we have lots of exciting plans to expand our infrastructure and improve performance so no user ever has to sit around waiting for a page to load.
Jason, a Facebook engineer, is all about the east coast.
Fortunately we saw this problem coming a long time ago and started work on a new datacenter in Virginia. Now, we identify whether a user would be better off talking to the east coast datacenter or a west coast data center. For people in Europe and the eastern half of the US, it's noticeably faster to talk to a server in Virginia than in California. For these users we direct them to Virginia whenever they're browsing the site and not making any changes.
Whenever that person goes to change some data—uploading a photo album, or changing profile info for example—we send them off to California so that all our modifying operations happen in the same location. This decision was made to prevent two or more modifications from conflicting with each other and messing up our data. It might sound like we're forcing our users to go to California a lot but only about 10% of our traffic causes a modifying operation. MySQL has a great replication feature that allows us to, in real time, stream all the modifications happening on a California MySQL server to another one in Virginia. Replication happens so fast, even across the country, that the Virginia servers are almost never more than one or two seconds behind the California servers.
Even though all of the modification happens in California and streams instantly to Virginia, we were faced with another problem. Although Facebook's data is stored in MySQL database servers, we use a large number of memcached servers to store copies of the data. Memcached is much faster and able to keep up with requests quicker than the databases themselves can keep up. We had to figure out a way for memcached servers to replicate data concurrently with the MySQL databases. Because of various technical limitations of our architecture there was no easy way to do so.
Fortunately MySQL is open source software, meaning we can actually change the way it works by modifying the code. We did just that—embedding extra information in to the MySQL replication stream that allows us to properly update memcached in Virginia. This ensures that the cache and the database are always in sync. Over the last seven months a great team of Facebook employees has been building new software and setting up new servers like I described above. Over Thanksgiving we finally flipped the switch and since then almost 30% of our traffic has been served from Virginia.
The east coast datacenter is a great first step towards keeping Facebook fast and reliable as the site grows. Going forward we have lots of exciting plans to expand our infrastructure and improve performance so no user ever has to sit around waiting for a page to load.
Jason, a Facebook engineer, is all about the east coast.
Archived Posts by Date
2009
November (9)
October (17)
September (10)
August (10)
July (11)
June (13)
May (13)
April (13)
March (14)
February (13)
January (8)
2008
December (15)
November (14)
October (12)
September (9)
August (2)
July (3)
June (6)
May (5)
April (6)
March (2)
February (4)
January (3)
2007
December (4)
November (4)
October (1)
September (3)
August (4)
July (4)
June (2)
May (5)
April (9)
March (8)
February (7)
January (4)
2006
December (3)
November (6)
October (5)
September (7)
August (4)
Archived Posts by Blogger
Abraham Cooper (1)
Adam Conner (4)
Adam Hupp (1)
Aditya Agarwal (2)
Akhil Wable (1)
Alex Moskalyuk (1)
Alexandre Roche (3)
Alok Menghrajani (1)
Annie Ta (1)
Ari Steinberg (2)
Arjun Banker (1)
Austin Haugen (1)
Barbara Fischkin (1)
Barry Schnitt (1)
Benjamin Ling (1)
Bikash Agarwalla (1)
Blair Heuer (1)
Blaise DiPersia (1)
Blake Chandlee (1)
Bo Hong Deng (1)
Bob Trahan (2)
Brian Shire (1)
Brynn Shepherd (1)
Cameron Marlow (1)
Carl R. Augusto (1)
Carolyn Abram (11)
Cat Lee (3)
Chad Little (2)
Chengos Lim (1)
Chris Cox (2)
Chris Hughes (2)
Chris Kelly (4)
Chris Putnam (3)
Chris Ward (1)
Craig Donato (1)
Dan Rose (1)
Daniel Chai (1)
Danna Gutman (1)
Dave Fetterman (1)
Dave Morin (1)
Doug Beaver (2)
Dustin Moskovitz (1)
Elizabeth Linder (2)
Elliot Schrage (2)
Eric Kwan (1)
Eric Zamore (1)
Evan Priestley (1)
Everett Katigbak (1)
Ezra Callahan (8)
Florin Ratiu (1)
Gareth Davis (1)
Gene Fant (1)
Ghassan Haddad (1)
Gibson Biddle (1)
Graeme Menzies (1)
Harry Huai Wang (4)
Henri Moissinac (1)
Jack Lindamood (1)
Jake Brill (1)
James Wang (2)
Jared Cohen (1)
Jason Min (1)
Jason Sobel (1)
Jeff Kanter (1)
Jeff Williams (1)
Jeffrey Wieland (1)
Jesse Dwyer (1)
Jessica Ghastin (1)
Jimmy Lavoie (1)
Joanna Lee (1)
Joe Green (1)
Joe Hewitt (3)
Joe Sullivan (1)
Joel Seligstein (1)
Jon Fougner (2)
Jon Warman (2)
Jonathan Hsu (1)
Josh Elman (1)
Josh Wiseman (2)
Julie Trescott (1)
Julie Zhuo (2)
Justin Bishop (1)
Justin Mitchell (1)
KC Estenson (1)
Kari Lee (1)
Kate Losse (3)
Kathy H. Chan (4)
Katie Carter (1)
Katie Geminder (6)
Kevin Arata (1)
Kevin Der (1)
Leah Pearlman (5)
Lee Byron (1)
Lisa P. Jackson (1)
Liz Perle (1)
Luke Shepard (1)
Makinde Adeagbo (1)
Malorie Lucich (1)
Marcia Velencia (1)
Mark Kinsey (2)
Mark Slee (9)
Mark Zuckerberg (18)
Matt Cahill (1)
Max Kelly (3)
Melissa Luu-Van (1)
Melody Quintana (1)
Michael B Kaiser (1)
Michael Gummelt (1)
Michael Richter (1)
Mike Honda (1)
Naomi Gleit (4)
Natalie Minor (1)
Navid Mansourian (1)
Nico Vera (3)
Nikki M. Flatley (1)
Paul C. Jeffries (1)
Paul Janzer (1)
Paul McDonald (1)
Pedram Keyani (1)
Pete Bratach (1)
Peter X. Deng (2)
Philip Fung (3)
Prashant Malik (1)
Randi Zuckerberg (5)
Raylene Yung (1)
Richard Allan (1)
Rob Goodlatte (1)
Robert Johnson (1)
Roddy Lindsay (2)
Ruchi Sanghvi (1)
Ryan McGeehan (3)
Sam O'Rourke (1)
Sameer Moidu (1)
Sandra Liu Huang (1)
Sara Lannin (3)
Sasha Rosse (1)
Scott Marlette (1)
Scott Mills (1)
Shaun King (1)
Shervin Pishevar (1)
Sheryl Sandberg (1)
Simon Axten (3)
Sophia Huang (1)
Steven Grimm (1)
Suzie White (1)
Ted Ullyot (1)
Teddy Underwood (1)
Tim Sparapani (1)
Tom Occhino (1)
Tom Whitnah (4)
Victor Valdez (1)
Wayne Chang (3)
Will Chen (3)
Xenia Nosov (1)
Yair Landau (1)
Yishan Wong (1)

