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



Similar documents
The mod_proxy Cookbook

Apache httpd v2.4: Reverse Proxy. (The Hidden Gem) Jim Jagielski

Apache 2.2 and mod_proxy_balancer

What's new in httpd 2.2?

Painless Web Proxying with Apache mod_proxy

1. Introduction 2. Getting Started 3. Scenario 1 - Non-Replicated Cluster 4. Scenario 2 - Replicated Cluster 5. Conclusion

High Availability Low Dollar Load Balancing

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

Setting Up B2B Data Exchange for High Availability in an Active/Active Configuration

EQUELLA. Clustering Configuration Guide. Version 6.2

By PANKAJ SHARMA. Concepts of Server Load Balancing

Apache Performance Tuning

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

Technical specification

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

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

Intro to Load-Balancing Tomcat with httpd and mod_jk

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

EQUELLA. Clustering Configuration Guide. Version 6.0

Content. Global Delivery Network: Folders

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

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

Cookbook Secure Failover for Tomcat Application Server Use Apache, mod_proxy, mod_security, mod_ssl to offer secure application delivery

Release Notes Date: September 2013

Apache Tomcat & Reverse Proxies

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

Availability Digest. Redundant Load Balancing for High Availability July 2013

ID205 IBM Lotus inotes High Availability Customer Case Study and Successful Web Deployment Best Practices

Oracle Collaboration Suite

Load Balancing for Microsoft Office Communication Server 2007 Release 2

Microsoft Lync Server Overview

Web Application Hosting Cloud Architecture

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

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

Brocade Virtual Traffic Manager and Microsoft Skype for Business 2015 Deployment Guide

What s new in Apache HTTP Server 2.2. Jim Jagielski jim@jagunet.com

Apache Tomcat. Tomcat Clustering: Part 2 Load balancing. Mark Thomas, 15 April Pivotal Software, Inc. All rights reserved.

APV9650. Application Delivery Controller

How to Make the Client IP Address Available to the Back-end Server

IERG 4080 Building Scalable Internet-based Services

An Esri White Paper January 2010 Performance and Throughput Tips for ArcGIS Server Cached Map Services and the Apache HTTP Server

Networking and High Availability

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

Configuring Load Balancing

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

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

Networking and High Availability

Outline VLAN. Inter-VLAN communication. Layer-3 Switches. Spanning Tree Protocol Recap

Brocade Virtual Traffic Manager and Oracle WebLogic Applications Deployment Guide

N Things You Didn t Know You Could Do With Apache

DPtech ADX Application Delivery Platform Series

ENQUIRY NO.NIE/PS/ DATE: 02/09/2014

White Paper DEPLOYING WDK APPLICATIONS ON WEBLOGIC AND APACHE WEBSERVER CLUSTER CONFIGURED FOR HIGH AVAILABILITY AND LOAD BALANCE

Routing Security Server failure detection and recovery Protocol support Redundancy

Cisco Application Networking for IBM WebSphere

APV x600 Series. Application Delivery Controller APV1600, APV2600, APV4600, APV5600, APV6600, APV8600, APV9600

Nick McClure University of Kentucky

CLUSTERING CAS for High Availability. Eric Pierce, University of South Florida

Data Sheet. VLD 500 A Series Viaedge Load Director. VLD 500 A Series: VIAEDGE Load Director

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

The Application Delivery Controller Understanding Next-Generation Load Balancing Appliances

Implementing Microsoft Office Communications Server 2007 With Coyote Point Systems Equalizer Load Balancing

Load-Balancing Introduction (with examples...)

20 Things You Didn t Know You Could Do With Apache (aka httpd power tools) Rich Bowen rbowen@apache.org ApacheCon US 2006

Rails Application Deployment. July Philly on Rails

Load Balancing Barracuda Web Filter. Deployment Guide

INTRODUCTION AND TERMINOLOGY

Load Balancing Web Proxies Load Balancing Web Filters Load Balancing Web Gateways. Deployment Guide

Oracle9i Application Server: Options for Running Active Server Pages. An Oracle White Paper July 2001

Brocade Virtual Traffic Manager and Microsoft SharePoint 2010 Deployment Guide

Cisco Application Networking for BEA WebLogic

Brocade Virtual Traffic Manager and Microsoft IIS Deployment Guide

How-to-Guide: Reverse Proxy and Load Balancing for SAP Mobile Platform 3.X

LOAD BALANCING IN WEB SERVER

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

WebGUI Load Balancing

