K2B - EuropCar - JBoss - xTreme Software

splattersquadΑσφάλεια

16 Νοε 2013 (πριν από 3 χρόνια και 7 μήνες)

103 εμφανίσεις

LOGO

Contents

Performance Tuning

Why
JBoss
?

www.key2.it


Key objectives

LOGO

Key

Objectives


Compatibility with
EuropCar

legacy
network topology


Maximize application performance also
when load is high


Achieve scalability


Achieve high availability


Simplify management





www.key2.it


LOGO

Why

JBoss
?


Industry

standard in
conjunction

with
RedHat

OS


Solution
proven


Compatibility with
latest

JEE standard
(JSF/EJB3.0/JPA2.0…)


JBoss

easy management




www.key2.it


LOGO

Performance


Main

topic

of
optimization


OS


Virtual Machine


JBoss

configurations


Tomcat

(The
JBoss

default web
layer
)


Code


Clustering

LOGO

OS
optimization


Assure

latest

patch for
underlying

OS


Configure

the OS for
managing

large
pagination

and large
shared

memory


In Linux OS:
sysctl



Disable

unused

services
/
uninstall

packages


Keep

it

clean
!




LOGO

Virtual Machine


Use latest virtual machine. New release increase
performance and fix bugs


Tune Garbage Collector


-
verbose:gc


-
XX:ParallelGCThreads
=10


-
XX:+
UseParallelGC


Use of “server” optimizations


-
server


Other optimization available:


-
XX:+
AggressiveOpts

(latest optimizations)


-
XX:DoEscapeAnalysis

(thread
-
related
optimizations)


LOGO

JBoss

&
Tomcat


Increase

the maximum
size

of the
memory

allocation

pool


Dimension

JBoss

thread

pools (System, http,
EJB3,
etc
…)


Dimension

JBoss

JDBC connection pool


Increase

JBoss

p
repared

statement cache


Turn down verbose
logging


Remove

unused

services

from
configuration


LOGO

JBoss

&
Tomcat

2


Disable

hot
deploy


Mark
read
-
only

EJB
Method’s

to in
JBoss

jboss.xml

(
maximize

performance in
not

transacted

methods
)


Increase

number

of
concurrent

thread

in
tomcat


Disable

tomcat

services

not

used



LOGO

Application code


JSP Can be
precompiled

and
configured

in
web.xml


Use cluster
hints

in
entity

(
say

if

a
query

should

be
cached

or no)


Use
correct

t
ransaction

declaration

for
ejb

methods


Configure

EJB and
web.xml

for
distribuited

application


Demand

all

key
-
service to
JBoss

instead

of I
-
do
-
all

approach

(security, connection
handling
,
transaction

demarcation

etc
…)


LOGO

Clustering


A
JBoss

instance with small heap size is more
efficient than large heap (page addressing issue)


Instead of increasing heap size we can replicate
JBoss

instance


A cluster is a set of node (each node is a
JBoss

instance) that cooperate


A cluster can handle single instance failover


JBoss

nodes communicates trough multicast
address. Services interoperability trough
JGroups


State replication

LOGO

State
replication


Replication of
clustered

webapp

sessions


Replication of
clustered

EJB3
Stateful

Session
beans


Clustered

caching

of JPA and
Hibernate

entities


Clustered

Single
Sign
-
On


The HA
-
JNDI
replicated

tree


Distributed State Service


LOGO

High
availability

-

W
ithout


Load

balancer

proxy

take
ip

client’s

for
handling

any

further

requests

(
sticky

session)


If

a
instance

fail

all

node

session’s

are
lost
!


Service
is

also

up
but

current

user

information
is

lost
!


Login data are
lost
!


If

application

span

transaction

over
requests

all

information are
also

lost


LOGO

High
availability

-

JBoss

way


if a node fail, no session data are lost


On node fail router switch users on other nodes
without any error


Access information aren’t lost


Node management can be configured to send mail to
system
administrator


Setup and start of node is simple so multiple backup
-
node is possible


this can achieve high scalability


Real balancing is possible!


Balancing policy can be managed by
JBoss

cluster or
third part
-
products

LOGO

JBoss

Clustering How
-
To


Cluster example configuration is stored into all
configuration


Start
JBoss

with all configuration:


./
run.sh

-
c all


Start
JBoss

in node mode:


./
run.sh

-
c [configuration]
\


-
u [multicast
-
address]
\


-
b [server
-
host]
\


-
Djboss.messaging.ServerPeerID
=[id]
\


-
g [cluster
-
group
-
name]


When node start automatically configure itself to join
cluster. If it is the first to start, he became “master” node


It’s possible to add node while cluster is running!


Simplification of balancing policy: no need to use





LOGO

Q

& A




KEy2.IT