glass fish performance tuning tips from the field
TRANSCRIPT
![Page 1: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/1.jpg)
GlassFish Performance Tuning: Tips from the FieldSteve Millidge : Founder Payara
![Page 2: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/2.jpg)
First Day at Work
![Page 3: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/3.jpg)
It’s All Gone to *#*@!
![Page 4: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/4.jpg)
![Page 5: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/5.jpg)
![Page 6: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/6.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/7.jpg)
What are we looking for?
![Page 8: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/9.jpg)
Tuning ProcessMeasure
Analyse
HypothesisChange
Test
![Page 10: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/10.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/11.jpg)
Hypothesis• Use EVIDENCE from
tools• Create a causal
hypothesis• Determine fix that will
mitigate
![Page 12: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/12.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/13.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/14.jpg)
How do we Measure GlassFish?
![Page 15: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/15.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/16.jpg)
Monitoring in JVisualVMInstall all the available Plugins
![Page 17: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/17.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/18.jpg)
Enable Monitoring
![Page 19: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/19.jpg)
Monitoring Data
![Page 20: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/20.jpg)
REST Interface
You can CURL commands if desperate!!!!!
![Page 21: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/21.jpg)
What to Change
![Page 22: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/22.jpg)
Setting JVM Parameters
![Page 23: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/23.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/24.jpg)
GlassFish Settings• Turn off Auto-deploy and dynamic application reloading in production
![Page 25: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/25.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/26.jpg)
Low Level Grizzly Tuning
![Page 27: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/27.jpg)
HTTP Tuning
![Page 28: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/28.jpg)
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](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/29.jpg)
Tune HTTP Keep Alive
Protect from Malicious Attacks
Tune Keep Alive
![Page 30: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/30.jpg)
Reduce Logging
![Page 31: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/31.jpg)
Change Log Flush Frequency
![Page 32: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/32.jpg)
Ensure Security on JMX Connector
![Page 33: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/33.jpg)
Consider Setting a Transaction Timeout
![Page 34: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/34.jpg)
Datasource Connections
Max and Min the SameConsider HTTP Thread pool setting
![Page 35: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/35.jpg)
Datasources
Consider Timeouts and Statement Caching
![Page 36: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/36.jpg)
Datasources - Validation
![Page 37: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/37.jpg)
Tune Executor Service
![Page 38: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/38.jpg)
JCA Connector Settings (JMS)
![Page 39: Glass fish performance tuning tips from the field](https://reader035.vdocuments.net/reader035/viewer/2022062522/5882be251a28abb2478b5577/html5/thumbnails/39.jpg)
Questions