Thursday, March 20, 2008

How to Scale a Facebook Game to 300 million pageviews a month

While tracking down a presentation that Friends for Sale did, I ran across this excellent interview they did about scaling their backend at highscalability.com. It's fairly technical, but worth the read for anyone planning to handle 600,000 users a day (as I'm sure you all are).

Sample question from the interview:

What is your in/out bandwidth usage?

We used around 3 terabytes of bandwidth last month. This month should
be at least 5TB or so. This number is just for a few icons and
XHTML/CSS.

Yep, I just added 600,000 users = ~3 terabytes of bandwidth to my assumptions list in my budget projection, too. :)

5 comments:

Anonymous said...

Great interview but 12 servers is crazy for that type of traffic, something isn't optimzed as it should be. You can easily support that type of userbase with 2 to 3 servers very easily.

Bret, what do you think?

Bret said...

lol. Maybe I should have entitles the post: "How not to Scale". In any case, I'm not the one who has to handle the backend, thank god, so my opinion is as valuable as a 1997 guide to the World Wide Web. I will say that Plentyoffish gets a hell of lot more traffic (~500 million pageviews a month) and it runs off of 2 servers.

Brett said...

Interview seemed revealing to me. I do agree with anon, something sounds suspect in the distribution of servers. "2 to 3 servers very easily" is just as suspect.

The load created by a FB app page request (even one that hits the "entire Rails stack") should be relatively low. mySQL is known to scale to the loads described quite well.

I would over-engineer just in case. I would also strive for multiple levels of redundancy. Nothing loses DAUs faster than an unavailable app.

Bret said...

BTW, Brett with 2 t's in the above comment is Tenuki's master of development, so I agree with him 1 million percent.

Sidney said...

I've actually been trying to make a decision on a host myself beween Media Temple (2 dedicated nitros) or Softlayer (2 quad core dedicateds) so I don't run into those types of issues when/if my soon to be released Facebook game app grows.

Also, please tell "Brett" with 2 t's, Tenuki's master of development I really appeciate his insight and feedback as well.

Thanks!