Look Inside Your Portal
Monitoring and Troubleshooting Techniques
for Java and Liferay Portal
Aleš Rybák
Portal Specialist...
organization
●

workshop

●

90 minutes
–
–

●

quick intro (with images copying meanwhile)
hands on

problems
–

solve th...
prerequisites
●

your own HW

●

4GB+ RAM is optimal

●

virtual images
–

Oracle VirtualBox 4.2.18

–

CentOS 6.4 32-bit
...
questions
targets
●

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

●

learn how to monitor i...
Liferay Portal is standard J2EE application. It is
running on application server which is running in
JVM which is running ...
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 conso...
hands on
liferay startup
●

cd liferay/bundles/tomcat

●

bin/startup.sh

●

tail -f logs/catalina.out
–

best in new terminal

●

...
operating system
●

desktop tools
–

good for local usage, not
for server monitoring

●

command-line tools
–

free, df, d...
operating system – interesting commands
●

ps aux | grep tomcat

●

top (keys h, F/O)

●

htop

●

lsof -p $PID

●

iostat...
operating system - vmstat
●

Procs – r: Total number of processes waiting to run

●

Procs – b: Total number of busy proce...
java virtual machine
●

what to monitor

●

tools

–

processes

–

jps

–

memory

–

jstat

–

jinfo

–

jstack

●

–

g...
jvm tools – iteresting commands
●

jps -l

●

jps -v

●

jstat -gc $PID 2000

●

jinfo $PID

●

jmap -histo $PID

●

jstac...
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

●

–

mb...
liferay portal (and other applications)
●

administration console

●

mbeans

–

memory

–

ehcache

–

admin tasks

–

hi...
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 v...
heap dump analysis - hands-on
●

http://localhost:8080/tm/

●

watch your heap, GC, system memory

●

obtain heap dump
–
–...
links
●

iostat, vmstat, netstat...
–

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

●

java tools – http://docs.oracle.co...
visit us
www.ibacz.eu
follow us
@IBACZ
the end
Upcoming SlideShare
Loading in …5
×

look inside your (Liferay) portal

1,788 views

Published on

Look inside the portal and applications running on it. Learn how to do monitoring on different levels, how to attach and use debugger and profiler with Liferay portal and portal applications. Check Garbage Collector activity, how to get heap dump and locate memory leaks, deadlocks and much more. All of these will be presented on free open-source tools.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,788
On SlideShare
0
From Embeds
0
Number of Embeds
117
Actions
Shares
0
Downloads
73
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

look inside your (Liferay) portal

  1. 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. 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. 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
  4. 4. questions
  5. 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. 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.
  7. 7. the “onion” model
  8. 8. the “onion” model – OS ● process monitoring ● system load ● system resources – CPU – mem – HDD – network – ...
  9. 9. the “onion” model – JVM ● JMX ● GC logs ● memory dumps ● stack ● profiling ● debugging ● ...
  10. 10. the “onion” model – application server ● logs ● interceptors ● admin console ● monitoring apps ● specific tools
  11. 11. the “onion” model – liferay portal ● administration console – – admin tasks – properties – ● memory scripting console mbeans – ehcache – hibernate – liferay – …
  12. 12. hands on
  13. 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. 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. 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. 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. 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. 18. jvm tools – iteresting commands ● jps -l ● jps -v ● jstat -gc $PID 2000 ● jinfo $PID ● jmap -histo $PID ● jstack $PID
  19. 19. JMX http://en.wikipedia.org/wiki/File:Jmxarchitecture.png
  20. 20. jconsole
  21. 21. gcviewer
  22. 22. heap dump analysis – acquire dump jmap -dump:live,format=b,file=heap.bin $PID
  23. 23. heap dump analysis – analyze dump ● Eclipse Memory Analyzer Tool (MAT)
  24. 24. application server ● logs ● specific tools – apache tomcat ● ● interceptors (JDBC, tribes, …) ● ● valves ● – mbeans conf/server.xml … monitoring apps – http://localhost:8080/monitoring
  25. 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. 26. ehcache mbeans ● portal property ehcache.statistics.enabled=true
  27. 27. hibernate mbeans ● portal property hibernate.generate_statistics=true
  28. 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. 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. 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
  31. 31. visit us www.ibacz.eu follow us @IBACZ
  32. 32. the end

×