Apache Performance Tuning



Similar documents
Apache Performance Tuning Part Two: Scaling Out

By PANKAJ SHARMA. Concepts of Server Load Balancing

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

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

Infor Web UI High Availability Deployment

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

Intro to Load-Balancing Tomcat with httpd and mod_jk

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

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

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

STREAMEZZO RICH MEDIA SERVER

mod_cluster A new httpd-based load balancer Brian Stansberry JBoss, a division of Red Hat

SpagoBI Tomcat Clustering Using mod_jk and httpd on Centos - In-Memory Session Replication.

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

Apache Tomcat Clustering

Installing Rails 2.3 Under Windows XP and Apache 2.2

Painless Web Proxying with Apache mod_proxy

Apache and Tomcat Clustering Configuration Table of Contents

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

EQUELLA. Clustering Configuration Guide. Version 6.0

How to setup HTTP & HTTPS Load balancer for Mediator

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

EQUELLA. Clustering Configuration Guide. Version 6.2

xcp Application Deployment On Tomcat Cluster

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

The mod_proxy Cookbook

.NET UI Load Balancing & Clustering

Spectrum Technology Platform Version Tutorial: Load Balancing Spectrum Spatial Services. Contents:

What's new in httpd 2.2?

PROXY SETUP WITH IIS USING URL REWRITE, APPLICATION REQUEST ROUTING AND WEB FARM FRAMEWORK OR APACHE HTTP SERVER FOR EMC DOCUMENTUM EROOM

Rails Application Deployment. July Philly on Rails

Scaling Progress OpenEdge Appservers. Syed Irfan Pasha Principal QA Engineer Progress Software

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

Administering mod_jk. To Enable mod_jk

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

1. Configuring Apache2 Load Balancer with failover mechanism

