35. Scaling up: memory
ā¢ add more memory
ā¢ mongrel can be very memory-hungry
ā¢ useful for caching (memcached)
ā¢ hint: check crucial.com for low prices
36. Scaling up: CPU
ā¢ upgrade to quad-core Opterons
ā¢ available later this year
ā¢ same socket
ā¢ same power / heat envelope
ā¢ use as drop-in replacement
38. Scaling out
ā¢ app servers scale (almost) linearly
ā¢ use same hardware (if possible)
ā¢ one type of processor, memory, disk
ā¢ simpliļ¬es maintenance / repair
39. Bottleneck: application
ā¢ lots of concurrent users
ā¢ rails is single threaded (mutex lock)
ā¢ solution: add more mongrels
ā¢ rule of thumb: 10 mongrels per cpu
ā¢ twitter runs on ca. 300 mongrels
40. Bottleneck: database
ā¢ avoid to hit database
ā¢ cache as much as possible
ā¢ scale up database masters
ā¢ more disks = faster access
ā¢ add read-only db slaves
42. Scaling storage
ā¢ disk failure very common
ā¢ use RAID1 for database masters
ā¢ network storage
ā¢ example: ATA-over-Ethernet (AoE)
ā¢ accessible as block device
ā¢ combine with cluster ļ¬le system
44. ā¢ Evolving a cluster setup
ā¢ Scaling
ā¢ Make or buy?
ā¢ Discussion
45. Make or buy?
ā¢ think about total cost of ownership (TCO)
ā¢ not only hardware costs
ā¢ rackspace, power, bandwidth
ā¢ administration overhead
ā¢ āUtility? Or generator in the back
yard?ā (David Young)
48. ā¢ Evolving a cluster setup
ā¢ Scaling
ā¢ Make or buy?
ā¢ Discussion
49. Summary
ā¢ 2-machine cluster is cool (and quite
affordable) setup
ā¢ virtualization is a Good Thing
ā¢ scaling the database can be tricky
ā¢ make or buy depends on concrete situation