Flexible Routing and Load Control on Back-End Servers. Controlling the Request Load and Quality of Service

Configuring Nex-Gen Web Load Balancer

AA enabling a closed source legacy application

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

Brocade Virtual Traffic Manager and Oracle Application Server 10G Deployment Guide

Load Balancing using Pramati Web Load Balancer

Brocade Virtual Traffic Manager and Magento Deployment Guide

Implementation of Web Application Firewall

Cisco PIX vs. Checkpoint Firewall

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

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

Content Transformation with Apache

Load Balancing McAfee Web Gateway. Deployment Guide

Coyote Point Systems White Paper

Web Application Firewalls: When Are They Useful? OWASP AppSec Europe May The OWASP Foundation

Smoothwall Web Filter Deployment Guide

VERITAS Cluster Server Traffic Director Option. Product Overview

Application Delivery Controller (ADC) Implementation Load Balancing Microsoft SharePoint Servers Solution Guide

CHAPTER 3 PROBLEM STATEMENT AND RESEARCH METHODOLOGY

FortiBalancer: Global Server Load Balancing WHITE PAPER

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

Transcription:

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

About Me Working internationally as IT Consultant Areas: Administration & Operations Working on and with Open Source Apache Software Foundation Other projects (Ruby, Zenoss,...) Living in South Germany

Content Basics Strategies Examples Questions

Basics

Why Load-Balancing? Optimizing Resource Utilization Maximizing Quality of Service Increasing Reliability & Availability Improving Security Lowering Administration Risks

Approaches DNS-Based Load-Balancing Round Robin Geographical Scheduling Layer 4 Load-Balancing Layer 7 Load-Balancing Hardware-/Software-Based Load-Balancers

DNS-Based Balancing Clients resolve FQDN Response with several IPs or choosen randomly or e.g. according to proximity

Layer 4 Balancing Transport Layer Deals with TCP connections Routes pure packets NAT with port and transaction awareness

Layer 7 Balancing Application Layer Deals with HTTP requests Forwards whole requests Gateway / Reverse Proxy

Layer 4-7 Balancing Combination: routing packets but aware of HTTP content Load-Balancer acts as a multilayer switch Basic schema always the same

Hardware-Based LBs Mostly real routers/switches with ML capabilites Pros Very fast Cons Expensive Proprietary Examples: Cisco LoadDirector, F5 Big/ip, Barracuda

Software-Based LBs Software-based appliances or just packages Pros Cheaper and also available as Open Source Simpler to configure and often more flexible Cons Not as fast as hardware based solutions Examples: Pen, Pound, Squid, Linux VS, Zeus ZXTM

Balancer Features 1 TCP Offloading TCP Buffering HTTP Caching SSL Offloading & Acceleration HTTP Compression Client Authentication Attack Protection & Firewalling

Balancer Features 2 Content-Aware Load-Balancing Request Rate Shaping Bandwidth Shaping Traffic Valuation & Prioritization Programmatic Traffic Manipulation

Balancing Algorithms Random Choice Round Robin Weighted Round Robin Request counting algorithm Weighted traffic counting algorithm Based on other factors (load, response time,...)

Strategies

Gateway Reverse Proxy - the frontend: Apache HTTPD with mod_proxy and mod_proxy_balancer as well as one of: mod_proxy_http mod_proxy_ajp

Application Servers A pool of servers - the backend: Apache HTTP with PHP, Perl,... Apache Tomcat, JBoss, Glassfish,... Zope, CherryPy, Mongrel, WebRick...

Focus: Scalability A single load-balancer in front of a pool of application servers

Persistence Session Stickiness A problem when not able to use a shared data store for the application (e.g. when using multiple physical locations where replication becomes problematic) Alternative: using cookies as data store

Focus: Resilience Two or more load-balancers in front of a pool of application servers

Failover Active/Active Both load-balancers are actively serving requests Active/Passive Only one load-balancer is actively serving requests, the other one takes over in case of failure There needs to be a way to detect failures

Focus: Globalization Several groups of load-balancers in more than one physical location

Location Selection DNS-Based Round Robin Based on geographical proximity Based on utilization of location FQDN-Based (e.g. wwwn.example.com)

Examples

HTTPD as Gateway Required Modules: mod_proxy mod_proxy_balancer mod_proxy_http / mod_proxy_ajp mod_proxy_ftp

HTTP Backends Requires extension module: mod_proxy_http Usage: BalancerMember http://1.1.1.1:8080...

AJP Backends Requires extension module: mod_proxy_ajp Usage: BalancerMember ajp://1.1.1.1: 8009...