How To Run A Web Farm On Linux (Ahem) On A Single Computer (For Free) On Your Computer (With A Freebie) On An Ipv4 (For Cheap) Or Ipv2 (For A Free) (For

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

Availability Digest. Redundant Load Balancing for High Availability July 2013

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

Apache Tomcat & Reverse Proxies

Addressing Application Layer Attacks with Mod Security

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

Copyright

Configuring Remote HANA System Connection for SAP Cloud for Analytics via Apache HTTP Server as Reverse Proxy

Amazon EC 2 Cloud Deployment Guide

Technical specification

JBoss Seam Performance and Scalability on Dell PowerEdge 1855 Blade Servers

.NET UI Load Balancing & Failover

IERG 4080 Building Scalable Internet-based 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

JBS-102: Jboss Application Server Administration. Course Length: 4 days

Apache 2.2 and mod_proxy_balancer

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

Release Notes Date: September 2013

Configuring multiple Tomcat instances with a single Apache Load Balancer

Load Balancing Web Applications

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

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

Federated Access to an HTTP Web Service Using Apache (WSTIERIA Project Technical Note 1)

LARGE SCALE INTERNET SERVICES

HTG XROADS NETWORKS. Network Appliance How To Guide: DNS Delegation. How To Guide

JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide

Tushar Joshi Turtle Networks Ltd

High Availability Low Dollar Load Balancing

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

Configuring IIS 6 to Load Balance a JBoss 4.2 Adobe LiveCycle Enterprise Suite 2 (ES2) Cluster

HP ALM. Software Version: External Authentication Configuration Guide

Veriton. Getting the Best out of Hardware Load Balancers in an Oracle Environment. What is a Load Balancer? Agenda. What s out there?

Trademarks: Yellowfin and the Yellowfin Logo are registered trademarks of Yellowfin International.

Example Apache Server Installation for Centricity Electronic Medical Record browser & mobile access

Tomcat and MySQL, a basic high available load balanced system

Technical White Paper - JBoss Security

2013 IBM SINGLE SIGN-ON WITH CA SITEMINDER FOR SAMPLE WEB APPLICATION

CentraSite SSO with Trusted Reverse Proxy

Apache web server magic on IBM i. Alan Seiden Consulting alanseiden.com

Agenda. Tomcat Versions Troubleshooting management Tomcat Connectors HTTP Protocal and Performance Log Tuning JVM Tuning Load balancing Tomcat

CS312 Solutions #6. March 13, 2015

Scalable Internet Architectures

Domain Name Servers. Domain Types WWW host names. Internet Names. COMP476 Networked Computer Systems. Domain Name Servers

Amazon Elastic Beanstalk

Siemens PLM Connection. Mark Ludwig

Open-Xchange Server High availability Daniel Halbe, Holger Achtziger

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

Mastering Tomcat Development

Install & Configure Apache with PHP, JSP and MySQL on Windows XP Pro

mod_cluster Documentation

Implementation of Web Application Firewall

FILECLOUD HIGH AVAILABILITY

Scalable Linux Clusters with LVS

Robert Honeyman Honeyman IT Consulting.

LinkProof DNS Quick Start Guide

How to Scale out SharePoint Server 2007 from a single server farm to a 3 server farm with Microsoft Network Load Balancing on the Web servers.

XCP APP FAILOVER CONFIGURATION FOR WEBLOGIC CLUSTER AND APACHE WEBSERVER

INTRODUCTION AND TERMINOLOGY

Installing Apache as an HTTP Proxy to the local port of the Secure Agent s Process Server

- Domain Name System -

Setting up an Apache Server in Conjunction with the SAP Sybase OData Server

Configuring Apache HTTP Server With Pramati

Transcription:

Apache Performance Tuning Part 2: Scaling Out Sander Temme <sander@temme.net>

Agenda Introduction Redundancy in Hardware Building Out: Separate Tiers Building Out: Load Balancing Caching Content Conclusion

Introduction Why do This? Scalability (Oh my gosh, I m so popular!) Reliability (We need five nines!) Why NOT do This? It costs money

Redundancy in Hardware Moving Parts Break Hard Disks Power Supplies Hard Disks Fans Hard Disks Buy High Quality Disks Refurbished, OEM, Brand Name Which has longer warranty? Which is more reliable?

Server Configuration Mirror those Disks Install the RAID utility Have it warn you RAID is no good if you don t learn of failures! Redundant Power Supplies On different circuits

Scaling Vertically

Scaling Vertically Move Services to Other Hosts Pros: Less resource contention Specialized hardware Scale out tiers individually Cons: Development/Deployment harder More hosts to manage

Scaling Horizontally

Scaling Horizontally Multiple servers per tier All receive requests All serve same content Some arbitration scheme

Load Balancing Schemes DNS Tricks Peer Server Pools Network Load Balancing (Win2k3) Wackamole Load Balancing Appliance Box from F5, Juniper, Cisco, Foundry, Linux Virtual Server

DNS Round-Robin Easy! Multiple A Records in DNS Zone File Not Smart: DNS Lookups are cached Load on Server Server Outage

Example Zone File scalingout.org. 86400 2006051401 86400 7200 8640000 86400 ) scalingout.org. gw bagheera IN SOA ns.scalingout.org. sctemme.scalingout.org. ( ; Serial ; refresh (1 day) ; retry (2 hours) ; expire (10 days) ; minimum (1 day) IN NS bagheera.scalingout.org. IN IN A A 10.11.0.1 10.11.0.2 mail ns IN IN CNAME CNAME bagheera bagheera www IN IN IN A A A 10.11.0.113 10.11.0.114 10.11.0.115 ;...

Peer-based: NLB Windows 2000 Server Enterprise Ed., Windows Server 2003 Up to 32 hosts in cluster All hosts assume cluster IP, MAC NLB makes LB decision Only one host gets to answer TCP handshake Should be application independent

Peer-based: Wackamole High Availability Solution When Host Fails Other hosts take over its IP addresses Distribute IP addresses among cluster Every IP address reliably available No Load Balancing! Use with RR DNS (or something) http://www.backhand.org/wackamole/

Load Balancing Device Client Internet

Load Balancing One Load Balancer Many Web Servers Choice of Balancing Schemes Round-robin, Least Used, Reliability Heartbeats, unavailable servers don t receive requests Feature War

Linux Virtual Server Free, Open Source, etc. IP Virtual Server module in kernel Lots of auxiliary modules Like a box of Legos May come with Your Distribution Do It Yourself http://www.linuxvirtualserver.org/

Example: mod_proxy_balancer New in Apache HTTP Server 2.2 Part of mod_proxy Two Load Balancing Methods By number of requests By number of bytes Detects failed backends

Apache Configuration Listen 80 LogLevel debug TransferLog logs/access_log LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so ProxyPass / balancer://mycluster/ ProxyPassReverse / http://1.2.3.4:80 ProxyPassReverse / http://1.2.3.5:80 <Proxy balancer://mycluster> BalancerMember http://1.2.3.4:80 BalancerMember http://1.2.3.5:80 </Proxy>

Example: Tomcat, mod_jk Apache + mod_jk Multiple Tomcat servers Balancer Worker

Apache Configuration LoadModule jk_module /Volumes/Files/asf/httpd-r415210w/modules/mod_jk.so JKMount /servlets-examples/* loadbalancer JKMount /*.jsp loadbalancer JkMount /jkmanager/* jkstatus JKLogFile logs/jk_log JKLogLevel debug JKWorkerProperty worker.list=loadbalancer,jkstatus JKWorkerProperty worker.tc1.port=15109 JKWorkerProperty worker.tc1.host=localhost JKWorkerProperty worker.tc1.type=ajp13 JKWorkerProperty worker.tc1.lbfactor=1 JKWorkerProperty worker.tc2.port=15209 JKWorkerProperty worker.tc2.host=localhost JKWorkerProperty worker.tc2.type=ajp13 JKWorkerProperty worker.tc2.lbfactor=1 JKWorkerProperty worker.tc3.port=15309 JKWorkerProperty worker.tc3.host=localhost JKWorkerProperty worker.tc3.type=ajp13 JKWorkerProperty worker.tc3.lbfactor=1 JKWorkerProperty worker.loadbalancer.type=lb JKWorkerProperty worker.loadbalancer.balance_workers=tc1, tc2, tc3 JKWorkerProperty worker.jkstatus.type=status

Tomcat Configuration Put same content on all Tomcats Edit conf/server.xml: <Engine name="catalina" defaulthost="localhost" jvmroute="tc1"> jvmroute must match jk worker name!

Problem: Session State HTTP is Stateless Apps use Sessions Cookies URL Encoding Session created on single server Broken by Load Balancing PHP: sessions stored on disk

Solutions: Session State Sticky routing on Load Balancer Store State in DB Put benign State in Cookie But don t trust the client too much Replicate Sessions on Back-end

Tomcat Session Replication Share HttpSession objects across instances One instance dies, session lives on Apache will route requests to other instance Uses IP Multicast

Session Replication Config Uncomment <Cluster> element in server.xml Put empty <distributable /> element in <web-app> element in web.xml

Caching Content Dynamic Content is Expensive Static Content Relatively Cheap Several Approaches: Dynamic caching Pre-rendering popular pages (index.rss ) 27

mod_cache Configuration <IfModule mod_cache.c> <IfModule mod_disk_cache.c> CacheRoot /raid1/cacheroot CacheEnable disk / # A page modified 100 min. ago will expire in 10 min. CacheLastModifiedFactor.1 # Always check again after 6 hours CacheMaxExpire 21600 </IfModule> </IfModule> 28

Make Popular Pages Static RSS Feeds Popular catalog queries (Check your access log) 29

Static Page Substitution <Directory "/home/sctemme/inst/blog/httpd/htdocs"> Options +Indexes Order allow,deny Allow from all RewriteEngine on RewriteCond %{REQUEST_FILENAME}!-f RewriteCond %{REQUEST_FILENAME}!-d RewriteRule ^(.*)$ /cgi-bin/blosxom.cgi/$1 [L,QSA] </Directory> 30

Tuning the Database Tier Not my area (sorry) Give Money to Oracle Consultants (or MySQL) (or ) Tip: Separate Read and Write Operations Replicate from Write db to Read db Read db data slightly stale Does it matter?

Putting it All Together Read-only Internet Client Write-only

Monitoring the Farm Monitor for outages More boxes, more failure HA can mask failures Monitor for performance Utilization Trends

Monitoring Solutions Nagios Check services, hosts for outage Highly configurable, extendable Worth your time investment Ganglia Monitor for performance See Brad Nicholes s session

Monitoring Caveats Takes Time, Effort Highly flexible products You can t fix it If you don t know it s broken You can t tune it If you don t know the bottlenecks

Conference Roadmap Monitoring 2.0 - Zenoss, the next level of IT management (Training) Apache Performance Tuning Part 1: Scaling Up Load-balancing with Apache HTTPD 2.2 and later Scaling the download infrastructure with your success Break My Site

Current Version http://people.apache.org/~sctemme/apconeu2008/

Thank You