Web Load Balancing on a Budget



Similar documents
ALOHA LOAD BALANCER MANAGING SSL ON THE BACKEND & FRONTEND

HAProxy. Ryan O'Hara Principal Software Engineer, Red Hat September 17, HAProxy

High Availability Cluster Solutions for Ubuntu14.04 on Power

Configuring HAproxy as a SwiftStack Load Balancer

HaProxy możliwości i zastosowania. Marek Oszczapiński m.oszczapiński@polskapresse.pl

What s Your HTTPS Grade? A Case Study of HTTPS/SSL at Mid Michigan Community College. Brandon bkish@midmich.edu

Exchange 2013 deployment guide

Copyright Exceliance

ALOHA Load-Balancer. Microsoft Exchange 2010 deployment guide. Document version: v1.4. ALOHA version concerned: v4.2 and above

CS312 Solutions #6. March 13, 2015

HAProxy. Free, Fast High Availability and Load Balancing. Adam Thornton 10 September 2014

Load balancing MySQL with HaProxy. Peter Boros Percona 4/23/13 Santa Clara, CA

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

vrealize Operations Manager Load Balancing

Pexip Infinity Reverse Proxy Deployment Guide

Snapt Balancer Manual

FILECLOUD HIGH AVAILABILITY

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

Native SSL support was implemented in HAProxy 1.5.x, which was released as a stable version in June 2014.

EMC VIPR SRM 3.7: GUIDELINES FOR CONFIGURING MULTIPLE FRONTEND SERVERS

Application Note. Active Directory Federation Services deployment guide

ATS Test Documentation

FortiOS Handbook Load Balancing for FortiOS 5.0

Load Balancing VMware Horizon View. Deployment Guide

Migrating the SSL Offloading Configuration of the Alteon Application Switch 2424-SSL to AlteonOS version

FortiOS Handbook - Load Balancing VERSION 5.2.2

Load Balancing VMware Horizon View. Deployment Guide

ExamPDF. Higher Quality,Better service!

Load Balancing. FortiOS Handbook v3 for FortiOS 4.0 MR3

TESTING & INTEGRATION GROUP SOLUTION GUIDE

Load Balancing Oracle Application Server (Oracle HTTP Server) Quick Reference Guide

Deployment Guide AX Series with Active Directory Federation Services 2.0 and Office 365

Load Balancing Microsoft Sharepoint 2010 Load Balancing Microsoft Sharepoint Deployment Guide

Load Balancing MODX. Garry Nutting, Senior Developer at MODX, LLC

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

Web Authentication Proxy on a Wireless LAN Controller Configuration Example

Firewall Load Balancing

Configuring Nex-Gen Web Load Balancer

Penetration Testing LAB Setup Guide

ALOHA Load-Balancer. API objects. Document version: v2.0. API version concerned: v2.0. Aloha version concerned: Last update date: 24 th November, 2011

Prerequisites. Creating Profiles

Application Note. Lync 2010 deployment guide. Document version: v1.2 Last update: 12th December 2013 Lync server: 2010 ALOHA version: 5.

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

Server Iron Hands-on Training

Configuring SSL Termination

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

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

Thunder Series for SAP Customer Relationship Management (CRM)

Deployment Guide Microsoft IIS 7.0

Relayd: a load-balancer for OpenBSD

Pertino HA Cluster Deployment: Enabling a Multi- Tier Web Application Using Amazon EC2 and Google CE. A Pertino Deployment Guide

DEPLOYMENT GUIDE CONFIGURING THE BIG-IP LTM SYSTEM WITH FIREPASS CONTROLLERS FOR LOAD BALANCING AND SSL OFFLOAD

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

Introducing the Microsoft IIS deployment guide

Availability Digest. Redundant Load Balancing for High Availability July 2013

Deploying SAP NetWeaver Infrastructure with Foundry Networks ServerIron Deployment Guide

IOS Server Load Balancing

HAProxy 1.5 and beyond

Load Balancing Trend Micro InterScan Web Gateway

Load Balancing Microsoft Terminal Services. Deployment Guide