Basic Configuration <VirtualHost *:80> ServerName www.example.com... ProxyRequests Off ProxyVia Off ProxyErrorOverride On ProxyPreserveHost On ProxyTimeout 30 ProxyPass / balancer://app_farm lbmethod=byrequests maxattempts=3 \ nofailover=off stickysession=sid <Proxy balancer://app_farm> BalancerMember http://1.1.1.1:8080 smax=15 max=50 lbfactor=2 BalancerMember http://1.1.1.2:8080 smax=15 max=50 lbfactor=2 BalancerMember http://1.1.1.3:8080 smax=10 max=25 lbfactor=1 </Proxy> </VirtualHost>

Connection Pooling min Minimum number of connections that will always be open to the backend server max Hard Maximum number of connections that will be allowed to the backend server smax & ttl Soft Maximum number of connections that will be created on demand, TTL for connect s above smax

Parameters 1 lbmethod The load-balancing scheduler method to use, e.g. weighted request counting weighted traffic counting lbset Assigns a specific cluster set to members

Parameters 2 loadfactor Defines the normalized weighted load applied to this balancer member, e.g. loadfactor=1 loadfactor=2 <- twice as much req s / IO status Defines the initial state of this member

Hot-Standby <VirtualHost *:80> ServerName www.example.com... ProxyPass / balancer://app_farm lbmethod=byrequests maxattempts=3 \ nofailover=off stickysession=sid <Proxy balancer://app_farm> BalancerMember http://1.1.1.1:8080... BalancerMember http://1.1.1.2:8080... BalancerMember http://1.1.1.3:8080... status=+h </Proxy> </VirtualHost>

Sticky Sessions Supported by stickysession flag: stickysession=phpsessid stickysession=jsessionid jsessionid

Environment Variables Generated by mod_proxy X-Forwarded-For X-Forwarded-Host X-Forwarded-Server Influence mod_proxy SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1

ProxyPassReverse ProxyPass / balancer://app_farm... ProxyPassReverse / http://1.1.1.1:8080/ ProxyPassReverse / http://1.1.1.2:8080/ <Proxy balancer://app_farm> BalancerMember http://1.1.1.1:8080... BalancerMember http://1.1.1.2:8080... </Proxy>

URL Rewriting ProxyPass ~ ^/+(.*)$ balancer://app_farm/$1... [or] ProxyPassMatch ^/+(.*)$ balancer://app_farm/$1... [or] RewriteEngine On RewriteCond %{REQUEST_URI} ^/.balancer RewriteRule ^(.*)$ - [L] RewriteRule ^/+(.*)$ balancer://app_farm/$1 [P,L] ProxySet balancer://app_farm lbmethod=bytraffic

Using Headers <VirtualHost *:443> ServerName www.example.com... RequestHeader set Front-End-Https "On"... ProxyPass / balancer://app_farm lbmethod=byrequests maxattempts=3 \ nofailover=off stickysession=sid <Proxy balancer://app_farm> BalancerMember http://1.1.1.1:8080 smax=15 max=50 lbfactor=2... </Proxy> </VirtualHost>

Filtering Content mod_mime, e.g. AddOutputFilter INCLUDES.shtml mod_filter mod_proxy_html

Using Compression We can use mod_deflate as usually: AddOutputFilterByType DEFLATE text/html

Offloading SSL Simply configure SSL on the frontend server as you would do without a balancer

Caching <VirtualHost *:80> ServerName www.example.com... CacheEnable mem / CacheEnable disk / CacheDefaultExpire 1800 CacheMaxExpire 3600... ProxyPass / balancer://app_farm lbmethod=byrequests maxattempts=3 \ nofailover=off stickysession=sid <Proxy balancer://app_farm> BalancerMember http://1.1.1.1:8080 smax=15 max=50 lbfactor=2... </Proxy> </VirtualHost>

Failover Automatically done if a member is in-error the next one is tried Can be switched off if backend servers do not support session replication

Balancer Management Requires mod_status Allows for real-time monitoring Allows for dynamic updates of parameters of balancer members enable/disable balancer members specify balance factors, methods, sets

Screenshot

Example Configuration <Location /.balancer> SetHandler balancer-manager AuthType Digest AuthName "Balancer Manager" AuthDigestDomain /.balancer AuthDigestProvider file AuthUserFile /www/etc/httpd/balancer.passwd Require user operations </Location>... ProxyPass /.balancer! ProxyPass / balancer://app_farm...

Questions?