Discover tips and tools that will help you to keep your Alfresco environment in shape. Most of the best tools are free or Open Source, and this presentation will guide you through the steps to improve the performance of your system.
4. Learn. Connect. Collaborate.
Caveat
Emptor
• Not covering:
– Performance techniques
– Architecture
– Development techniques
– (Okay, okay… we will cover a bit of it)
• Focus on Alfresco on-premise
– But it also applies Cloud deployments
6. Learn. Connect. Collaborate.
Slowness:
level 2
• Sometimes pages or searches take more than
30 seconds to load
• Searches are terrible slow
• Users start to click two or three times on links
• Some pages will just not load
18. Learn. Connect. Collaborate.
High Java
CPU usage
Find that hot thread!
• Support Tools
• Hot Threads
• jVisualvm or jConsole
• Application Performance Monitor (APM)
Gotcha Note!
– Docker/Kubernetes may not report CPU usage
correctly
19. Learn. Connect. Collaborate.
High Java
CPU usage
• Support Tools for the Admin Console
– Enterprise:
• 4.2 – 5.1: Support Tools AMP
(https://github.com/Alfresco/alfresco-
support-tools)
• 5.2+: Integrated
– Community:
• Order of the Bee
(https://community.alfresco.com/docs/DOC-
7941-order-of-the-bee-support-tools)
• Pros: integrated, easy to use, non-intrusive
• Cons: may require 5.2+ or AMP installation,
not persistent
20. Learn. Connect. Collaborate.
High Java
CPU usage
• Hot Threads
– Pros: some tools provide it, very light,
straightforward analysis, free, command line
(https://web.archive.org/web/20111225025057/h
ttp://weblogs.java.net/blog/brucechapman/archiv
e/2008/03/hot_threads.html), minimal
installation
– Cons: no UI, only instant snapshots
21. Learn. Connect. Collaborate.
High Java
CPU usage
• jVisualVM, included with JDK
– Pros: low/medium overhead, persistency for
hours or days, thread analysis, free
– Cons: connecting not always straightforward or
even possible, needs to set java options in
Alfresco start script
22. Learn. Connect. Collaborate.
High Java
CPU usage
• YourKit, jvisualvm on steroids, “Back to the
Future”
– Pros: database analysis, monitoring and
profiling, reviewing previous, best for random
crashes
– Cons: not free, requires installing agent, may be
heavy on CPU, complex configuration
23. Learn. Connect. Collaborate.
High Java
CPU usage
• Application Performance Monitor (APM)
– Pros: some Open Source, constant connection,
ideal for constant monitoring
– Cons: some commercial (not free), shop
carefully (capabilities vary widely)
27. Learn. Connect. Collaborate.
Low Java
CPU usage
• Low CPU usage (but Alfresco is slow!)
• The problem is related to I/O issues or other
systems:
– Database issues
– Storage issues (too slow, too full)
– Problematic repository (too many children in a
folder, lots of sites, lots of users or permissions)
– Remove services (e.g., Solr) are slow
29. Learn. Connect. Collaborate.
Memory
Problems
• Java
– Small heap size
– Garbage Collection (too much time, improper
algorithm)
– Small New/Eden space
• Operating System
– 35% to 25% should available
30. Learn. Connect. Collaborate.
Tools to
Diagnose
Memory
Problems
(Java)
• jstat – JDK utility
• Use -verbose:gc command line option
– Requires visualgc
• jconsole
• jvisualvm
• Support Tools
31. Learn. Connect. Collaborate.
Memory
Problems:
Pro Tips
• Java Heap Size
– < 75% OS Memory (Linux)
– < 60% Os Memory (Windows)
• Understand “free” OS memory in Linux
• Java:
– (Actually) Used <= Committed (allocated)
• Watch the Java Large Garbage Collections
• Try to use G1C for Java:
-XX:+UseG1GC
• G1C uses more Memory
32. Learn. Connect. Collaborate.
Low Java
CPU usage:
Diagnostic
Tools
• If DB, storage and repo are okay, let’s look for
stuck/slow threads
– Obtaining Thread dumps:
• jstack
• jconsole
• Support Tools
– Spotify (https://spotify.github.io/threaddump-
analyzer/) thread analyzer: most useful
• Pros: needs only one thread dump
• Cons: will not find stuck
– Thread Dump Analyzers: no silver bullet
• Multiple thread dumps needed at even
intervals
36. Learn. Connect. Collaborate.
Conclusions
• Most of the times the tools to troubleshoot
performance problems are free, but
commercial tools may be necessary.
• Be ready to collect information in a crisis.
• It’s a good idea to use APM tools to monitor
24x7 to prevent crashes and performance
degradation.
• Keep your mind open.