ClusterLoad ESX Virtual Appliance quick start guide v6.3

Load Balancing RSA Authentication Manager. Deployment Guide

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

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

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

Load Balancing Barracuda Web Filter. Deployment Guide

Load Balancing Bloxx Web Filter. Deployment Guide

Advanced SLB High Availability and Stateless SLB

Smoothwall Web Filter Deployment Guide

Deploying the BIG-IP System with Oracle E-Business Suite 11i

IOS Server Load Balancing

IxLoad - Layer 4-7 Performance Testing of Content Aware Devices and Networks

TFE listener architecture. Matt Klein, Staff Software Engineer Twitter Front End

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

Deployment Guide Oracle Siebel CRM

Running Nginx as Reverse Proxy server

Deployment Guide May-2015 rev. a. APV Oracle PeopleSoft Enterprise 9 Deployment Guide

Deployment Guide AX Series with Citrix XenApp 6.5

Owner of the content within this article is Written by Marc Grote

Microsoft Lync Server Overview

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

Deploying F5 with Microsoft Active Directory Federation Services

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

AX Series with Microsoft Exchange Server 2010

ZVA64EE PERFORMANCE BENCHMARK SOFINTEL IT ENGINEERING, S.L.

Load Balancing Clearswift Secure Web Gateway

Security Protocols HTTPS/ DNSSEC TLS. Internet (IPSEC) Network (802.1x) Application (HTTP,DNS) Transport (TCP/UDP) Transport (TCP/UDP) Internet (IP)

Managing Virtual Servers

Load Balancing Sophos Web Gateway. Deployment Guide

Load Balancing McAfee Web Gateway. Deployment Guide

Monitoring Traffic manager

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

PCI Compliance Considerations

Nginx 1 Web Server Implementation

Appliance Quick Start Guide. v7.6

Print Audit Facilities Manager Technical Overview

Thunder Series for SAP BusinessObjects (BOE)

AX Series with Microsoft Exchange Server 2010

Load Balancing Microsoft Exchange Deployment Guide

Transcription:

Web Load Balancing on a Budget

Pain Hosting 60+ websites Single web server Redundant subsystems (disk, power) SPOF Inconvenient maintenance windows Clients MY TEAM!

Scope Simple. Availability. Minimize/mitigate downtime Outages Planned maintenance Session state persistence (for failed web backends) was not required

Stack Vmware ESXi (all hosts) CentOS (load balancers) Nginx (SSL termination) Haproxy (web load balancing) Keepalived (VRRP) Windows Server 2008 (IIS)

Design

1 # Let us bind to addresses and ports that may not be real (nginx and haproxy need this) 2 net.ipv4.ip_nonlocal_bind = 1 3 4 # Reuse sockets that are in a TIME_WAIT state so we don t exhaust resources 5 net.ipv4.tcp_tw_reuse = 1 6 7 # Give us a larger useable port range (default: 32768 61000) 8 net.ipv4.ip_local_port_range = 1024 65535 9 10 # Close TCP FIN connections faster to help lower resources used by the network stack 11 net.ipv4.tcp_fin_timeout = 30 12 13 # Increase the number of slots that iptables has for tracking connections 14 net.ipv4.netfilter.ip_conntrack_max = 131072 15 16 # Decrease the time that iptables waits to close sockets in TIME_WAIT (def: 120) 17 net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 30

