SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler offline
Look Inside Your Portal
Monitoring and Troubleshooting Techniques
for Java and Liferay Portal
Aleš Rybák
Portal Specialist / Consultant
IBA CZ, s. r. o.
organization
●

workshop

●

90 minutes
–
–

●

quick intro (with images copying meanwhile)
hands on

problems
–

solve them with assistant ASAP

–

if problems are still in place join somebody and work
together
prerequisites
●

your own HW

●

4GB+ RAM is optimal

●

virtual images
–

Oracle VirtualBox 4.2.18

–

CentOS 6.4 32-bit

–

Oracle Java 1.6

–

PostgreSQL database

–

Liferay Portal 6.1.2 CE

●

credentials
operating system
user: test
pass: test
liferay portal
user: test@liferay.com
pass: test
questions
targets
●

look onto / into Liferay Portal using different techniques
and from different angles

●

learn how to monitor it

●

learn how to solve some specific problems

●

learn how to optimize some performance aspects
Liferay Portal is standard J2EE application. It is
running on application server which is running in
JVM which is running as standard application in
operating system.
the “onion” model
the “onion” model – OS
●

process monitoring

●

system load

●

system resources
–

CPU

–

mem

–

HDD

–

network

–

...
the “onion” model – JVM
●

JMX

●

GC logs

●

memory dumps

●

stack

●

profiling

●

debugging

●

...
the “onion” model – application server
●

logs

●

interceptors

●

admin console

●

monitoring apps

●

specific tools
the “onion” model – liferay portal
●

administration console
–
–

admin tasks

–

properties

–
●

memory

scripting console

mbeans
–

ehcache

–

hibernate

–

liferay

–

…
hands on
liferay startup
●

cd liferay/bundles/tomcat

●

bin/startup.sh

●

tail -f logs/catalina.out
–

best in new terminal

●

available at http://localhost:8080

●

bin/shutdown.sh
operating system
●

desktop tools
–

good for local usage, not
for server monitoring

●

command-line tools
–

free, df, du

–

ps

–

conky

–

top (htop)

–

gkrell

–

lsof

–

…

–

iostat

–

vmstat

–

netstat

–

...
operating system – interesting commands
●

ps aux | grep tomcat

●

top (keys h, F/O)

●

htop

●

lsof -p $PID

●

iostat (optionally with -m)

●

vmstat -t 1

●

netstat -nlpt

●

netstat -nlpt | grep $PID
operating system - vmstat
●

Procs – r: Total number of processes waiting to run

●

Procs – b: Total number of busy processes

●

Memory – swpd: Used virtual memory

●

Memory – free: Free virtual memory

●

Memory – buff: Memory used as buffers

●

Memory – cache: Memory used as cache.

●

Swap – si: Memory swapped from disk (for every second)

●

Swap – so: Memory swapped to disk (for every second)

●

IO – bi: Blocks in. i.e blocks received from device (for every second)

●

IO – bo: Blocks out. i.e blocks sent to the device (for every second)

●

System – in: Interrupts per second

●

System – cs: Context switches

●

CPU – us, sy, id, wa, st: CPU user time, system time, idle time, wait time
java virtual machine
●

what to monitor

●

tools

–

processes

–

jps

–

memory

–

jstat

–

jinfo

–

jstack

●

–

garbage collecting

threads

●

profiling

–

jcmd

●

debugging

–

jconsole, jvisualvm

–

gcviewer

–

jmap, jhat, MAT
jvm tools – iteresting commands
●

jps -l

●

jps -v

●

jstat -gc $PID 2000

●

jinfo $PID

●

jmap -histo $PID

●

jstack $PID
JMX

http://en.wikipedia.org/wiki/File:Jmxarchitecture.png
jconsole
gcviewer
heap dump analysis – acquire dump

jmap -dump:live,format=b,file=heap.bin $PID
heap dump analysis – analyze dump
●

Eclipse Memory Analyzer Tool (MAT)
application server
●

logs

●

specific tools
–

apache tomcat
●
●

interceptors (JDBC, tribes, …)

●

●

valves

●

–

mbeans

conf/server.xml

…

monitoring apps
–

http://localhost:8080/monitoring
liferay portal (and other applications)
●

administration console

●

mbeans

–

memory

–

ehcache

–

admin tasks

–

hibernate

–

properties

–

liferay

–

scripting console

–

…

–

good for basic tasks and
for beginners :-)

●

ad-hoc tools
–

spring aspects

–

portlet filters
ehcache mbeans
●

portal property ehcache.statistics.enabled=true
hibernate mbeans
●

portal property hibernate.generate_statistics=true
liferay mbeans
●
●

●

enable liferay monitoring (see portal properties)
optionally install monitoring hook (done in the virtual
image)
performance info is visible
–

at the end of each page

–

via JMX beans
heap dump analysis - hands-on
●

