Transcription

Scaling ProgressOpenEdge AppserversSyed Irfan PashaPrincipal QA EngineerProgress Software

Michael Jackson Diesand Twitter Fries

Twitter’s – Fail Whale3 2014 Progress Software Corporation. All rights reserved.

Twitter’s – Scalability Problem Takeaways from the story of Twitter Understand your software’s behavior and foresee its usage Have a mechanism to identify Production issues and raise an alarm smartlybefore your customers do it Scalability acts as a key measure for the Quality of a Software4 2014 Progress Software Corporation. All rights reserved.

Agenda OpenEdge Applications and Focus Areas for Scalability Optimization Techniques for Appserver Tomcat Web Server Tuning Techniques Different Types of Tomcat Connectors Scaling OpenEdge Applications With Load Balancing Q&A5 2014 Progress Software Corporation. All rights reserved.

Focus for Scalability in Progress OpenEdge ComponentsPresentation LayerOpenEdge Clients Open Clients Rollbase MobileApplication ServerOpenEdge AppserverDatabase ServerOpenEdge RDBMS6 2014 Progress Software Corporation. All rights reserved.OpenEdge ReplicationEnterprise ServicesJMSWeb ServicesESBWhere to focuson scalability ?

OpenEdge Appservers and Applications2Web Server(OpenEdge Services/Applications)OpenEdge3Pacific Appserverfor OENon-OpenEdgeClientsClassic Appserver17 2014 Progress Software Corporation. All rights reserved.OpenEdge Appservers

Key Areas to be Focused for ScalabilityClassic Appserver Optimization TechniquesProperties for highconcurrencyWebserver(Tomcat) 2014 Progress Software Corporation. All rights reserved.Different TomcatConnectors and their uses Types of load balancingto be applied forOpenEdge applications Methods for applyingload balancing Best Practices Most of the OpenEdge Adapters and certified usingstandard Java Container, which is Tomcat Tomcat acts a Java Container for “Pacific AS for OE”Why Tomcat?8Tuning techniquesLoad Balancing

Typical Issues With Application Servers No response from the server Client request takes too long to execute Server goes down very often Out of Memory Out of Heap space All kinds of requests goes to the same server Web server needs to be restarted as the Application needs to be upgraded Cannot execute more than a specific number of requests9 2014 Progress Software Corporation. All rights reserved.

Tuning Classic Appserverfor Better Scalability

Tuning Options of Classic AppserverABLWebClientsOpenClients maxClientInstance Set to 512 by defaultClientRequests Heap Memory of the broker process jvmArgs -Xms value -Xmx value Queuelimit (Size of the Payload)/8k Queuelimit valueClassicAppserver11 2014 Progress Software Corporation. All rights reserved. Deleting Persistent and ConnectionProcedures

OpenEdge Applications and its EnvironmentMobile ClientsSOAP ClientsWebspeed ClientsWeb terOpenEdge Services/ApplicationsOpenEdge Appserver12 2014 Progress Software Corporation. All rights reserved.OpenEdge AppserverOpenEdge Appserver

Understanding the TomcatWeb Application Server

Tomcat and its PiecesInstance of the Tomcat WebApplication Server whichcontains one or more servicesServerServiceRoutes requests betweenClients and Web p3WebApp2WebApp4Handles communicationsbetween client and the EngineHighest level of Containerfor processing servletsWeb Applications deployedin multiple hosts14 2014 Progress Software Corporation. All rights reserved.

Tuning Options in Tomcat Webserver Tuning Webserver to scale for maximum client requests15JVM TuningThreadsand itsPropertiesCompressionCache forStatic Files 2014 Progress Software Corporation. All rights reserved.

Tuning Options in Tomcat Webserver – JVM Tuning The defaults are not for the ProductionEnvironmentJVM TuningThreadsand itsPropertiesCompressionCache forStatic Files Higher heap memory causes long pauses inGarbage Collection which will be affected inthe response time Know your needs and configure optimisticmemory Permgen space – Optimistic approach is toset almost 25–30% of total Java heap memorysetenv.{bat/sh}JAVA OPTS -Xms value -Xmx value -XX:MaxGCPauseMillis value -XX: PrintGC -XX: PrintGCDetails16 2014 Progress Software Corporation. All rights reserved.

