ProAnswers.org

How does Facebook achieve good performance?

There's no single reason, but a whole lot of reasons:




	
		Heavy usage of [memcached](http://memcached.org/)), which drastically cuts processing time. Slide 12 compares load time with APC (~130 ms) versus without it - 4050 ms. That's 30x faster!




	
		Usage of [HipHop](http://developers.facebook.com/blog/post/358), which converts PHP into C++ code (which is then compiled into much more efficient machine code than actual PHP).




	
		Facebook uses PHP and MySQL, but that's not the only thing they use. For example, they use [careers page](http://www.facebook.com/careers/), you'll see they are hiring developers with experience in C++, Java, Python, and others.




	
		Facebook has data distributed across many, many servers. In June 2010, FB had [60,000 servers](http://downloadsquad.switched.com/2010/06/29/facebook-doubles-its-server-count-from-30-000-to-60-000-in-just-6-months/). (think that's too much? Google had half a million... 5 years ago)




	
		Facebook sends [as little traffic as possible](http://www.facebook.com/note.php?note_id=307069903919): they use static CDNs to deliver static content. Gzip to compress data. Cookies, Javascript, HTML - everything is cut back to reduce the number of bytes sent over the network. They use a technology they call "BigPipe", which sends partial content rather than the whole page.