CIT 668: System Architecture Scalability
1. Scales 2. Types of Growth 3. Vertical Scaling 4. Horizontal Scaling 5. n-tier Architectures 6. Example: Wikipedia 7. Capacity Planning Topics
What is Scalability scalability(n): the ability of something, especially a computer system, to adapt to increased demands - dictionary.com
Scalability Scalability is not about how fast your system is. Scalability focuses on the question if you double the number of servers, is your system twice as fast? Speed matters, since if your servers are twice as fast, you only need to buy half as many, but it s not the same as scalability.
Scales
Physical Scales 10-15 10-10 10-8 1m 10 6 m 10 21 m
Physical Scales and Technology 10-15 10-10 10-8 1m 10 3 m 10 6 m 10 21 m Intel 10 13 m IBM Khalifa NASA
Orders of Magnitude from 10-15 to 10 26 m Atomic to Cellular Human Scales Astronomical Scales
Types of Growth
Linear, Cubic, and Exponential Growth
Moore s Law is Exponential
Internet Growth
Data Center Energy Growth
Supercomputer Performance http://www.top500.org/statistics/perfdevel/
Horizontal and Vertical Scaling
Vertical Scaling
Plenty of Fish 1.2 billion page views per month, 500,000 average unique logins per day 30+ million hits per day, 500-600 per second 45 million visitors per month top 30 site in the US, top 10 in Canada, top 30 in the UK 2 load balanced Windows Server 2003 x64 web servers with 2 Quad Core 2.66Ghz CPUs, 8 GB RAM, 2 hard drives 3 database servers. No data on their configuration Approaching 64,000 simultaneous connections and 2 million page views per hour Internet connection is a 1 Gbps line, 200 Mbps is used 1 TB per day serving 171 million images through Akamai 6 TB storage array to handle millions of full sized images uploaded every month to the site http://highscalability.com/plentyoffish-architecture
Plenty of Fish Scaling We upgraded from a machine with 64 GB of ram and 8 CPU s to a HP ProLiant DL785 with 512 GB of ram and 32 CPU s and moved from SQLserver 2005 to 2008 and windows 2008. Markus, https://plentyoffish.wordpress.com/2009/06/14/upgrade s-themes-date-night/ Estimated cost ~ $100,000
Horizontal Scaling
Load Balancing Internet Load Balancer Server 1 Server 2 Server N
Googol = 10 100 Sun Ultra 2 2 200 MHz processors First Rack 8 CPUs 200 GB Large Container Data Centers > 10 6 servers
Horizontal vs. Vertical Scaling Example Total budget is $100,000 Vertical: PoF HP ProLiant DL785 32CPU,512GB Horizontal: 83 1U servers for $1150 each Lenovo ThinkServer RS110 barebones $600 8 GB RAM $100 2 x ebay drive brackets $50 2 x 500 GB SATA hard drives, mirrored $100 Intel Xeon X3360 2.83 GHz quad-core CPU $300 Comparison: Scaling Up Scaling Out CPUs 32 332 RAM 512 GB 664 GB Disk 4 TB 40.5 TB http://www.codinghorror.com/blog/2009/06/scaling-up-vs-scaling-out-hidden-costs.html
n-tier Architectures
Horizontal Problem: DB Synchronization Internet Load Balancer Web Server 1 DB Server 1 Web Server N DB Server N Server 1 Server 2 Server N
Solution: Use a Single Database Load Balancer Web Servers DB Server
n-tier Architecture Presentation Tier User interface: Client UI + web server Application Tier Business logic Web server dedicated to dynamic content Data Tier Databases (dynamic data) Filesystems (static data)
n-tier Architecture Separating system into tiers enables Each tier to scale horizontally, thus allowing Greater horizontal scalability than 1-tier architectures. n-tier advantages Tier-specific security policies can be tighter. Can separate management of tiers. n-tier disadvantages Complexity of design and management Communication overhead between tiers
Scaling the Data Layer Load Balancer Web Servers DB Master (read/write) writes reads Load Balancer DB Replicas (read-only)
Scaling Example: Wikipedia
Wikipedia Architecture 2004
Wikipedia Architecture 2005
Wikipedia Architecture 2006
Wikipedia Architecture 2008
Wikipedia Architecture 2010
Capacity Planning
Wikipedia Traffic Metrics Peak Traffic http://www.nedworks.org/~mark/reqstats/reqstats-weekly.png
Effect
Scaling Projections
Key Points 1. Scalability is not about how fast your system is; it s about how performance grows with increasing resources. 2. Vertical scaling ( scaling up ) means getting a faster server with more storage. 1. Vertical hits a ceiling when you get the biggest machine available (or affordable.) 3. Horizontal scaling ( scaling out ) means getting a larger number of servers. 1. Horizontal hits Amdahl s law ceiling much later than vertical hits hardware ceiling.
References 1. AWS, Getting Started with AWS CloudFormation, http://docs.aws.amazon.com/awscloudform ation/latest/userguide/gettingstarted.html. 2. Theo Schlossnagle, Scalable Internet Architectures, Sams Publishing, 2007.