• No results found

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

N/A
N/A
Protected

Academic year: 2021

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

Copied!
54
0
0

Loading.... (view fulltext now)

Full text

(1)

Scaling Progress

OpenEdge Appservers

Syed Irfan Pasha Principal QA Engineer Progress Software

(2)

Michael Jackson Dies

and Twitter Fries

(3)

© 2014 Progress Software Corporation. All rights reserved.

3

(4)

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 smartly before your customers do it

(5)

© 2014 Progress Software Corporation. All rights reserved.

5

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

(6)

Focus for Scalability in Progress OpenEdge Components

Presentation Layer

OpenEdge Clients Open Clients Rollbase Mobile

Application Server

OpenEdge Appserver

Database Server

OpenEdge RDBMS OpenEdge Replication

Enterprise Services

JMS Web Services ESB

Where to focus

on scalability ?

(7)

© 2014 Progress Software Corporation. All rights reserved.

7

OpenEdge Appservers and Applications

Classic Appserver

Pacific Appserver

for OE

Web Server

(OpenEdge Services/ Applications)

2

3

1

OpenEdge Appservers

OpenEdge Non-OpenEdge Clients

(8)

Key Areas to be Focused for Scalability

Classic Appserver Webserver(Tomcat) Load Balancing

Most of the OpenEdge Adapters and certified using standard Java Container, which is Tomcat

Tomcat acts a Java Container for “Pacific AS for OE”

Optimization Techniques

Properties for high concurrency

Tuning techniques

Different Tomcat

Connectors and their uses

Best Practices

Types of load balancing to be applied for

OpenEdge applications

Methods for applying load balancing

(9)

© 2014 Progress Software Corporation. All rights reserved.

9

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

(10)

Tuning Classic Appserver

for Better Scalability

(11)

© 2014 Progress Software Corporation. All rights reserved.

11

Tuning Options of Classic Appserver

 maxClientInstance

• Set to 512 by default

 Heap Memory of the broker process

• jvmArgs=-Xms<value> -Xmx<value>

 Queuelimit

• (Size of the Payload)/8k = Queuelimit value

 Deleting Persistent and Connection

Procedures

Classic

Appserver

Client Requests ABL Web Clients Open Clients

(12)

OpenEdge Applications and its Environment Mobile Clients Webspeed Adapter SOAP Adapter AIA Adapter REST Adapter

SOAP Clients Webspeed Clients

OpenEdge Appserver

OpenEdge Services/Applications

OpenEdge Appserver OpenEdge Appserver

(13)

Understanding the Tomcat

Web Application Server

(14)

Handles communications between client and the Engine

Highest level of Container for processing servlets Web Applications deployed

in multiple hosts

Instance of the Tomcat Web Application Server which contains one or more services

Routes requests between Clients and Web Applications

Server

Service

Tomcat and its Pieces

Engine Host1 WebApp1 WebApp2 Host2 WebApp3 WebApp4 Connectors

(15)

© 2014 Progress Software Corporation. All rights reserved.

15

Tuning Options in Tomcat Webserver

 Tuning Webserver to scale for maximum client requests

JVM Tuning

Threads and its Properties

Compression Cache for

(16)

Tuning Options in Tomcat Webserver – JVM Tuning

 The defaults are not for the Production

Environment

 Higher heap memory causes long pauses in

Garbage Collection which will be affected in the response time

 Know your needs and configure optimistic

memory

 Permgen space – Optimistic approach is to

set almost 25–30% of total Java heap memory

JAVA_OPTS -Xms <value> -Xmx <value> -XX:MaxGCPauseMillis <value>

-XX:+PrintGC -XX:+PrintGCDetails setenv.{bat/sh} JVM Tuning Threads and its Properties

Compression Cache for Static Files

(17)

© 2014 Progress Software Corporation. All rights reserved.

17

Tuning Options in Tomcat Webserver – Threads

JVM Tuning

Threads and its Properties

Compression Cache for Static Files minSpareThreads(10) maxThreads(50) C onc ur rent U s er R eques ts Threads Configuration + acceptCount(50) Further client requests will be refused OS buffers TCP

(kernel’s listen queue) Accept Count

AcceptCount ∝ Kernel’s listen queue

Maxthreads : 200 – 800

(18)

Tuning Options in Tomcat Webserver – Monitoring Threads

Properties can be configured in server.xml as below

<Connector port="8080“ connectionTimeout="20000“ maxThreads="500“ />

(19)

© 2014 Progress Software Corporation. All rights reserved.

19

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 compression

0 2000 4000 6000 8000 10000 12000 14000 16000 18000

Create Update Read Delete

E xecu tio n T im e in ms Operations Performed

Client Execution Time for the Payload of 10000 Records

Compression Disabled Compression Enabled

