Practical Load Balancing



Similar documents
Drupal Performance Tuning

"Charting the Course... Enterprise Linux Networking Services Course Summary

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

Load Balancer Comparison: a quantitative approach. a call for researchers ;)

MongoDB. The Definitive Guide to. The NoSQL Database for Cloud and Desktop Computing. Apress8. Eelco Plugge, Peter Membrey and Tim Hawkins

Applying the Benefits of Cloud and Clustering to your Shared Hosting Platform

Wikimedia architecture. Mark Bergsma Wikimedia Foundation Inc.

Cache All The Things

Common Server Setups For Your Web Application - Part II

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

Deployment Guide. AX Series with Microsoft Office SharePoint Server

Are You Ready for the Holiday Rush?

Implementing Reverse Proxy Using Squid. Prepared By Visolve Squid Team

Scalable Linux Clusters with LVS

System Administration of Windchill 10.2

Implementing and Administering an Enterprise SharePoint Environment

Repeater. BrowserStack Local. browserstack.com 1. BrowserStack Local makes a REST call using the user s access key to browserstack.

E-commerce is also about

Workflow Administration of Windchill 10.2

Software Environment. Options. Service guarantee:. 24/7 Hardware Support. 99% uptime

making drupal run fast

Web Browsing Examples. How Web Browsing and HTTP Works

Linux Server Support by Applied Technology Research Center. Proxy Server Configuration

INUVIKA OPEN VIRTUAL DESKTOP FOUNDATION SERVER

Scalable Linux Clusters with LVS

CS312 Solutions #6. March 13, 2015

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

Serving 4 million page requests an hour with Magento Enterprise

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

Computer System Management: Hosting Servers, Miscellaneous

IERG 4080 Building Scalable Internet-based Services

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

Wikimedia Architecture Doing More With Less. Asher Feldman Ryan Lane Wikimedia Foundation Inc.

BASICS OF SCALING: LOAD BALANCERS

Contents. Foreword. Acknowledgments

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

Virtual Private Servers

Installing and Configuring Websense Content Gateway

Asia Web Services Ltd. (vpshosting.com.hk)

CumuLogic Load Balancer Overview Guide. March CumuLogic Load Balancer Overview Guide 1

Fundamentals of Windows Server 2008 Network and Applications Infrastructure

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

"Charting the Course to Your Success!" MOC D Windows 7 Enterprise Desktop Support Technician Course Summary

Server 2008 SQL. Administration in Action ROD COLLEDGE MANNING. Greenwich. (74 w. long.)

Tushar Joshi Turtle Networks Ltd

High Availability CAS

WordPress Optimization

ZTE Australia Help Guides MF91

Mastering Tomcat Development

LIST OF FIGURES. Figure No. Caption Page No.

Availability Digest. Redundant Load Balancing for High Availability July 2013

Basic System. Vyatta System. REFERENCE GUIDE Using the CLI Working with Configuration System Management User Management Logging VYATTA, INC.

Load Balancing Web Applications

High Availability Low Dollar Load Balancing

insync Installation Guide

Designing, Scoping, and Configuring Scalable Drupal Infrastructure. Presented by David Strauss

SiteCelerate white paper

BIG-IP Virtual Edition Setup Guide for Linux KVM. Version 11.4

BorderWare Firewall Server 7.1. Release Notes

Quick Note 052. Connecting to Digi Remote Manager SM Through Web Proxy

Paul McFedries. Home Server 2011 LEASHE. Third Edition. 800 East 96th Street, Indianapolis, Indiana USA

Barracuda Load Balancer Online Demo Guide

Getting Started in Red Hat Linux An Overview of Red Hat Linux p. 3 Introducing Red Hat Linux p. 4 What Is Linux? p. 5 Linux's Roots in UNIX p.

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

Linux A first-class citizen in Windows Azure. Bruno Terkaly bterkaly@microsoft.com Principal Software Engineer Mobile/Cloud/Startup/Enterprise

Network Monitoring Tool with LAMP Architecture

F5 Configuring BIG-IP Local Traffic Manager (LTM) - V11. Description

1. Barracuda Load Balancer - Overview What's New in the Barracuda Load Balancer Barracuda Load Balancer Release Notes

Technical Note. vsphere Deployment Worksheet on page 2. Express Configuration on page 3. Single VLAN Configuration on page 5

VERITAS NetBackup TM 6.0

Virtual machine W4M- Galaxy: Installation guide

The course will be run on a Linux platform, but it is suitable for all UNIX based deployments.

How Comcast Built An Open Source Content Delivery Network National Engineering & Technical Operations

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

Networking. Systems Design and. Development. CRC Press. Taylor & Francis Croup. Boca Raton London New York. CRC Press is an imprint of the

Apple Pro Training Series. OS X Server. Essentials. Arek Dreyer. and Ben Greisler

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

Citrix NetScaler 10 Essentials and Networking

Web Performance. Sergey Chernyshev. March '09 New York Web Standards Meetup. New York, NY. March 19 th, 2009

