- Challenge:
- Managing application performance: keeping it in good condition
- Java: Garbage collection
- Too many collections has toll on performance
- Keeping track of performance
- CPU and memory consumption hotspots
- Setup Apache JMeter job to hit an endpoint a few thousand times while linking to a profiler
- Specs out memory and CPU requirements for production
- Visual VM
- Pros: we can track memory leaks
- running garbage collection and review memory consumption
- we can detect classes and processes that are holding on to memory in error
- running garbage collection and review memory consumption
- Cons: Requires direct connection to monitored JVM
- Limits usage to development environments in most cases
- there are profilers that work off thread and memory dumps in limited fashion
- Limits usage to development environments in most cases
- Popular tools:
- VisualVM
- JProfiler
- YourKit
- Java Mission Control
- Focus is on individual web requests or transactions
- Prefix: provides deep level performance details about app
- ORM calls with generated SQL
- SOAP/REST API calls
- trace details of most commonly used third-party libraries and frameworks
- XRebel: Uses Java Agent on web app's container
- An overlay on application that gives details about current request
- Prefix: Tool that gives very detailed traces of what code is doing
- Pros:
- Well formatted reporting of vast data given by JVM profiler
- Tracing what methods are responsible for response time
- Cons:
- Designed for development cycle only
- QA and Production environments will require APM solution
- APM - Application Performance Management
- Tools
- For tracking all requests on production system
- The tools provide right info in smart way so as not to impact production performance
- Done by aggregating timing statistics and sampling traces
- Gives method level visibility to your code running in production
- Pros:
- ability to monitor most critical environment
- Prod
- Identify issues before going to production in QA/Staging
- Debug production lives by analyzing traces and exceptions
- Summaries to see highly used requests to help focus dev time
- ability to monitor most critical environment
- Cons:
- Expensive to run on all servers (QA, Stage, Prod)
- Some tools do not support async queries (or not tuned properly and slow down app)
- Tools:
- New Relic
- Microsoft
- Stackify (free trial)
- AppDynamics
- Dynatrace
- ...
- Interactive experience may need good deal of dependencies (JS framework, CSS framework, web fonts, images)
- RUM - provides insight into application's dependencies by giving visibility to
- asset download
- page rendering time
- Google PageSpeed - standalone product
- JVM provides info such as
- Garbage collection
- Memory usage
- Thread count
- JMX can access the data
- Stackify Retrace:
- Provides JVM metric monitoring via
- App Monitors
- Applies smart defaults (based on type of application)
- Provides JVM metric monitoring via
- Pros:
- Available to apps running on JVM
- It can connect to apps such as JConsole
- Proxying requests through Apache or Nginx to Java app server can be monitored using access logs
- Tells how long requests are taking
- Access logs can be aggregated to see most
- popular endpoints
- fastest endpoints
- slowest endpoints
- Apache Viewer:
- for small data sets
- Hosted logging solution:
- For stage and production