CS 188/219. Scalable Internet Services Andrew Mutz October 8, 2015



Similar documents
BASICS OF SCALING: LOAD BALANCERS

Load-balancing web servers presented at AAU by Peter Dolog, Fall 2009, lecture 5, Web Engineering

Topics. 1. What is load balancing? 2. Load balancing techniques 3. Load balancing strategies 4. Sessions 5. Elastic load balancing

Understanding Slow Start

3/21/2011. Topics. What is load balancing? Load Balancing

Scalability of web applications. CSCI 470: Web Science Keith Vertanen

IERG 4080 Building Scalable Internet-based Services

ZEN LOAD BALANCER EE v3.04 DATASHEET The Load Balancing made easy

How To Balance A Load Balancer On A Server On A Linux (Or Ipa) (Or Ahem) (For Ahem/Netnet) (On A Linux) (Permanent) (Netnet/Netlan) (Un

ZEN LOAD BALANCER EE v3.02 DATASHEET The Load Balancing made easy

Load Balancing and Sessions. C. Kopparapu, Load Balancing Servers, Firewalls and Caches. Wiley, 2002.

Load Balancing Web Applications

PES. High Availability Load Balancing in the Agile Infrastructure. Platform & Engineering Services. HEPiX Bologna, April 2013

CS514: Intermediate Course in Computer Systems

S y s t e m A r c h i t e c t u r e

LOAD BALANCING TECHNIQUES FOR RELEASE 11i AND RELEASE 12 E-BUSINESS ENVIRONMENTS

Single Pass Load Balancing with Session Persistence in IPv6 Network. C. J. (Charlie) Liu Network Operations Charter Communications

Internet Content Distribution

Implementing the Application Control Engine Service Module

Architecting ColdFusion For Scalability And High Availability. Ryan Stewart Platform Evangelist

DEPLOYMENT GUIDE Version 1.0. Deploying the BIG-IP LTM with Apache Tomcat and Apache HTTP Server

Network Technologies

ZingMe Practice For Building Scalable PHP Website. By Chau Nguyen Nhat Thanh ZingMe Technical Manager Web Technical - VNG

Configuring Citrix NetScaler for IBM WebSphere Application Services

Large-Scale Web Applications

Content Delivery Networks

Load-Balancing Introduction (with examples...)

DEPLOYMENT GUIDE Version 1.1. Deploying F5 with IBM WebSphere 7

Content Delivery Networks

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

Apache Tomcat. Load-balancing and Clustering. Mark Thomas, 20 November Pivotal Software, Inc. All rights reserved.

Load Balancing for Microsoft Office Communication Server 2007 Release 2

Advanced Computer Networks. Layer-7-Switching and Loadbalancing

Oracle Collaboration Suite

How To Use The Cisco Ace Module For A Load Balancing System

CS312 Solutions #6. March 13, 2015

Load Balancing 101: Firewall Sandwiches

Basic Administration for Citrix NetScaler 9.0

Application Note. Active Directory Federation Services deployment guide

NEFSIS DEDICATED SERVER

Guide to Deploying Microsoft Exchange 2013 with Citrix NetScaler

DEPLOYMENT GUIDE. Deploying F5 for High Availability and Scalability of Microsoft Dynamics 4.0


DEPLOYMENT GUIDE Version 1.1. Deploying the BIG-IP LTM v10 with Citrix Presentation Server 4.5

bbc Adobe LiveCycle Data Services Using the F5 BIG-IP LTM Introduction APPLIES TO CONTENTS

Configuring Nex-Gen Web Load Balancer

Web Application Hosting Cloud Architecture

1. Comments on reviews a. Need to avoid just summarizing web page asks you for:

1. When will an IP process drop a datagram? 2. When will an IP process fragment a datagram? 3. When will a TCP process drop a segment?

Formación en Tecnologías Avanzadas

HUAWEI OceanStor Load Balancing Technical White Paper. Issue 01. Date HUAWEI TECHNOLOGIES CO., LTD.

Load Balancing Advanced Operation Manual

The story of dnsdist - or - Do we need a DNS Delivery Controller?

Chapter 10: Scalability

Deployment Guide AX Series with Citrix XenApp 6.5

Integrating the F5 BigIP with Blackboard

EE Easy CramBible Lab DEMO ONLY VERSION EE F5 Big-Ip v9 Local Traffic Management

REQUIREMENTS AND INSTALLATION OF THE NEFSIS DEDICATED SERVER

KeyControl Installation on Amazon Web Services

Managing Virtual Servers

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP LTM for SIP Traffic Management

FortiOS Handbook - Load Balancing VERSION 5.2.2

Basic & Advanced Administration for Citrix NetScaler 9.2

Server Traffic Management. Jeff Chase Duke University, Department of Computer Science CPS 212: Distributed Information Systems

DPtech ADX Application Delivery Platform Series

SAP WEB DISPATCHER Helps you to make decisions on Web Dispatcher implementation

Deploying the Barracuda Load Balancer with Office Communications Server 2007 R2. Office Communications Server Overview.

Apache HTTP Server. Load-Balancing with Apache HTTPD 2.2 and later. Erik Abele

Reverse Proxy Guide. Version 2.0 April 2016

CS640: Introduction to Computer Networks. Applications FTP: The File Transfer Protocol

Creating Web Farms with Linux (Linux High Availability and Scalability)

What's New in Cisco ACE Application Control Engine Module for the Cisco Catalyst 6500 and Cisco 7600 Series Software Release 2.1.0

CNS-200-1I Basic Administration for Citrix NetScaler 9.0

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP System v10 with Microsoft IIS 7.0 and 7.5

DEPLOYMENT GUIDE. Deploying the BIG-IP LTM v9.x with Microsoft Windows Server 2008 Terminal Services

Exam : EE : F5 BIG-IP V9 Local traffic Management. Title. Ver :

Introduction to ServerIron ADX Application Switching and Load Balancing. Module 6: Content Switching (CSW) Revision 0310

ExamPDF. Higher Quality,Better service!

Microsoft SharePoint 2010 Deployment with Coyote Point Equalizer

DEPLOYMENT GUIDE Version 1.1. Deploying F5 with Oracle Application Server 10g

CHAPTER 4 PERFORMANCE ANALYSIS OF CDN IN ACADEMICS

Advanced Networking Technologies

Load Balancer. Introduction. A guide to Load Balancing.

Cisco Application Control Engine Appliance

DEPLOYMENT GUIDE Version 1.2. Deploying F5 with Oracle E-Business Suite 12

Firewall Load Balancing

Microsoft SharePoint 2013 with Citrix NetScaler

Exploring Oracle E-Business Suite Load Balancing Options. Venkat Perumal IT Convergence

Microsoft Office Communications Server 2007 & Coyote Point Equalizer Deployment Guide DEPLOYMENT GUIDE

Protocolo HTTP. Web and HTTP. HTTP overview. HTTP overview

DEPLOYMENT GUIDE Version 1.2. Deploying the BIG-IP system v10 with Microsoft Exchange Outlook Web Access 2007

LOAD BALANCING IN WEB SERVER

Denial of Service Attacks

This presentation covers virtual application shared services supplied with IBM Workload Deployer version 3.1.

Transcription:

CS 188/219 Scalable Internet Services Andrew Mutz October 8, 2015

For Today About PTEs Empty spots were given out If more spots open up, I will issue more PTEs You must have a group by today. More detail at end of this lecture. If you still need a group, come up front during halftime.

For Today Motivation Vertical Scaling Horizontal Scaling For Next Time...

Motivation

Motivation After today s lecture you will understand what load balancing is, and and why the architecture depicted here allows cost effective and smooth scaling paths.

Motivation Suppose you ve built something the world is excited about. What do you do when your popularity doubles?...and doubles again. and again.

Motivation We ve mentioned buying bigger hardware and scaling up This is called vertical scaling This is easy to do, but hits limits We ve mentioned buying more servers and scaling out This is called horizontal scaling This is harder to do, but doesn t really have limits Today we will look at both.

Vertical Scaling Vertical scaling Use a server with more memory, more/faster cores, higher bandwidth, etc. On EC2, there are a few scaling paths T and M series: balanced mix of memory and CPU C series: emphasis on CPU R series: emphasis on memory How much bang do you get for your buck? Let s take a look...

Vertical Scaling We will use the same testing script from the last lecture... 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Going to the homepage Waiting for up to 2 seconds Requesting a form to create a new community Waiting for up to 2 seconds Submitting the new community Requesting a form to create a new link submission Waiting for up to 2 seconds Submitting the new link Waiting for up to 2 seconds Delete the link Waiting for up to 2 seconds Delete the community

Vertical Scaling When we test we will have 12 phases, of 60 seconds each: Phase 1 2 3 4 5 6 7 8 9 10 11 12 Users/sec 1 1.5 2 4 6 10 16 20 25 35 45 55 Remember these are users, not requests. There will be many requests per user, and users stay for 5-10s. Deployed using nginx/passenger.

Vertical Scaling M3 Large Instance 2 vcpus 7.5 GB Memory SSD storage Responds well with 6 new users per second, but fails with 10 ~$100 a month

Vertical Scaling M3 X-Large Instance 4 vcpus 15 GB Memory SSD storage Responds well with 10 new users per second, but fails with 16 ~$200 a month

Vertical Scaling M3 XX-Large Instance 8 vcpus 30 GB Memory SSD storage Responds well with 16 new users per second, but fails with 20 ~$400 a month, end of the M series.

Vertical Scaling C3 4X-Large Instance 16 vcpus 30 GB Memory SSD storage Responds well with 20 new users per second, but fails with 25 ~$600 a month,

Load Balancing Vertical Scaling has its place, but horizontal scaling is generally preferable. For HTTP, this technique is referred to as load balancing. Basic idea: have many servers that can serve clients, and make them appear as a single endpoint to the outside world Users experience is the same, regardless of which machine ultimately serves the request.

Load Balancing Question: how can we make many servers able to serve clients? What if I do the following actions: GET /products POST /products GET /products If these requests are handled by three different servers, will the third request show the new product?

Load Balancing In order for load balancing to work, these servers must be stateless. This is generally accomplished by keeping the persistence layer separate from the application layer

Load Balancing on the Web Idea #1: HTTP Redirects Discussed in section 6.1 of the reading Implemented using multiple web servers with different domain names www.domain.com uses http status 301 or 302 to redirect users to a pool of possible hosts.

Load Balancing on the Web % nc www.domain.com 80 GET / HTTP/1.1 host: www.domain.com HTTP/1.1 301 Moved Permanently Date: Wed, 15 Oct 2014 21:08:22 GMT Server: Apache/2.2.22 (Ubuntu) Location: http://www2.domain.com/ Content-Type: text/html; charset=iso-8859-1...

Load Balancing on the Web Strengths? Weaknesses?

Load Balancing on the Web Strengths: Simple Complete control over load balancing algorithm. Location independent. Weaknesses: Visible to user: URL bar, bookmarks, etc. www will see a lot of load.

Load Balancing on the Web Idea #2: Round Robin DNS Discussed in section 4.1 of the reading When user s browser queries DNS for www.example.com, a list of IPs is returned. User s browser chooses which IP to connect to (generally the first listed)

Load Balancing on the Web % host www.google.com www.google.com has address 74.125.224. 48 www.google.com has address 74.125.224. 51 www.google.com has address 74.125.224. 52 www.google.com has address 74.125.224. 49 www.google.com has address 74.125.224. 50 % host www.google.com www.google.com has address 74.125.224. 49 www.google.com has address 74.125.224. 52 www.google.com has address 74.125.224. 51 www.google.com has address 74.125.224. 50 www.google.com has address 74.125.224. 48

Load Balancing on the Web Strengths? Weaknesses?

Load Balancing on the Web Strengths: Easy Cheap Simple Weaknesses: Less control over balancing Modifying the list is inhibited by caching in the browser and proxies

Load Balancing on the Web Idea #3: Load Balancing Switch Discussed in section 4.1 of the reading AKA: TCP Load Balancing The idea: rewrite TCP packets to send them to the correct server Addresses, sequence numbers and checksums need to be rewritten on the fly Constructed using hardware (ASICs) to perform this fast Commercial products available: Cisco Content Services Switch Citrix Netscaler F5 Big IP

Load Balancing on the Web client -> switch : 216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=60, ID=48397 2.94950 216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421 Syn Seq=899863543 Len=0 Win=32120 switch -> client : 208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=48, ID=26291 2.95125 208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80 Syn Ack=899863544 Seq=1908949446 Len=0... client -> switch : 216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=40, ID=48400 2.98324 216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421 Ack=1908949447 Seq=899863544 Len=0... client -> switch : 216.64.159.149 -> 208.50.157.136 IP D=208.50.157.136 S=216.64.159.149 LEN=154, ID=48401 2.98395 216.64.159.149 -> 208.50.157.136 TCP D=80 S=1421 Ack=1908949447 Seq=899863544 Len=114... 2.98395 216.64.159.149 -> 208.50.157.136 HTTP GET /eb/images/ec_home_logo_tag.gif HTTP/1.0

Load Balancing on the Web switch -> server : 216.64.159.149 -> 10.16.100.121 IP D=10.16.100.121 S=216.64.159.149 LEN=48, ID=26292 0.00000 216.64.159.149 -> 10.16.100.121 TCP D=80 S=1421 Syn Seq=899863543 Len=0 Win=32120 Options... server -> switch : 10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=44, ID=22235 0.00001 10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80 Syn Ack=899863544 Seq=2156657894 Len=0... switch -> server : 216.64.159.149 -> 10.16.100.121 IP D=10.16.100.121 S=216.64.159.149 LEN=154, ID=48401 0.00131 216.64.159.149 -> 10.16.100.121 TCP D=80 S=1421 Ack=2156657895 Seq=899863544 Len=114... 0.00131 216.64.159.149 -> 10.16.100.121 HTTP GET /eb/images/ec_home_logo_tag.gif HTTP/1.0

Load Balancing on the Web server -> switch : 10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=40, ID=22236 0.00134 10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80 Ack=899863658 Seq=2156657895 Len=0 switch -> client : 208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=40, ID=22236 2.98619 208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80 Ack=899863658 Seq=1908949447 Len=0... server -> switch : 10.16.100.121 -> 216.64.159.149 IP D=216.64.159.149 S=10.16.100.121 LEN=1500, ID=22237 0.00298 10.16.100.121 -> 216.64.159.149 TCP D=1421 S=80 Ack=899863658 Seq=2156657895 Len=1460... 0.00298 10.16.100.121 -> 216.64.159.149 HTTP HTTP/1.1 200 OK switch -> client : 208.50.157.136 -> 216.64.159.149 IP D=216.64.159.149 S=208.50.157.136 LEN=1500, ID=22237 2.98828 208.50.157.136 -> 216.64.159.149 TCP D=1421 S=80 Ack=899863658 Seq=1908949447 Len=1460... 2.98828 208.50.157.136 -> 216.64.159.149 HTTP HTTP/1.1 200 OK

Load Balancing on the Web Strengths? Weaknesses?

Load Balancing on the Web Strengths: More control over which requests go to which servers Works fine with HTTPS Weaknesses: Constrains where the servers are Complicated

Load Balancing on the Web Idea #4: Load Balancing Proxy Also known as Layer 7 load balancing Terminate HTTP requests: act like a web server Issue back-end HTTP requests to real web servers to get responses. Many hardware products available: Citrix Netscaler BigIP F5 Most HTTP servers have modules to do this as well.

Load Balancing on the Web Strengths: Cleaner implementation than packet rewriting Weaknesses: Load balancer needs to be doing more work SSL is more complicated This is the most popular technique in use today. Technique #3 also used as well

Load Balancing on the Web Let s say you are designing a load balancing proxy You see every request go in and out. What algorithm would you choose for balancing between machines?

Load Balancing on the Web Let s say you are designing a load balancing proxy... You see every request go in and out. What algorithm would you choose for balancing between machines? Random Round robin Least number of connections Fastest response time Bandwidth per Server Based on URI (e.g. /images, or /cgi-bin) ELB uses Round Robin with cookie-based stickiness

Load Balancing on the Web Some interesting challenges come up when designing a load balancing proxy Detecting Server Failures Session persistence & affinity Connection pooling

Load Balancing on the Web Detecting Server Failures How do we know when a member of our pool has died? We can observe traffic: are requests being serviced? Some requests just take a long time. We can probe the server Various protocols ICMP ping: test network and kernel TCP connection set up: process is running HTTP HEAD: it s serving pages SNMP: server load

Load Balancing on the Web Session persistence & affinity Can we redirect users back to the same web server they used before? This can get us caching improvements A few options: Affinity based on client IP address Client IPs change & IPs can be shared HTTP Cookie Works, but needs proxy configuration Session ID in URL Hard to parse out in a load balancer (http://.../.../.../...?...&... &SID=01234&...) Your sessions are in your URL??

Load Balancing on the Web Connection Pooling We re used to the idea that one client reuses a TCP connection for many HTTP requests. We can reuse this mechanism for distinct clients Saves on repeated TCP setup Reduce idle waiting on server for reads and writes

Load Balancing on the Web Common Load Balancers Hardware Software F5 Big IP Apache Citrix Netscaler HAProxy Cisco Varnish Pound Squid Nginx...

Load Balancing on the Web Amazon Elastic Load Balancer Load balancing as a service $0.025 per hour plus $0.008 per GB processed Works with EC2 autoscaling Supports SSL termination Can load balance between Availability Zones within a Region Can t load balance between regions. Rely on Route 53 DNS for region failover.

Horizontal Scaling We will use the same testing script from before... 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Going to the homepage Waiting for up to 2 seconds Requesting a form to create a new community Waiting for up to 2 seconds Submitting the new community Requesting a form to create a new link submission Waiting for up to 2 seconds Submitting the new link Waiting for up to 2 seconds Delete the link Waiting for up to 2 seconds Delete the community

Horizontal Scaling When we test we will have 12 phases, of 60 seconds each: Phase 1 2 3 4 5 6 7 8 9 10 11 12 Users/sec 1 1.5 2 4 6 10 16 20 25 35 45 55 Remember these are users, not requests. There will be many requests per user, and users stay for 5-10s. Deployed using nginx & passenger.

Horizontal Scaling First we will look at breaking our database away from our single instance. This isn t horizontal scaling yet, but this change enables us to scale up the number of app servers

Horizontal Scaling 1 M3 Large Instance App server 2 vcpus 7.5 GB Memory SSD storage DB is also M3 Large. Responds well with 10 new users per second, but fails with 16 ~$200 a month

Horizontal Scaling Let s horizontally scale our app server by adding a second app server instance and see the effect on system performance

Horizontal Scaling 2 M3 Large Instance App server 2 vcpus 7.5 GB Memory SSD storage DB is also M3 Large. Responds well with 20 new users per second, but fails with 25 ~$300 a month

Horizontal Scaling Let s see how the system performs if we scale out to 5 app servers. Total dollar cost will be comparable to the most expensive single instance we tested

Horizontal Scaling 2 M3 Large Instance App server 2 vcpus 7.5 GB Memory SSD storage DB is also M3 Large. Responds well with 35 new users per second, does okay with 45, fails with 55 ~$600 a month

Horizontal Scaling Vertical scaling handled 20 new users per second for ~$600 per month, and left us with a nonexistent scaling path. Horizontal scaling handled 45 new users per second for ~$600 per month and left us with a clear path to increase scale

Motivation After today s lecture you should understand what load balancing is, and and why the architecture depicted here allows cost effective and smooth scaling paths.

For Next Time... Email me your group. Required info: Team name Each person s name, email, github acct. Read/do chapters 9 through 17 in AWDR by next Tuesday. Lab is tomorrow, I will meet with each group to discuss projects. If you need technical help, come to Franz 1260 Friday s noon to 2pm.