3. How do you scale?
• Hardware
– Throwing more CPU, hard drive, network speed,
etc. at the problem
• Software
– Implementing caching solutions, reducing
overhead, tweaking algorithms, partitioning
• Infrastructure
– Vertical/horizontal scaling
4. Example: livejournal
1. 1 server: web + database
2. 2 servers: web, database
3. 4 servers: 3 web, database
4. 5 servers: 3 web, 2 database
5. <skip a few>
6. 24 servers: 2 lb’s, 3 gateways, 12 web, 1 master db, 6
slave db
7. 45 servers: 2 lb’s, 5 gateways, 25 web, 1 global db
master, 2 db cluster masters, 10 db slaves (6, 2, 2)
http://danga.com/words/2005_oscon/oscon-2005.pdf
5. Example: livejournal (cont’d)
• Didn’t even get into:
– Caching (memcached)
– Custom FS (MogileFS)
– Custom load-balancing (Perlbal)
6. Lessons learned
• Using any of the one scaling solutions will
help, but using them all intelligently will help
more
• If you need to scale, chances are you will have
to throw new hardware at the problem
• Need good system knowledge to understand
bottlenecks and points of failure
• The goal: