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



Similar documents
Tomcat Tuning. Mark Thomas April 2009

Apache Tomcat Tuning for Production

Apache and Tomcat Clustering Configuration Table of Contents

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

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

Apache Tomcat & Reverse Proxies

Oracle Corporation Proprietary and Confidential

JBoss Seam Performance and Scalability on Dell PowerEdge 1855 Blade Servers

MID-TIER DEPLOYMENT KB

Intro to Load-Balancing Tomcat with httpd and mod_jk

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

Oracle WebLogic Server 11g Administration

NetIQ Access Manager 4.1

Java Performance Tuning

Apache Jakarta Tomcat

Tuning Your GlassFish Performance Tips. Deep Singh Enterprise Java Performance Team Sun Microsystems, Inc.

Advanced Liferay Architecture: Clustering and High Availability

High-Availability. Configurations for Liferay Portal. James Min. Senior Consultant / Sales Engineer, Liferay, Inc.

PeopleSoft Online Performance Guidelines

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

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

Painless Web Proxying with Apache mod_proxy

WEBLOGIC ADMINISTRATION

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

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

Configuring Nex-Gen Web Load Balancer

How To Configure Apa Web Server For High Performance

[TFS 4.1 ADVANCED GUIDE]

Oracle Weblogic. Setup, Configuration, Tuning, and Considerations. Presented by: Michael Hogan Sr. Technical Consultant at Enkitec

Course Description. Course Audience. Course Outline. Course Page - Page 1 of 5

What's new in httpd 2.2?

How to Integrate IIS with JBoss / Tomcat Under Windows XP and Linux

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

MagDiSoft Web Solutions Office No. 102, Bramha Majestic, NIBM Road Kondhwa, Pune Tel: /

Cognos8 Deployment Best Practices for Performance/Scalability. Barnaby Cole Practice Lead, Technical Services

WebSphere Architect (Performance and Monitoring) 2011 IBM Corporation

IUCLID 5 Guidance and Support

Resource Utilization of Middleware Components in Embedded Systems

WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE

Garbage Collection in the Java HotSpot Virtual Machine

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

Configuring Load Balancing

Project #2. CSE 123b Communications Software. HTTP Messages. HTTP Basics. HTTP Request. HTTP Request. Spring Four parts

EWeb: Highly Scalable Client Transparent Fault Tolerant System for Cloud based Web Applications

No.1 IT Online training institute from Hyderabad URL: sriramtechnologies.com

MEASURING WORKLOAD PERFORMANCE IS THE INFRASTRUCTURE A PROBLEM?

Introduction to Spark and Garbage Collection

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

Filr 2.0 Administration Guide. April 2016

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

A Middleware Strategy to Survive Compute Peak Loads in Cloud

Proposed Solution. VoiceXML. Solution Architecture. Solution Architecture

IBM WebSphere Server Administration

WebSphere Application Server - Introduction, Monitoring Tools, & Administration

Performance Optimization For Operational Risk Management Application On Azure Platform

Apache Tomcat Tips and Tricks from the Pros

Java Troubleshooting and Performance

INCREASE SYSTEM AVAILABILITY BY LEVERAGING APACHE TOMCAT CLUSTERING

Apache Tomcat Clustering

Common Server Setups For Your Web Application - Part II

Infor Web UI High Availability Deployment

WebSphere Server Administration Course

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

Deployment and Monitoring. Pascal Robert MacTI

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

TIBCO Spotfire Platform IT Brief

Liferay Performance Tuning

Blackboard Learn TM, Release 9 Technology Architecture. John Fontaine

Virtualization Technologies and Blackboard: The Future of Blackboard Software on Multi-Core Technologies

An introduction to Apache Traffic Server. Leif Hedstrom December 2011

ActiveVOS Performance Tuning

Oracle WebLogic Server 11g: Monitor and Tune Performance

Performance Testing. Configuration Parameters for Performance Testing

In Memory Accelerator for MongoDB

24x7 Scheduler Multi-platform Edition 5.2

STREAMEZZO RICH MEDIA SERVER

- An Essential Building Block for Stable and Reliable Compute Clusters