Improvement of 110% in execution time after enabling compression

Network Payload/Bytes Transferred were 150 times less with

(20)

Tuning Options in Tomcat Webserver – Caching Static files

 Allows caching the static files in the browser

with a future expiration date

 Reduces the load of calling the static files every time from the webserver

 Mostly used for css, images, javascript and

static html

JVM Tuning

Threads and its Properties

Compression Cache for

Static Files

<Context cacheMaxSize=”10240” cacheTTL=”60000” cachingAllowed=”true”>

(21)
(22)

Tomcat Connectors – From the Perspective of OpenEdge

Server

Connectors HTTP & AJP Handles communications client and the Engi

Listens on a defined single port for connections

Engine Web Applications Ubroker Starts Agents OpenEdge Clients

Handles and manages communication between Client and Agent

ABL Business Logic Agents

http://localhost:8080

AJP – Apache Jserv Protocol HTTP - HTTP 1.1 Protocol

(23)

© 2014 Progress Software Corporation. All rights reserved.

23

Tomcat Connectors – HTTP

 BIO Connector

• Executes multiple requests on multiple threads

• Stable performance for applications with moderate traffic

• Consumes more system resources on a burst of requests

 NIO Connector

• Handles multiple connections using a couple of poller threads

• Better managing of threads which shares threads for multiple concurrent users

 APR Connector

• Uses Apache Native Runtime library

• Mostly used for SSL as it uses OpenSSL library which is fastest

HTTP

AJP

Web Server

HTTP – HTTP 1.1 Protocol

BIO – Blocking Input Output NIO – Non-blocking Input Output APR – Apache Portable Runtime

(24)

Tomcat HTTP Connectors – Which One to Choose

Option-1 Option-2

Stability BIO APR

SSL APR NIO

Low Concurrency BIO APR

High Concurrency No Keep-Alive BIO APR

(25)

© 2014 Progress Software Corporation. All rights reserved.

25

Tomcat Connectors – AJP

 Tomcat to Apache over a Wire Protocol

 Mostly used to serve tomcat behind Apache httpd and handle the traffic to the Tomcat clusters

 Apache serves better static content and better caching mechanism

 Secures tomcat with its inbuilt security features and third party libraries

 Widely used as secure proxy servers

 Examples – modjk, mod_proxy, mod_http_proxy

HTTP

AJP

Tomcat Connectors – Why AJP

(26)

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 number of requests

Is adding more

Computational resources an ultimate solution

for Scalability? With all the tuning options, can we take advantage of horizontal

(27)

© 2014 Progress Software Corporation. All rights reserved.

27

Applying Scalability with a Load Balancer

Webspeed Adapter SOAP Adapter AIA Adapter REST Adapter OpenEdge Appserver OpenEdge Services/Applications

OpenEdge Appserver OpenEdge Appserver

Web Server Instance 1

Webspeed Adapter SOAP Adapter AIA Adapter REST Adapter OpenEdge Appserver OpenEdge Services/Applications

OpenEdge Appserver OpenEdge Appserver

Web Server Instance 2

Nameserver(alike)

Mobile Clients SOAP Clients Webspeed Clients

(28)

Applying Scalability with a Load Balancer Webspeed Adapter SOAP Adapter AIA Adapter REST Adapter OpenEdge Appserver OpenEdge Services/Applications

OpenEdge Appserver OpenEdge Appserver

Web Server Instance 1

Webspeed Adapter SOAP Adapter AIA Adapter REST Adapter OpenEdge Appserver OpenEdge Services/Applications

OpenEdge Appserver OpenEdge Appserver

Web Server Instance 2

Nameserver(alike)

Mobile Clients SOAP Clients Webspeed Clients

(29)

© 2014 Progress Software Corporation. All rights reserved.

29

Applying Scalability with a Load Balancer

Webspeed Adapter SOAP Adapter AIA Adapter REST Adapter OpenEdge Appserver OpenEdge Services/Applications

OpenEdge Appserver OpenEdge Appserver

Web Server Instance 1

Webspeed Adapter SOAP Adapter AIA Adapter REST Adapter OpenEdge Appserver OpenEdge Services/Applications

OpenEdge Appserver OpenEdge Appserver

Web Server Instance 2

Load Balancing using AJP

Mobile Clients SOAP Clients Webspeed Clients

(30)
(31)

© 2014 Progress Software Corporation. All rights reserved.

31

Load Balancing With Apache

Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

Configurations

Tomcat – Set the AJP Port

Mod_jk – Configure worker.properties with Tomcat instances details Apache HTTPD – Configure to send the traffic to the balancer

(32)

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 file

– 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>

– Worker.balancer.type = lb

– Worker.balancer.balancer_workers = <tomcat-node1>,<tomcat-node2>