http://localhost:8080/tm/

●

watch your heap, GC, system memory

●

obtain heap dump
–
–

●

jps -l
jmap -dump:live,format=b,file=heap.bin $PID

analyze heap dump
–

mat

–

File > Open Heap Dump..

–

Leak Suspects
links
●

iostat, vmstat, netstat...
–

www.lmgtfy.com/?q=vmstat+iostat+examples :-)

●

java tools – http://docs.oracle.com/javase/7/docs/technotes/tools/

●

MAT – www.eclipse.org/mat

●

gcviewer - www.tagtraum.com/gcviewer.html

●

liferay
–

portal props - www.liferay.com/community/wiki/-/wiki/Main/Portal+Properties

–

dev guide - www.liferay.com/documentation/liferay-portal/6.1/development
visit us
www.ibacz.eu
follow us
@IBACZ
the end

Mais conteúdo relacionado

Semelhante a look inside your (Liferay) portal

Why kernelspace sucks?
Why kernelspace sucks?Why kernelspace sucks?
Why kernelspace sucks?
OpenFest team
 
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
OpenBlend society
 
Buiding a better Userspace - The current and future state of QEMU and KVM int...
Buiding a better Userspace - The current and future state of QEMU and KVM int...Buiding a better Userspace - The current and future state of QEMU and KVM int...
Buiding a better Userspace - The current and future state of QEMU and KVM int...
aliguori
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
WSO2
 
OpenNebulaConf 2014 - Lightning talk: OpenNebula at Etnetera - Jan Horacek
OpenNebulaConf 2014 - Lightning talk: OpenNebula at Etnetera - Jan HoracekOpenNebulaConf 2014 - Lightning talk: OpenNebula at Etnetera - Jan Horacek
OpenNebulaConf 2014 - Lightning talk: OpenNebula at Etnetera - Jan Horacek
OpenNebula Project
 

Semelhante a look inside your (Liferay) portal (20)