Cloud Operating Systems for Servers

A Comparative Study on Vega-HTTP & Popular Open-source Web-servers

Business white paper. HP Process Automation. Version 7.0. Server performance

JVM Garbage Collector settings investigation

Angelika Langer The Art of Garbage Collection Tuning

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

HP NonStop JDBC Type 4 Driver Performance Tuning Guide for Version 1.0

JMETER - MONITOR TEST PLAN

Mastering Tomcat Development

Installation and configuration of Real-Time Monitoring Tool (RTMT)

J2EE-JAVA SYSTEM MONITORING (Wily introscope)

Determine the process of extracting monitoring information in Sun ONE Application Server

Chapter 1 - Web Server Management and Cluster Topology

Understanding Server Configuration Parameters and Their Effect on Server Statistics

Deploying the BIG-IP LTM with. Citrix XenApp. Deployment Guide Version 1.2. What s inside: 2 Prerequisites and configuration notes

Basic TCP/IP networking knowledge of client/server concepts Basic Linux commands and desktop navigation (if don't know we will cover it )

Implementing a Well- Performing and Reliable Portal

F5 BIG-IP V9 Local Traffic Management EE Demo Version. ITCertKeys.com

Performance Analysis of Web based Applications on Single and Multi Core Servers

EQUELLA. Clustering Configuration Guide. Version 6.0

Tuning WebSphere Application Server ND 7.0. Royal Cyber Inc.

Informatica Master Data Management Multi Domain Hub API: Performance and Scalability Diagnostics Checklist

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

Transcription:

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

Tomcat Performance Tuning Tomcat Versions

Application/System Monitoring Setup a system to monitor performance over time, Need a baseline to compare normal from abnormal performance Espcially true as dev/test is never a true copy of prod Caveats - typical web server requests spends 80% of its time in application code so most likely area for optimisation.

Tomcat Performance Tuning Servelt 3.0 Spec (Dec 2009) Tomcat 7.0.6 Stable support (Jan 2011) Asynchronous servlets Before only synchronous servlets servlet thread has to wait for any background process to finish before being returned to pool. Now servlet can returnt the thread to the pool while background process is running

Tomcat Config

Tomcat Connectors Most tweaking in Tomcat done with connector parameters. Two connector types Protocol = determines connector type if not specified default to HTTP Connector HTTP connector AJP connector used when tomcat is behind a web server Server Shutdown 8005 (not a connector)

HTTP Connector HTTP Connector 8080 org.apache.coyote.http11.http11protocol (java BIO) org.apache.coyote.http11.http11nioprotocol (java NBIO) unstable? org.apache.coyote.http11.http11aprprotocol (native connector) Connector protocol attribute: HTTP/1.1 uses coyote http 1.1

HTTP Connector Comparison Comparison Table

AJP Connector AJP (Apache JServe Protocol) Connector 8009 org.apache.coyote.ajp.ajpprotocol org.apache.coyote.ajp.ajpnioprotocol (experimental) org.apache.coyote.ajp.ajpaprprotocol Connector protocol attribute: HTTP/1.1 uses coyote http 1.1

AJP Connector AJP (Apache JServe Protocol) Connector 8009 org.apache.coyote.ajp.ajpprotocol org.apache.coyote.ajp.ajpnioprotocol (experimental) org.apache.coyote.ajp.ajpaprprotocol Connector protocol attribute: AJP Uses coyote.ajp.ajpprotocol

AJP Connector Comparison Comparison Table

Apache mod_proxy Pros No need for a separate module compilation and maintenance. mod_proxy, mod_proxy_http, mod_proxy_ajp and mod_proxy_balancer comes as part of standard Apache 2.2+ distribution Ability to use http https or AJP protocols, even within the same balancer. * thanks to blogs.jboss.org

Apache mod_proxy Cons: mod_proxy_ajp does not support large 8K+ packet sizes. Basic load balancer Does not support Domain model clustering

Apache - mod_jk mod_jk - Pros: Cons: Advanced load balancer Advanced node failure detection Support for large AJP packet sizes up to 64K Need to build and maintain a separate module (not really an issue for most Linux distributions)

HTTP KeepAlive HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using the same TCP connection to send and receive multiple HTTP requests/responses, as opposed to opening a new connection for every single request/response pair Wikipedia.

HTTP KeepAlive Advantages The good: Less CPU and memory usage (because fewer connections are open simultaneously) Enables HTTP pipelining of requests and responses Reduced network congestion (fewer TCP connections) Reduced latency in subsequent requests (no handshaking) Errors can be reported without the penalty of closing the TCP connection Disadvantages The bad Wasted server resources, thread idle while others waiting to be serviced,

HTTP KeepAlive Advantages The good: Less CPU and memory usage (because fewer connections are open simultaneously) Enables HTTP pipelining of requests and responses Reduced network congestion (fewer TCP connections) Reduced latency in subsequent requests (no handshaking) Errors can be reported without the penalty of closing the TCP connection Disadvantages The bad Wasted server resources, thread idle while others waiting to be serviced,

HTTP KeepAlive Was a good idea a few years ago. Web 2.0/Ajax maybe not a good idea

Connectors and KeepAlive KeepAlive 2 parameters MaxKeepAliveRequests max number of requests to serve before closing, ConnectionTimeOut max time to keep thread open MaxKeepAliveRequests Set to 1 for high concurrency, not using SSL, (disables keep alive) Set to >1 for SSL, low concurrency

Connectors and KeepAlive ConnectionTimeout - Default = 20 seconds! ConnectionTimeout="20000" too high turn down to +/- 3000 3 seconds If using Apache HTTP set to disable, let apache http handle keep-alive, also do SSL on Apache

Which HTTP Connector To Use? BIO use when: Stablity is important, Keep alive not a limiting factor, Content is dynamic, APR use when: (Almost always) faster, especially for SSL, not an issue if using SSL on Apache http, Lots of static content (sendfile) Keep alive NB factor

Which AJP Connector To Use? Usually Apache and Tomcat are on the same server or at least on the same LAN. TCP handshake setup not a limiting factor Let Apache do the SSL and keepalive management Use APR unless there is stability issues

Tomcat Load Balancing/Clustering Difference between load balancing/clustering (Layer 7) Session replication, Server affinity Load Balancing/Clustering Options Typical Setup Apache mod_proxy, mod_jk Tomcat Clustering Host or Engine level,

Thread Executors Share Thread Pool between applications, new in Tomcat 6 More efficient use of resources by applications Must be setuo before connector in server.xml

Thread Executors Executor Example

Tomcat Caching Static Content BIO blocks when sending static content, APR uses SEND_FILE, - frees worker thread <Context cachemaxsize= 5120 cachettl= 60000 cachingallowed= true > Set cache size to 50MB, default 10MB and ttl on cache to 60 seconds, default is 5 seconds

JVM Tweaking Make sure JVM is in server mode, Set -Xms/-Xmx to approrpiate levels. Not to high or too low, Check cause of out of memory errors if permgen space increase heap will make it worse -XX:PermSize, - XX:MaxPermSize Change gcc algorithms

JVM Tweaking Serial: -XX:+UseSerialGC Parallel: -XX:+UseParallelGC (aka Throughput collector) Parallel Old: -XX:+UseParallelOldGC(aka Parallel Compacting Collector) Concurrency Collector: -XX: +UseConcMarkSweepGC aka (CMS or low-latency collector)

JVM Tweaking Weak generational hypothesis most objects die young. faster GC collection in Eden

JVM Tweaking -XX:NewRatio=N - Ratio of new gen to old gen -XX:NewSize=N - Default new gen size -XX:MaxNewSize=N - Max for new gen size

Tomcat Logging Logging.properties Uses customised logger based on apache.commons.logging Root logger had two handlers defiend a file handler and console handler but in most Linux distributions this is redirected to a file disable one for speed improvement.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.consolehandler.handlers = 1catalina.org.apache.juli.FileHandler

Out of Memory Jumping Bean Www.JumpingBean.co.za Unit 3 Appian Place, 373 Kent Ave, Ferndale South Africa +2711 781 8014