Networking. Sixth Edition. A Beginner's Guide BRUCE HALLBERG

JAMF Software Server Installation Guide for Linux. Version 8.6

Tips for getting started! with! Virtual Data Center!

High Performance Cluster Support for NLB on Window

Configuring HAproxy as a SwiftStack Load Balancer

Oracle Big Data Handbook

Deployment Guide. AX Series with Microsoft Exchange Server

Linux VPS with cpanel. Getting Started Guide

Layers of Caching: Key to scaling your website. Lance Albertson -- Narayan Newton

SERVICE SCHEDULE PULSANT ENTERPRISE CLOUD SERVICES

Intro to Load-Balancing Tomcat with httpd and mod_jk

CNS-208 Citrix NetScaler 10 Essentials for ACE Migration

APV9650. Application Delivery Controller

Development of Web-Based Remote Desktop to Provide Adaptive User Interfaces in Cloud Platform

How To Connect To Bloomerg.Com With A Network Card From A Powerline To A Powerpoint Terminal On A Microsoft Powerbook (Powerline) On A Blackberry Or Ipnet (Powerbook) On An Ipnet Box On

Thingsquare Technology

Transcription:

Practical Load Balancing Ride the Performance Tiger Illtil Peter Membrey David Hows Eelco Plugge Apress8

Contents About the Authors About the Technical Reviewers Special Thanks to serverlove Acknowledgments Preface xvii xviii xix xx xxi Chapter 1: Introduction 1 The Problem 1 The Solution 2 What Is Load Balancing? 3 Load Balancing, Old Style 3 Load Balancing, New Style 3 Scaling Up 3 Scaling Out 4 Load Balancing, Finally 4 What Makes the Web Tick? 4 Caching: Warp Drive for Your Web Site 5 Load Balancing with DNS 5 Content Delivery Networks 5 Proper Planning Prevents Pretty Poor Performance 6 The Essentials 6 HTTP Load Balancing 6 Load Balancing Your Database 6 v

CONTENTS Load Balancing Your Network Connection 7 SSL Load Balancing 7 Clustering for High Availability 7 Load Balancing in the Cloud 7 IPv6: Implementation and Concepts 7 Where To Go Next 8 Summary 8 Chapter 2: How Web Sites Work 9 Let the Games Commence! 10 Coming from a Non-IT Background 10 Kicking Off the Process 10 Finding the Site with DNS 11 Connecting to the Server (Finally!) 11 On the Server itself 12 Talking to the Database 12 Quick Look at Caching 13 Back to the Client 13 Taking a Closer Look 13 The Network 14 TCP 14 DNS 16 Speed, Bandwidth, and Latency 17 Network Summary 20 HTML and the Web 20 HTML 21 Why is Text-Based Important? 21 Why is Linking Important? 22 HTML Summary 23 The Browser, 24

«CONTENTS Web Content 24 Static Content 25 Dynamic Content 25 Creating Dynamic Content 25 Web Content Summary 27 Databases: The Weakest Link 27 Summary 27 Chapter 3: Content Caching: Keeping the Load Light 29 What Is a Cache? 30 Whistle Stop Tour 30 Browser-based Caching 31 Web Accelerators 31 Web Proxies 32 Transparent Web Proxies 33 Edge-based Caching 35 Platform Caching 35 Application Caching 36 Database Caching 37 Just the Beginning 37 Caching Theory: Why Is It so Hard? 37 HTTP 1.0 Caching Support 38 HTTP 1.1 Enhanced Caching Support 38 The Solution 39 Caching Isn't as Easy as It Looks 40 Web Proxies 40 The Squid Proxy Server 41 Getting Started 41 Troubleshooting 43 vii

m CONTENTS Transparent Proxies 43 What's Going On 44 Getting a Helping Hand 45 Squid, the Swiss Army Knife of Proxies 46 Edge-based Caching: Introducing Varnish 46 Sane Caching by Default 47 Installing Varnish 48 Getting Up and Running 49 Customizing Varnish 51 Summary 51 Chapter 4: DNS Load Balancing 53 DNS Details 53 The IP Address 53 The Problem 54 The Solution 54 Taking a Step Back 55 DNS in Depth 55 Querying Yourself 56 Advanced DNS Queries 57 DNS Caching 58 Querying your DNS Cache 59 DNS Cache in Linux 60 The Real Stuff 60 BIND9 61 DNS DB Header 62 DNS Database Entries 63 Loading your DB 65 Checking the Config 65 viii

CONTENTS Common Issues 66 Testing your DNS 66 DNS Load Balancing 67 Advantages of DNS Load Balancing 67 Issues with DNS Load Balancing 68 Summary 69 Chapter 5: Content Delivery Networks 71 Choosing a CDN Provider 72 Getting Started with Rackspace 72 Adding Content to Your CDN Account 74 The Rackspace Cloud Files API 77 Integrating the API into PHP 77 Authenticating with Your API Key 78 Connecting and Disconnecting 78 Working with Containers 79 Working with Files 85 Other Useful Functions 91 Summary 92 Chapter 6: Planning for Performance and Reliability......93 you MAke Dinner In TiME 94 you 94 MAke 97 Dinner 97 In 98 TiME 100 The Importance of Planning 101 ix

