Scaling Twitter - Railsconf 2007

17

Click here to load reader

description

A conversational presentation on Twitter's scaling success with Rails.

Transcript of Scaling Twitter - Railsconf 2007

Page 1: Scaling Twitter - Railsconf 2007

Scaling Twitter

Alex & Britt(from Twitter)

Page 2: Scaling Twitter - Railsconf 2007

Preconceived notions.

Page 3: Scaling Twitter - Railsconf 2007

The story.

Page 4: Scaling Twitter - Railsconf 2007

So, what happened?

Page 5: Scaling Twitter - Railsconf 2007

What we did.

Page 6: Scaling Twitter - Railsconf 2007

More boxes.

‣ Not so many then. But now...‣ Mongrels across 19 cores.‣ Message processing/delivery across 16 cores.‣ Jabber across 2 cores.‣ MySQL on one big 8 core box.‣ 16GB+ for memcache across a bunch of

machines.‣ 32 cores total.

Page 7: Scaling Twitter - Railsconf 2007

That’s a lot.

Page 8: Scaling Twitter - Railsconf 2007

Why?

‣ 200 - 300 connections per second.‣ Spiking at 800 connections per second.‣ We’ve done 11,000 connections per second.‣ MySQL has spiked to 2,400 queries per second.‣ Alexa says we have a whole mess o’ traffic, and

they’re not even seeing the API traffic.

Page 9: Scaling Twitter - Railsconf 2007

memcache.

Page 10: Scaling Twitter - Railsconf 2007

memcache.

Page 11: Scaling Twitter - Railsconf 2007

memcache.

Page 12: Scaling Twitter - Railsconf 2007

Cache the hell out of everything.

Page 13: Scaling Twitter - Railsconf 2007

Denormalize.

Page 14: Scaling Twitter - Railsconf 2007

find(:all, :conditions => "substring( truncate(id,0),-2,1) = #{@fugly_dist_idx}", :limit => 10)

Page 15: Scaling Twitter - Railsconf 2007

Starling.

Page 16: Scaling Twitter - Railsconf 2007

Community.

Page 17: Scaling Twitter - Railsconf 2007

YOU CAN HAS QUESTIONS