Tuning Options in Tomcat Webserver – ThreadsConcurrent User RequestsAcceptCount Kernel’s listen queueCompressionCache forStatic FilesAccept CountFurther clientrequests willbe refusedOS buffers TCP(kernel’s listen queue)minSpareThreads(10)maxThreads(50)Threads Configuration17JVM TuningThreadsand itsProperties 2014 Progress Software Corporation. All rights reserved. acceptCount(50)Maxthreads : 200 – 800Optimize based on your Application

Tuning Options in Tomcat Webserver – Monitoring Threadshttp:// hostname : port /managerServer StatusProperties can be configured in server.xml as below Connector port "8080“ connectionTimeout "20000“ maxThreads "500“ / 18 2014 Progress Software Corporation. All rights reserved.

Tuning Options in Tomcat Webserver – Compression Compression Reduces the network payload but gobbles the computational power Client and the webserver both should be configured for compressionClient Execution Time for the Payload of 10000 RecordsExecution Time in ms1800016000Improvement of 110% in executiontime after enabling compression1400012000100008000Compression Disabled6000Compression Enabled400020000CreateUpdateReadOperations Performed19 2014 Progress Software Corporation. All rights reserved.DeleteNetwork Payload/BytesTransferred were150 times less withcompression

Tuning Options in Tomcat Webserver – Caching Static files Allows caching the static files in the browserwith a future expiration dateJVM TuningThreadsand itsPropertiesCompressionCache forStatic Files Reduces the load of calling the static filesevery time from the webserver Mostly used for css, images, javascript andstatic htmlcontent.xml Context cacheMaxSize ”10240” cacheTTL ”60000” cachingAllowed ”true” 20 2014 Progress Software Corporation. All rights reserved.

Tomcat Connectors

Tomcat Connectors – From the Perspective of OpenEdgeHandles communicationsclient and the EngiServerListens on a defined singleport for connectionsConnectorsHTTP & 80Starts AgentsHandles and managescommunication betweenClient and AgentHTTP - HTTP 1.1 Protocol AJP – Apache Jserv Protocol22 2014 Progress Software Corporation. All rights reserved.OpenEdge ClientsAgentsABL Business Logic

Tomcat Connectors – HTTP BIO Connector Executes multiple requests on multiple threads Stable performance for applications with moderatetraffic Consumes more system resources on a burst ofrequests NIO ConnectorWeb ServerHTTPAJPHTTP – HTTP 1.1 Protocol Handles multiple connections using a coupleof poller threads Better managing of threads which shares threadsfor multiple concurrent users APR ConnectorBIO – Blocking Input OutputNIO – Non-blocking Input Output Uses Apache Native Runtime library Mostly used for SSL as it uses OpenSSL librarywhich is fastest23 2014 Progress Software Corporation. All rights reserved.APR – Apache Portable Runtime

Tomcat HTTP Connectors – Which One to w ConcurrencyBIOAPRHigh Concurrency No Keep-AliveBIOAPRHigh Concurrency Keep-AliveAPRNIO 2014 Progress Software Corporation. All rights reserved.

Tomcat Connectors – AJP Tomcat to Apache over a Wire Protocol Mostly used to serve tomcat behindApache httpd and handle the traffic tothe Tomcat clusters Apache serves better static content andbetter caching mechanism Secures tomcat with its inbuilt securityfeatures and third party librariesTomcat Connectors – Why AJPHTTPAJP Widely used as secure proxy servers Examples – modjk, mod proxy,mod http proxy25 2014 Progress Software Corporation. All rights reserved.AJP – Apache Jserv Protocol

