Component SWE 645
Popular in Course
Popular in Information technology
This 8 page Class Notes was uploaded by Consuelo Schultz on Monday September 28, 2015. The Class Notes belongs to SWE 645 at George Mason University taught by Staff in Fall. Since its upload, it has received 17 views. For similar materials see /class/215067/swe-645-george-mason-university in Information technology at George Mason University.
Reviews for Component
Report this Material
What is Karma?
Karma is the currency of StudySoup.
Date Created: 09/28/15
Performance and Clustering of J2EE Applications SWE 645 Fall 2004 Nick Duan Objectives Identify performance problems in J2EE Identify solutions for performance enhancement in development and configuration 7 Understand scalability reliability and availability in J2EE applications Understand various options in creating a clustered J2EE environment Understand the important design considerations for largescale applications Nov 17 2004 Nick Duan Performance Issues Is your application capable of handling large number of concurrent user requests 7 Is your application capable of performing large number of concurrent transactions in a multitiered environment Where is the bottleneck 7quot Webtier EJBtier 7quot Databasetier Hardware related CPU Memory Network etc Nov 17 2004 Nick Duan 3 Performance Enhancement and Optimization Who is responsible for doing performance enhancement 39 Bean Provider efficient design and coding v39 Deployer component configuration 39 Container Provider caching pooling and bean management Server Provider communication clustering Administrator server tuning resource configuration and management Nov 172004 Nick Duan 4 Performance Enhancement via Design and Coding Web Application Static vs dynamic content static vs dynamic loading data caching in different scopes thread safety database access EJB Application stateless vs Stateful session bean session facade local interface for entity beans short transactions containermanaged persistence batched queries javasqlStatement Java Language Primitive vs Object types String vs StringBuffer Vector vs ArrayList Nov 17 2004 Nick Duan Performance Enhancement via Caching and Pooling Resource Connection Pooling Live instance cached with the idle state 7 Database JMS JCA connectors E Web Object Pooling Not available T Web Object Caching Not configurable EJB Object Pooling stateless session entity and messagedriven beans Beanspecific i EJB Object Caching stateful session and entity beans in active idle or passivated state Beanspecific Nov 172004 Nick Duan Configuration via Deploytool u 3 annual 39 Ne e Principal Name EmployeeBmpBean on m Name Pass By Reference Employae mp aan true v u anew u a a steady Poul size Max Cache Size Resize Quantity Resize Quantity ache Idle Tlmeoul In Seconds ax Pool Size w 8 Cache Overflow Alluwed Poul Idle Timeout In Seconds ax Wait Time in Millis victim Selec on Policy l 39 M0 Iru Read only Close elp Nov 17 2004 Nick Duan 7 Configuration via A min Console 5 la Erie at an new cam gt r g a i new Favmites gamma gr Y v evl SeavmWeh v E 91 l Versmn i Application ServerAdmin Console 8101 WEEEDZ B ll pea links Mail v QMvVanaai Wpeysanais v remen l Remslrzmnn l Lnunm l Heln User admin Server lucalhusl a ApplicaliunSeNer Applicaliunsewer gt vzeeomaneys gt EJBCnmzmer A l l 7 9 D mum lEJasemngs l MDasemngs EJETImerSeMw e 1 EnlemnseAPpllcaliun CWEMW Enterprise Java Beans EJB m Mr42quot Use Wis page in manage genevai EJE selling 1 EJE Modules SESSWHNWELDEZ Iquot cISunIAppsewerlggmainsiggmamlIsessign lure g persistent Hrw session storage e e Passivmed bean an Cnmmn Ormnn t Opliun Er caene a readv inslance bemeen lransacliuns 1 App ClienlMudules JDEC g Persislencemanauers f Opliun C a Do nul cache 3 readv inslance bemeen lransacliuns U JavaMail Sessions MPH u Dl 5 Cunneclurs Pool Senings 9 JZEECW Z39WS memenm mumPnnlSIze 39n Nmmmm 5 Web Cunlainer HE Cnmzm Maximum ngI sue 8 WW mmquot a Securilv PnanesizeQuzmny 2 Nuwbmmms Eli Transacliun Service Pnnllmgnmgmm EDD 3mm a H Pservice a 9 one Cache Semngs a n ThreadPuuls D lnreadrpuulri MZXCZEI ES39IE 512 Numberulbeans Delaun is 512 beans Cache Reslze Quzm y 1 Number m hearile passivale Wnen eaene Mi delaun is 32 Remmi nmenm mm Delaun is 5mm seeangs l 4 l39J 4 Nov 17 2004 Nick Duan Performance Enhancement via Clustering An application is served by a set of homogeneous servers in a distributed enterprise environment Http servers servlet engine EJB servers database 7 Transparent to usersclients Scalability Reliability and Availability tradeoff with performance quot Load balancing distribute work load ofthe application among multiple machines 7quot Failover if one machine is done request will be redirected to others Difficult problems Management of user sessions and business transactions Session persistency and synchronization No change of services during transactions Nov 17 2004 Nick Duan Scalability in a Multitiered Environment Hardware dependencies Vertical scaling Adding more hardware Software dependencies Horizontal scaling Server clustering Running applications on multiple servers or server instances Web servers application servers database servers Typical components for clustering in a multi tiered environment Web server web application serverEJB serverapp server and database server Each tier in front client dispatches request to tier in the back cluster of services Nov 172004 Nick Duan Clustering of Web Application Servers Simple type Dispatcherwith a set of independent sewers Request of clients redirected by the dispatcherto individual servers via Http Redirect E Complex type Federation oftightly integrated machine 7 Star topology with centralized load balancercontroller 39 Hardware LB CISCO contentbased switch Software LB Apache Tomcat JNDI server Networked topology with distributed control everyone keeps a session copy of everyone else Nov 172004 Nick Duan 11 Clustering with Tomcat Works in conjunction with the Apache Web server Multiple instances of Tomcat can be initiated during startup to form a cluster 7 Load balancer is defined by the JK adapter responsible for dispatching requests to workers and maintaining sticky user sessions Requests are scheduled and distributed using weighted RoundRobin Configuration defined in the workersproperties file under conf directory Nov 17 2004 Nick Duan 12 Tomcat Clustering with Apache HTTP Server JK Aoache Web M i le Server builHn Database LB Nov 172004 Nick Duan 13 Design Factors in a Clustering Environment Session Management Sticky Sessions LB will fonNard the requests of the same user session to the same worker Session Replication and Persistency Replicating sessions attributes and other information eg login time out security etc Vendorapplication specific Database File System Inmemory Implement Se aizable to ensure session persistency Use transaction services Nov 17 2004 Nick Duan 14 Clustering of EJB Servers Clustering logicLoadbalancing algorithm How to locate and select an EJB Service for a request Round robin leastrecently used notrecently used 7 Type ofdispatch control for loadbalancing LB and failover FV Clientdirected service locator pattern JNDIdirected Containerdirected Home stub Remote stub Nov 17 2004 Nick Duan 15 Clustering of different EJB types Stateless session most scalable bean types LB on both home and remote component methods FV on home but not all remote methods Stateful session session replication required LB on home but not remote component methods FV on only idempotent home and remote methods Entity possible but not recommended LB on both home and remote methods FV on idempotent methods Caching is a problem Messagedriven relies on JMS clustering inherently scalable Nov 172004 Nick Duan 16