How To Get The Most Out Of Your Hibernate, JBoss EAP 7 Application (Ståle Ped...
How To Get The Most Out Of Your Hibernate, JBoss EAP 7 Application (Ståle Ped...How To Get The Most Out Of Your Hibernate, JBoss EAP 7 Application (Ståle Ped...
How To Get The Most Out Of Your Hibernate, JBoss EAP 7 Application (Ståle Ped...
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?QEMU Disk IO Which performs Better: Native or threads?
QEMU Disk IO Which performs Better: Native or threads?
 
You suck at Memory Analysis
You suck at Memory AnalysisYou suck at Memory Analysis
You suck at Memory Analysis
 
Why kernelspace sucks?
Why kernelspace sucks?Why kernelspace sucks?
Why kernelspace sucks?
 
Emulating With JavaScript
Emulating With JavaScriptEmulating With JavaScript
Emulating With JavaScript
 
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
 
Windows internals Essentials
Windows internals EssentialsWindows internals Essentials
Windows internals Essentials
 
Linux Performance Tools 2014
Linux Performance Tools 2014Linux Performance Tools 2014
Linux Performance Tools 2014
 
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecksKernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
 
Buiding a better Userspace - The current and future state of QEMU and KVM int...
Buiding a better Userspace - The current and future state of QEMU and KVM int...Buiding a better Userspace - The current and future state of QEMU and KVM int...
Buiding a better Userspace - The current and future state of QEMU and KVM int...
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
 
Lec 3
Lec 3 Lec 3
Lec 3
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
OpenNebula Conf 2014 | Lightning talk: OpenNebula at Etnetera by Jan Horacek
OpenNebula Conf 2014 | Lightning talk: OpenNebula at Etnetera by Jan HoracekOpenNebula Conf 2014 | Lightning talk: OpenNebula at Etnetera by Jan Horacek
OpenNebula Conf 2014 | Lightning talk: OpenNebula at Etnetera by Jan Horacek
 
OpenNebulaConf 2014 - Lightning talk: OpenNebula at Etnetera - Jan Horacek
OpenNebulaConf 2014 - Lightning talk: OpenNebula at Etnetera - Jan HoracekOpenNebulaConf 2014 - Lightning talk: OpenNebula at Etnetera - Jan Horacek
OpenNebulaConf 2014 - Lightning talk: OpenNebula at Etnetera - Jan Horacek
 
Shall we play a game?
Shall we play a game?Shall we play a game?
Shall we play a game?
 
TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012
 
Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

look inside your (Liferay) portal

  • 1. Look Inside Your Portal Monitoring and Troubleshooting Techniques for Java and Liferay Portal Aleš Rybák Portal Specialist / Consultant IBA CZ, s. r. o.
  • 2. organization ● workshop ● 90 minutes – – ● quick intro (with images copying meanwhile) hands on problems – solve them with assistant ASAP – if problems are still in place join somebody and work together
  • 3. prerequisites ● your own HW ● 4GB+ RAM is optimal ● virtual images – Oracle VirtualBox 4.2.18 – CentOS 6.4 32-bit – Oracle Java 1.6 – PostgreSQL database – Liferay Portal 6.1.2 CE ● credentials operating system user: test pass: test liferay portal user: test@liferay.com pass: test
  • 5. targets ● look onto / into Liferay Portal using different techniques and from different angles ● learn how to monitor it ● learn how to solve some specific problems ● learn how to optimize some performance aspects
  • 6. Liferay Portal is standard J2EE application. It is running on application server which is running in JVM which is running as standard application in operating system.
  • 8. the “onion” model – OS ● process monitoring ● system load ● system resources – CPU – mem – HDD – network – ...
  • 9. the “onion” model – JVM ● JMX ● GC logs ● memory dumps ● stack ● profiling ● debugging ● ...
  • 10. the “onion” model – application server ● logs ● interceptors ● admin console ● monitoring apps ● specific tools
  • 11. the “onion” model – liferay portal ● administration console – – admin tasks – properties – ● memory scripting console mbeans – ehcache – hibernate – liferay – …
  • 13. liferay startup ● cd liferay/bundles/tomcat ● bin/startup.sh ● tail -f logs/catalina.out – best in new terminal ● available at http://localhost:8080 ● bin/shutdown.sh
  • 14. operating system ● desktop tools – good for local usage, not for server monitoring ● command-line tools – free, df, du – ps – conky – top (htop) – gkrell – lsof – … – iostat – vmstat – netstat – ...
  • 15. operating system – interesting commands ● ps aux | grep tomcat ● top (keys h, F/O) ● htop ● lsof -p $PID ● iostat (optionally with -m) ● vmstat -t 1 ● netstat -nlpt ● netstat -nlpt | grep $PID
  • 16. operating system - vmstat ● Procs – r: Total number of processes waiting to run ● Procs – b: Total number of busy processes ● Memory – swpd: Used virtual memory ● Memory – free: Free virtual memory ● Memory – buff: Memory used as buffers ● Memory – cache: Memory used as cache. ● Swap – si: Memory swapped from disk (for every second) ● Swap – so: Memory swapped to disk (for every second) ● IO – bi: Blocks in. i.e blocks received from device (for every second) ● IO – bo: Blocks out. i.e blocks sent to the device (for every second) ● System – in: Interrupts per second ● System – cs: Context switches ● CPU – us, sy, id, wa, st: CPU user time, system time, idle time, wait time
  • 17. java virtual machine ● what to monitor ● tools – processes – jps – memory – jstat – jinfo – jstack ● – garbage collecting threads ● profiling – jcmd ● debugging – jconsole, jvisualvm – gcviewer – jmap, jhat, MAT
  • 18. jvm tools – iteresting commands ● jps -l ● jps -v ● jstat -gc $PID 2000 ● jinfo $PID ● jmap -histo $PID ● jstack $PID
  • 22. heap dump analysis – acquire dump jmap -dump:live,format=b,file=heap.bin $PID
  • 23. heap dump analysis – analyze dump ● Eclipse Memory Analyzer Tool (MAT)
  • 24. application server ● logs ● specific tools – apache tomcat ● ● interceptors (JDBC, tribes, …) ● ● valves ● – mbeans conf/server.xml … monitoring apps – http://localhost:8080/monitoring
  • 25. liferay portal (and other applications) ● administration console ● mbeans – memory – ehcache – admin tasks – hibernate – properties – liferay – scripting console – … – good for basic tasks and for beginners :-) ● ad-hoc tools – spring aspects – portlet filters
  • 26. ehcache mbeans ● portal property ehcache.statistics.enabled=true
  • 27. hibernate mbeans ● portal property hibernate.generate_statistics=true
  • 28. liferay mbeans ● ● ● enable liferay monitoring (see portal properties) optionally install monitoring hook (done in the virtual image) performance info is visible – at the end of each page – via JMX beans
  • 29. heap dump analysis - hands-on ● http://localhost:8080/tm/ ● watch your heap, GC, system memory ● obtain heap dump – – ● jps -l jmap -dump:live,format=b,file=heap.bin $PID analyze heap dump – mat – File > Open Heap Dump.. – Leak Suspects
  • 30. links ● iostat, vmstat, netstat... – www.lmgtfy.com/?q=vmstat+iostat+examples :-) ● java tools – http://docs.oracle.com/javase/7/docs/technotes/tools/ ● MAT – www.eclipse.org/mat ● gcviewer - www.tagtraum.com/gcviewer.html ● liferay – portal props - www.liferay.com/community/wiki/-/wiki/Main/Portal+Properties – dev guide - www.liferay.com/documentation/liferay-portal/6.1/development