After Applying Tuning in Appserver and Webserver What if your application is getting more and more hits Followed all tuning possibilities and best practices– Optimal JVM options, heap space etc.– Choosing right Connector for the Application– Enabled Compression– Optimal number of threads, connection timeouts What might go wrong– More and more requests conquer your webserver– Webserver Out of Memory– Client Requests exceeds the maximum numberof requests26 2014 Progress Software Corporation. All rights reserved.Is adding moreComputational resourcesan ultimate solutionfor Scalability?With all the tuningoptions, can we takeadvantage of horizontalscalability?

Applying Scalability with a Load eserver(alike)Web Server Instance 1WebspeedAdapterSOAPAdapterAIAAdapterWeb Server Instance 2RESTAdapterWebspeedAdapterOpenEdge Services/ApplicationsOpenEdge Appserver27OpenEdge Appserver 2014 Progress Software Corporation. All rights reserved.OpenEdge AppserverSOAPAdapterAIAAdapterRESTAdapterOpenEdge Services/ApplicationsOpenEdge AppserverOpenEdge AppserverOpenEdge Appserver

Applying Scalability with a Load eserver(alike)Web Server Instance 1WebspeedAdapterSOAPAdapterAIAAdapterWeb Server Instance 2RESTAdapterWebspeedAdapterOpenEdge Services/ApplicationsOpenEdge Appserver28OpenEdge Appserver 2014 Progress Software Corporation. All rights reserved.OpenEdge AppserverSOAPAdapterAIAAdapterRESTAdapterOpenEdge Services/ApplicationsOpenEdge AppserverOpenEdge AppserverOpenEdge Appserver

Applying Scalability with a Load d Balancing using AJPWeb Server Instance 1WebspeedAdapterSOAPAdapterAIAAdapterWeb Server Instance 2RESTAdapterWebspeedAdapterOpenEdge Services/ApplicationsOpenEdge Appserver29OpenEdge Appserver 2014 Progress Software Corporation. All rights reserved.OpenEdge AppserverSOAPAdapterAIAAdapterRESTAdapterOpenEdge Services/ApplicationsOpenEdge AppserverOpenEdge AppserverOpenEdge Appserver

Load Balancing and its Techniques

Load Balancing With ApacheTomcat instance 1Apache HTTPDTomcat instance 2Load Balancer(mod jk)Tomcat instance 3Tomcat instance 4ConfigurationsTomcat – Set the AJP PortMod jk – Configure worker.properties with Tomcat instances detailsApache HTTPD – Configure to send the traffic to the balancer31 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Apache Mod jk Configuration Mod jk acts a load balancer that is configured in the Apache HTTPD Server Properties of this connector is configured in worker.properties file Structure of the properties fileProperties forEach Node– Worker. tomcat node .type ajp13– Worker. tomcat-node .port ajp port – Worker. tomcat-node .host hostname of the tomcat-node – Worker.list list of workers Generic Properties– Worker.balancer.type lb– Worker.balancer.balancer workers tomcat-node1 , tomcat-node2 – Worker.stat.type any defined name for your worker status 32 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Apachehttp:// hostname : apacheport /myAppTomcat instance 11st RequestApache HTTPDTomcat instance 2Load Balancer(mod jk)Tomcat instance 3Tomcat instance 433 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Apachehttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDTomcat instance 2Load Balancer2nd Request(mod jk)Tomcat instance 3Tomcat instance 434 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Apachehttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDTomcat instance 2Load Balancer(mod jk)Tomcat instance 33rd RequestTomcat instance 435 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Apachehttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDTomcat instance 2Load Balancer(mod jk)Tomcat instance 3Tomcat instance 44th Request36 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Apachehttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDLoad Balancer(mod jk)XTomcatstance 2Tomcat instance 3Tomcat instance 437 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Apachehttp:// hostname : apacheport /myAppTomcat instance 15th RequestApache HTTPDLoad Balancer(mod jk)XTomcatstance 2Tomcat instance 3Tomcat instance 438 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Apachehttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDLoad Balancer(mod jk)XTomcatstance 2Tomcat instance 36th RequestTomcat instance 439 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Tomcat ClustersHTTP Stateless ClientsBasic Load BalancerAllows a user to route thetraffic across differentnodes40 2014 Progress Software Corporation. All rights reserved.HTTP Stateful ClientsSticky Sessions/Session AffinityPersists the users sessionfor a single nodeSession ReplicationReplicates the sessionacross multiple nodes ofthe load balancer

