Glass fish performance tuning tips from the field

39
GlassFish Performance Tuning: Tips from the Field teve Millidge : Founder Payara

Transcript of Glass fish performance tuning tips from the field

Page 1: Glass fish performance tuning tips from the field

GlassFish Performance Tuning: Tips from the FieldSteve Millidge : Founder Payara

Page 2: Glass fish performance tuning tips from the field

First Day at Work

Page 3: Glass fish performance tuning tips from the field

It’s All Gone to *#*@!

Page 4: Glass fish performance tuning tips from the field
Page 5: Glass fish performance tuning tips from the field
Page 6: Glass fish performance tuning tips from the field

asadmin discovery commands• version• What version are we running

• list-domains • Discover what domains exist and are running

• list-servers and list-clusters • what exists in the domain

• list-modules • What is running in the domain

• list-applications• Lists all the applications deployed

• list-commands• Lists all knows asadmin commands

Page 7: Glass fish performance tuning tips from the field

What are we looking for?

Page 8: Glass fish performance tuning tips from the field

Barriers to Performance• Raw Algorithmic Performance• Resource Limitations• Not enough cpu, disk, memory

• Resource Contention• Locks

• IO Latency• Network, Disk

Page 9: Glass fish performance tuning tips from the field

Tuning ProcessMeasure

Analyse

HypothesisChange

Test

Page 10: Glass fish performance tuning tips from the field

Analyse• Analyse data to

correlate issues• Use tools during the

performance issue• Use historical data for

trends• Look for evidence of

Barriers

Page 11: Glass fish performance tuning tips from the field

Hypothesis• Use EVIDENCE from

tools• Create a causal

hypothesis• Determine fix that will

mitigate

Page 12: Glass fish performance tuning tips from the field

Change• Change ONE thing• Configuration Changes• Try these first• Many Many things in App Servers

to change

• Code Changes• Only optimise when you have

evidence

• Document all Changes

Page 13: Glass fish performance tuning tips from the field

Test• Create reproducible test case• (If Possible)

• Test Before and After• Gather Evidence of effect of Change

Page 14: Glass fish performance tuning tips from the field

How do we Measure GlassFish?

Page 15: Glass fish performance tuning tips from the field

Standard JVM Tools• JPS – Discover running Java process• Jstack – View Stack Trace• Jstat – view Garbage collection and other

statistics• JVisual VM• Mission Control

Page 16: Glass fish performance tuning tips from the field

Monitoring in JVisualVMInstall all the available Plugins

Page 17: Glass fish performance tuning tips from the field

Monitoring• Check Monitoring• get server.monitoring-service.module-monitoring-levels.*

• Switch Monitoring On• set server.monitoring-service.module-monitoring-

levels.jvm=HIGH

• Monitor• Monitor –type jvm

Page 18: Glass fish performance tuning tips from the field

Enable Monitoring

Page 19: Glass fish performance tuning tips from the field

Monitoring Data

Page 20: Glass fish performance tuning tips from the field

REST Interface

You can CURL commands if desperate!!!!!

Page 21: Glass fish performance tuning tips from the field

What to Change

Page 22: Glass fish performance tuning tips from the field

Setting JVM Parameters

Page 23: Glass fish performance tuning tips from the field

JVM Tuning options• -server : Out of the box GlassFish uses –client for the DAS• Set Max/Min Heap Sizes to be similar

• -Xmx2048m –Xms2048m• On JDK 7?

• Set Perm Gem Max and Min to be similar• -XX:PermSize=256m –XX:MaxPermSize=256m

• On Large Heaps• Use G1GC

• Log Garbage Collection• -verbose:gc• -Xloggc:/path_to_log/gc.log• -XX:+PrintGCDetails• -XX:+PrintGCDateStamps

• Heap Dump on Error• -XX:+HeapDumpOnOutOfMemoryError• -XX:HeapDumpPath=/opt/dumps/gf.hprof

Page 24: Glass fish performance tuning tips from the field

GlassFish Settings• Turn off Auto-deploy and dynamic application reloading in production

Page 25: Glass fish performance tuning tips from the field

Modify default-web.xml

• Turn off Development• Set genStrAsCharArray to true

${domain-home}/config/default-web.xml

Page 26: Glass fish performance tuning tips from the field

Low Level Grizzly Tuning

Page 27: Glass fish performance tuning tips from the field

HTTP Tuning

Page 28: Glass fish performance tuning tips from the field

HTTP Thread Pool

Can be set similar to HTTP workersFor example Apache Workers if proxied

Page 29: Glass fish performance tuning tips from the field

Tune HTTP Keep Alive

Protect from Malicious Attacks

Tune Keep Alive

Page 30: Glass fish performance tuning tips from the field

Reduce Logging

Page 31: Glass fish performance tuning tips from the field

Change Log Flush Frequency

Page 32: Glass fish performance tuning tips from the field

Ensure Security on JMX Connector

Page 33: Glass fish performance tuning tips from the field

Consider Setting a Transaction Timeout

Page 34: Glass fish performance tuning tips from the field

Datasource Connections

Max and Min the SameConsider HTTP Thread pool setting

Page 35: Glass fish performance tuning tips from the field

Datasources

Consider Timeouts and Statement Caching

Page 36: Glass fish performance tuning tips from the field

Datasources - Validation

Page 37: Glass fish performance tuning tips from the field

Tune Executor Service

Page 38: Glass fish performance tuning tips from the field

JCA Connector Settings (JMS)

Page 39: Glass fish performance tuning tips from the field

Questions