1 http { 2 server_tokens off; # make the hackers work for it 3 4 server_name_in_redirect off; # use requested Host header 5 6 proxy_read_timeout 1500; # 25 min; required for long-running reports 7 8 upstream www.example.com { 9 server 192.168.1.2:80; 10 } 11 12 server { 13 listen 192.168.1.2:443; 14 access_log /var/log/nginx/access.log; 15 ssl on; # go! 16 ssl_certificate /usr/local/ssl/wildcard.example.com.cert; 17 ssl_certificate_key /usr/local/ssl/wildcard.example.com.key; 18 ssl_prefer_server_ciphers on; # prefer SSLv3 and TLSv1 ciphers 19 ssl_ciphers HIGH:+MEDIUM:!ADH:!MD5; # use 128-bit and higher ciphers; exclude ADH, MD5 20 ssl_protocols TLSv1 SSLv3; # guarantee only TLSv1 and SSLv3 protocols 21 22 location / { # match all HTTP requests 23 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 24 proxy_set_header securecookie YES; 25 proxy_pass http://www.example.com; 26 } 27 } 28 29 }

1 global 2 maxconn 32500 3 nbproc 1 4 5 defaults 6 log global # log all proxy instances 7 option httplog # verbose HTTP logging 8 mode http # layer 7 proxy 9 10 retries 2 11 timeout connect 2s # 2 retries x 2s timeout = 4s until haproxy looks for new backend 12 option redispatch # redispatch requests originally sent to downed backend servers 13 14 timeout client 5s 15 timeout server 1500s # 25 minutes, for long-running reports (matches nginx config) 16 17 balance roundrobin # also leastconn 18 19 option forwardfor # X-Forward-For header 20 option httpclose # force HTTP connections closed so all connections are logged 21 22 listen statswww 192.168.1.1:8080 23 stats enable # enable the haproxy stats page (uri-stem = /haproxy?stats) 24 stats auth god:sex 25 stats refresh 120s 26 27 listen www.example.com 28 bind 192.168.1.2:80 29 acl acl_port_80 dst_port eq 80 30 acl acl_secure hdr(securecookie) YES 31 acl acl_sourcelocal src 192.168.1.2 32 acl acl_excludecss url_dir -i CSS 33 redirect location https://www.example.com/sslredirect.asp code 301 if acl_port_80!acl_secure! acl_sourcelocal!acl_excludecss 34 cookie SERVERID insert indirect nocache 35 server www1 192.168.1.3 cookie www1 weight 1 check inter 1s fall 3 rise 2 35 server www2 192.168.1.4 cookie www2 weight 1 check inter 1s fall 3 rise 2 35 server www3 192.168.1.5 cookie www3 weight 1 check inter 1s fall 3 rise 2 38 option httpchk GET /ping.htm HTTP/1.1\r\nHost:www.example.com # health check 39 capture request header X-Forwarded-For len 15

1 global_defs { 2 lvs_id lb1 3 } 4 5 vrrp_sync_group virtualgroup1 { 6 group { 7 virtualinstance1 8 } 9 } 10 11 vrrp_instance virtualinstance1 { 12 interface eth0 13 advert_int 1 # advertise interval in seconds 14 state MASTER # either MASTER or BACKUP 15 virtual_router_id 1 # MUST be between 1 and 255 16 priority 101 # 101 on MASTER, 100 on BACKUP 17 authentication { 18 auth_type AH 19 auth_pass "sexdrugsandrockandroll" 20 } 21 virtual_ipaddress { # only 20 IPs per block, blah 22 192.168.1.1/24 brd 192.168.1.255 dev eth0 23 192.168.1.2/24 brd 192.168.1.255 dev eth0 24 192.168.1.3/24 brd 192.168.1.255 dev eth0 25 192.168.1.4/24 brd 192.168.1.255 dev eth0 26... 27 192.168.1.19/24 brd 192.168.1.255 dev eth0 28 } 29 }

Pitfalls

VMware and TSO When jumbo frames go bad HTTP 500 errors Web servers offline for 20-30 minutes Disable TSO http://www.ryanfrantz.com/2011/02/03/tcp-segmentation-offload/

What s Happening? No visibility into performance Request volume (nginx/haproxy/iis) Seasonality Health (beyond up/down) keepalived

HTTP Traffic: One Load Balancer

HTTP Traffic: Two Load Balancers

HTTP Traffic: One Week

TCP Connections

TCP Connections: + TIME_WAIT

Thank You for Attending LOPSA-East 13 Please fill out the Trainer Evaluation http://lopsa-east.org/2013/training-survey Rate LOPSA-East 13 http://www.lopsa-east.org/2013/rate-lopsaeast-13

@Ryan_Frantz rfrantz@etsy.com github.com/ryanfrantz www.ryanfrantz.com