Profling Apache Cassandra With Async-Profiler

In this post I will show you how to use the async-profiler for Java to quickly get to the bottom of some production performance issues. We’ll look at an example using Apache Cassandra.

What is a flame graph?

A flame graph is a stack trace visualization invented by Brendan Gregg that makes it easy to visually identify where some activity occurs in software. Often that’s CPU time, but we can also use flame graphs to identify where allocations occur or when lock contention happens. This makes it an incredibly useful and powerful tool for performance analysis. Netflix makes no secret of the usefulness of flame graphs and at the end of this post we’ll briefly discuss another project, FlameScope.

EXAMPLE

Async Profiler

There are several options for profiling Java code that can generate flame graphs.

The async-profiler is a Ja

  • Sampling, meaning it doesn’t trace every call. This results in it having a negligible performance impact.
  • Does not suffer from safe point bias problem

Usage

Example

Compression

16KB vs 64KB

https://github.com/async-profiler/async-profiler

If you found this post helpful, please consider sharing to your network. I'm also available to help you be successful with your distributed systems! Please reach out if you're interested in working with me, and I'll be happy to schedule a free one-hour consultation.