– Worker.stat.type = <any defined name for your worker status>

Generic Properties Properties for

(33)

© 2014 Progress Software Corporation. All rights reserved.

33

Load Balancing With Apache

Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 1st Request

(34)

Load Balancing With Apache Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 2nd Request

(35)

© 2014 Progress Software Corporation. All rights reserved.

35

Load Balancing With Apache

Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 3rd Request

(36)

Load Balancing With Apache Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 4th Request

(37)

© 2014 Progress Software Corporation. All rights reserved.

37

Load Balancing With Apache

Tomcat stance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp

X

(38)

Load Balancing With Apache Tomcat stance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 5th Request

X

(39)

© 2014 Progress Software Corporation. All rights reserved.

39

Load Balancing With Apache

Tomcat stance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 6th Request

X

(40)

Load Balancing With Tomcat Clusters

Basic Load Balancer Sticky Sessions/

Session Affinity Session Replication

Allows a user to route the traffic across different

nodes

Persists the users session for a single node

Replicates the session across multiple nodes of the load balancer

(41)

© 2014 Progress Software Corporation. All rights reserved.

41

Load Balancing With Tomcat Clusters

 Session Replication

• Provides High Availability and Fail-over tolerance in a clustered environment

• Enable multicast routing in your server machine

• Enable/Add Cluster configuration in Tomcat

• Add <distributable> tag to the Web Application Enables all the cluster nodes join the

multicast group and sends the heartbeat signals for certain intervals

As part of creating and managing the session, it replicates the session to all

tomcat nodes

Multicast

Tomcat Session

Manager

(42)

Load Balancing With Tomcat Clusters Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 1st Request Session Context Session created for 1st Request

(43)

© 2014 Progress Software Corporation. All rights reserved.

43

Load Balancing With Tomcat Clusters

Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 1st Request Session Context Replicating the session across multiple instances using Apache Tribes Group

(44)

Load Balancing With Tomcat Clusters Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 1st Request Session Context Session Context Session Context Session Context

(45)

© 2014 Progress Software Corporation. All rights reserved.

45

Load Balancing With Tomcat Clusters

Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 2nd Request Session Context Session Context Session Context Session Context

(46)

Load Balancing With Tomcat Clusters Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 3rd Request Session Context Session Context Session Context Session Context

(47)

© 2014 Progress Software Corporation. All rights reserved.

47

Load Balancing With Tomcat Clusters

Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat instance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 4th Request Session Context Session Context Session Context Session Context

(48)

Load Balancing With Tomcat Clusters Tomcat instance 2 Tomcat instance 4 Tomcat instance 3 Tomcat tance 1

Apache HTTPD

Load Balancer

(mod_jk)

http://<hostname>:<apacheport>/myApp 4th Request Session Context Session Context Session Context Session Context

X

(49)

© 2014 Progress Software Corporation. All rights reserved. 49 Summary

Classic

Appserver

Tomcat

Web Server

Load

Balancing

1. Tuning Classic Appserver 2. Properties and best practices

1. Tuning Tomcat Webserver 2. Choosing the right Connector

Scalability

1. Applying Load balancing for OpenEdge Applications 2. Stateless and Stateful Requests

(50)

References

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

http://tomcatexpert.com/sites/default/files/PerformanceT uningApacheTomcat-Part2.pdf

http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html

(51)
(52)

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

• https://www.progress.com/support-and-services/education/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

(53)

Get session details & presentation downloads

Complete a survey

Access the latest Progress product literature

www.progress.com/exchange2014

(54)

References

Related documents

A broad questionnaire survey of 282 construction industry professionals was conducted to identify major types of waste, benefits of lean construction, implementation levels of

It is also for this reason that that, for the period(s) we are looking at, the term ‘non-literary’ seems to be more suitable and inclusive, enabling our contrib- utors to take

The models were grouped as follows: (1) one-way ANOVAs that examined the effects of job category, age, experience, and gender on both psychological distress and pain regions; (2)

For example, in response to the formation of the Peruvian indigenous organization the National Confederation of Communities Affected by Mining in Peru (CONACAMI for its

Then, a distributed model-free adaptive bipartite consensus tracking (DMFABCT) scheme is designed for unknown detected-time heterogeneous nonaffine nonlinear MASs with

Most application servers are easily clustered and load balanced by using the Apache httpd Web server with the Tomcat Connector (mod_jk) plugin.. The Tomcat Connector module

In this guide, we’ll cover majorly used connector mod_jk Configuring load balancing between Apache HTTP Server and tomcat Server using mod_jk.. Mod_jk is the Apache HTTPD module

Elastic Load Balancer Auto Scaling EC2 Instance 1 Application Tomcat Apache EC2 Instance N Application Tomcat Apache ... Log Files