Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 32

GlassFish in the Real World

Mike Croft

© C2B2 Consulting Limited 2013


All Rights Reserved
GlassFish in the Real World

INTRODUCTIONS

© C2B2 Consulting Limited 2013


All Rights Reserved
Who Am I?

• C2B2 Expert Support consultant

• Ex-IBM
• Snowboarder
• @croft

© C2B2 Consulting Limited 2013


All Rights Reserved
Who are you?

© C2B2 Consulting Limited 2013


All Rights Reserved
Why Are We Here?

• What’s a “Middleware”?

• What is RASP?
– Why is it important?

• How do I do this for real?

© C2B2 Consulting Limited 2013


All Rights Reserved
GlassFish in the Real World

WHAT’S A “MIDDLEWARE”?

© C2B2 Consulting Limited 2013


All Rights Reserved
What’s a “Middleware”?

JEE
Application
Server

Web Internet Fire Load


Browser wall Balancer DB
JEE
Application
Server

The Middle

© C2B2 Consulting Limited 2013


All Rights Reserved
GlassFish in the Real World

WHAT IS “RASP”?

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
Non-Functional Requirements
• Reliability

• Availability
• Scalability
• Performance

These Are Priority 1 Requirements!

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
RELIABILITY
• No Data Loss or Corruption

• Prevents Exploits
• Fraud
• Reputation Risk

• Legal Challenge
Customers need confidence
in their transactions
© C2B2 Consulting Limited 2013
All Rights Reserved
What is RASP?
AVAILABILITY
• Available for customers

• No availability? No transactions
• Transactions = £££
• Receive your P45 if you can’t sort it!

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
AVAILABILITY
• Systems Complex

• Systems must be 24/7


• No Maintenance Windows
• Online Upgrade

• Graceful Degradation
• Failure Detection

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
AVAILABILITY

System System System


1 2 3

99% Availability 99% Availability 99% Availability

Overall Availability = 0.99*0.99*0.99 = 97%

How many days downtime?


© C2B2 Consulting Limited 2013
All Rights Reserved
What is RASP?
AVAILABILITY
Redundancy Decoupling
System 1 99% Availability
System 99% Availability

System 99% Availability 99% Availability System 2

Pair = 1 – (0.01*0.01) = 99.99%


System 3 99% Availability
Overall = 0.9999 x 0.9999 x 0.9999 = 99%
Overall = 99%

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
AVAILABILITY

Cluster Cluster Cluster


Node Node Node
1 2 3

Cluster Availability = 99.99%

ONLY IF 2 Nodes can cope with peak load


Otherwise Availability is only 99%

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
SCALABILITY
Add hardware in response to demand

Without a reduction in performance!


© C2B2 Consulting Limited 2013
All Rights Reserved
What is RASP?
SCALABILITY
• Success of the Business or Service

• Growth of Mobile
• Huge Variation of Load through a period
• Sudden Large Spikes due to events

Cloud Enables Elastic Scalability


© C2B2 Consulting Limited 2013
All Rights Reserved
What is RASP?
SCALABILITY Scale UP
• Add hardware to a single host

• Add CPUs, memory or disk.


• Typical way of scaling databases
• Expensive for Price/Performance

• Increase server density Image credit: Cisco

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
SCALABILITY Scale OUT
• Add Additional Servers

• Add Load Balancer


• Distribute traffic across the servers
• Much Cheaper than Scale Up

• Has HA benefits Image credit: Cisco

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
SCALABILITY Nirvana
900
800
700
600
500
Linear Scalability
400 Typical Scalability
300
200
100
0
1 2 3 4
© C2B2 Consulting Limited 2013
All Rights Reserved
What is RASP?
SCALABILITY Typical Architecture
Load Balancer

Nodes Host
Stateless Services

Node Node Node Node


1 2 3 4

Database contains
Database Persistent State

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
PERFORMANCE
How fast does a single transaction take to execute?

• Faster Performance = Happier Customers


• Faster Performance = More Transactions

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
PERFORMANCE
• Raw Algorithmic Performance

• Resource Limitations
– Not enough cpu, disk, memory

• Resource Contention
– Locks

• IO Latency
– Network, Disk

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
PERFORMANCE

LATENCY
Time delay in requesting an operation and it being
initiated

• Key factor in large scale distributed applications


• Typically not taken into account during development

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
PERFORMANCE Latency Factors
• Network Distance

• Network Reliability
• Data Size
• Operation Granularity

• Resource Contention
• JVM GC

© C2B2 Consulting Limited 2013


All Rights Reserved
What is RASP?
PERFORMANCE Solution?

Move the Data and Processing


Close Together

© C2B2 Consulting Limited 2013


All Rights Reserved
GlassFish in the Real World

HOW DO I DO THIS FOR REAL?

© C2B2 Consulting Limited 2013


All Rights Reserved
How Do I Do This For Real?

1. Acquire Servers

© C2B2 Consulting Limited 2013


All Rights Reserved
How Do I Do This For Real?

2. Acquire GlassFish 4
https://glassfish.java.net/download.html

© C2B2 Consulting Limited 2013


All Rights Reserved
How Do I Do This For Real?

3. Configure GlassFish
asadmin start-domain domain1
asadmin change-admin-password --user admin asadmin tool
asadmin enable-secure-admin
asadmin restart-domain

Admin console

© C2B2 Consulting Limited 2013


All Rights Reserved
How Do I Do This For Real?

4. Demo!

© C2B2 Consulting Limited 2013


All Rights Reserved
GlassFish in the Real World

ANY QUESTIONS?

© C2B2 Consulting Limited 2013


All Rights Reserved

You might also like