S CONTENTS Backups 103 Why Backups Are so Important 103 There May Be Trouble Ahead 103 Automation is a Must 104 Tactical Backups 105 Strategic Backups 105 Incremental vs. Full 106 Please, Please Perform Test Restores! 106 Summary 106 Chapter 7: Load Balancing Basics 109 What Is Load Balancing? 109 What Computing Resources Are Available? 110 Processor (CPU) 110 Memory (RAM) 111 Checking Performance of CPU and RAM with top 111 Network 113 Storage (Disk) 114 Load Balancing in Practice 114 Guiding Principles 115 Understand Your System 115 Planning 116 Monitoring and Testing 116 Summary 116 Chapter 8: Load Balancing Your Web Site 117 Measuring Web Server Performance 117 Accelerating Apache HTTP 120 Disabling Unneeded Modules 120 Disabling DNS Lookups 121

a CONTENTS Using Compression 121 FollowSymLinks and SymLinkslfOwnerMatch 123 Accelerating nginx 123 worker_processes and worker_cpu_affinity 124 Gzip Compression 125 Load Balancing Your Web Server 126 The Setup 127 Preparing the Server 128 Preparing the Workers 130 Testing the Load Balancer 131 Best of Both Worlds 132 Summary 134 Chapter 9: Load Balancing Your Database 135 Setting up the MySQL Cluster 135 Installing the Management Software 137 Configuring the Management Software 138 Preparing the Cluster's Data Nodes 140 Installing the MySQL Server and NOB Daemon 141 Configuring the NDB Daemon 142 Starting the Cluster Node's Services 143 Updating MySQL's Root User 144 Testing the Installation 145 Applying Load Balancing 147 The Setup 148 Setting up the Load Balancer 148 Preparing the Workers 150 Testing the Load Balancer 150 Summary 151 xi

CONTENTS Chapter 10: Network Load Balancing 153 Sharing the Workload 153 TCP/IP 154 TCP 154 IP 155 Routing 155 The Load Balancer 157 IPVS 160 IPVS Scheduling 160 IPVS Installation onubuntu 162 IPVS Installation on Centos 163 IPVSADM 164 Expanding IPVS 166 Advanced IPVS 167 Changing Scheduling Algorithm 167 Assigning Weight Values 168 Protocol and Multiple Virtual Servers 170 Another IP Address 171 Making It Stick 173 Summary 174 Chapter 11: SSL Load Balancing 175 What are SSLandTLS? 175 Public-Key Cryptography 176 Trust and Certificate Authorities 177 TLS Encryption 178 TLS Load Balancing 178 xii

CONTENTS Configuring SSL on Your Web Server 179 Apache 181 Nginx 182 SSL Acceleration 182 Apache 183 Nginx 183 SSL Termination 183 Configuring Nginx 184 Testing the SSL 185 Further Configurations 187 Engine 187 Caching 188 Protocols 189 Specific Ciphers 189 LVS and Your SSL Terminator 191 Integrated Load Balancer/SSL Terminator 192 Summary 192 Chapter 12: Clustering for High Availability 193 High Availability 194 Single Point of Failure 195 Clustering 197 IPVS Failover 198 Install with Ubuntu 199 Install with Centos 200 Configure 200 Common Config Problems 203 Confirming Your System 204 Kiii

il CONTENTS Testing 206 Web Server Specifics 207 Ubuntu 207 Centos 207 Advanced Config Options 208 ha.cf 208 Idirectord.cf 208 Web Server 209 Summary 209 Chapter 13: Load Balancing in the Cloud 211 Cloud Computing 211 Virilization 212 Hypervisor 212 Virtualized Resources 215 Managing Virtual Resources 216 Balancing 217 Overprovisioning 219 Planning 219 Cloud Elasticity 220 Working with a Cloud Server 221 Summary 224 Chapter 14: IPv6: Implications and Concepts 225 IPv6 225 Hexadecimal Notation 225 Truncation 226

m CONTENTS IPv4 Exhaustion 226 Approach to IPv6 227 Advantages of IPv6 227 Implementation 228 Internet Connection 229 DNS 230 Operating System 230 Networking 230 Single Gateway Network 231 Dual Network 231 Application Support 231 Apache 231 Nginx 232 Varnish Cache 232 Memcached 233 IPVS 233 Ldirectord 234 Heartbeat 234 Summary 234 Chapter 15: Where to Go Next 235 Recap 236 Monitoring 236 Security 237 Access Control 238 Views 238 Common Exploit Prevention 239 xv

* CONTENTS Operating System Performance 240 Compile Yourself 240 Cut Down 240 High-Performance OS 241 Planning 241 Summary 241 Index.....243 xvi