Load Balancing With Tomcat Clusters Session Replication Provides High Availability and Fail-over tolerance in a clustered environmentMulticastEnables all the cluster nodes join themulticast group and sends the heartbeatsignals for certain intervalsTomcatSessionManagerAs part of creating and managing thesession, it replicates the session to alltomcat nodes Enable multicast routing in your server machine Enable/Add Cluster configuration in Tomcat Add distributable tag to the Web Application41 2014 Progress Software Corporation. All rights reserved.Configuring Session Replication

Load Balancing With Tomcat ClustersSession createdfor 1st Requesthttp:// hostname : apacheport /myAppTomcat instance 1SessionContextApache HTTPDTomcat instance 2Load Balancer(mod jk)Tomcat instance 3Tomcat instance 41st Request42 2014 Progress Software Corporation. All rights reserved.

Load Balancing With Tomcat Clustershttp:// hostname : apacheport /myAppSessionContextTomcat instance 1Apache HTTPDTomcat instance 2Load Balancer(mod jk)Tomcat instance 3Tomcat instance 41st Request43 2014 Progress Software Corporation. All rights reserved.Replicatingthe sessionacrossmultipleinstancesusing ApacheTribes Group

Load Balancing With Tomcat Clustershttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDTomcat instance 2SessionContextSessionContextLoad Balancer(mod jk)Tomcat instance 3SessionContextTomcat instance 41st Request44 2014 Progress Software Corporation. All rights reserved.SessionContext

Load Balancing With Tomcat Clustershttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDTomcat instance 2SessionContextSessionContextLoad Balancer(mod jk)Tomcat instance 3SessionContextTomcat instance 42nd Request45 2014 Progress Software Corporation. All rights reserved.SessionContext

Load Balancing With Tomcat Clustershttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDTomcat instance 2SessionContextSessionContextLoad Balancer(mod jk)Tomcat instance 3SessionContextTomcat instance 43rd Request46 2014 Progress Software Corporation. All rights reserved.SessionContext

Load Balancing With Tomcat Clustershttp:// hostname : apacheport /myAppTomcat instance 1Apache HTTPDTomcat instance 2SessionContextSessionContextLoad Balancer(mod jk)Tomcat instance 3SessionContextTomcat instance 44th Request47 2014 Progress Software Corporation. All rights reserved.SessionContext

Load Balancing With Tomcat Clustershttp:// hostname : apacheport /myAppXTomcatApache HTTPDtance 1Tomcat instance 2SessionContextSessionContextLoad Balancer(mod jk)Tomcat instance 3SessionContextTomcat instance 44th Request48 2014 Progress Software Corporation. All rights reserved.SessionContext

Summary1. Tuning Classic Appserver1. Applying Load balancing for OpenEdge Applications2. Properties and best practices2. Stateless and Stateful mcatWeb Server1. Tuning Tomcat Webserver2. Choosing the right Connector49 2014 Progress Software Corporation. All rights reserved.

References50 .html manceTuningApacheTomcat-Part2.pdf http://tomcat.apache.org/connectorsdoc/generic howto/loadbalancers.html 2014 Progress Software Corporation. All rights reserved.

Q&A

Want to Learn More About OpenEdge 11? Role-based learning paths are available for OpenEdge 11 Each course is available as Instructor-led training or eLearning Instructor-led training: 500 per student per day ation/instructor-led-training eLearning: Via the Progress Education Community (https://wbt.progress.com): OpenEdge Developer Catalog: 1500 per user per year OpenEdge Administrator Catalog: 900 per user per year User Assistance videos: nedge26 2014 Progress Software Corporation. All rights reserved.

Visit the Resource Portal Get session details & presentation downloads Complete a survey Access the latest Progress product literaturewww.progress.com/exchange2014