RSSAmplifier

Blog

Daniel Mitterdorfer

Recent content on Daniel Mitterdorfer

daniel.mitterdorfer.nameRSS feed ↗20 posts

Latest posts

Largest-Triangle-Three-Buckets and the Fourier Transform

When visualizing time series with more data points than available on-screen pixels we waste system resources and network bandwidth without adding any value. Therefore, various algorithms are available to reduce the data volume. One such algorithm is Largest-Triangle-Three-Buckets (LTTB) described by Sveinn Steinarsson in his master’s thesis . The key idea of the algorithm is to preserve the…

Latency Analysis of Elasticsearch

I currently work on the backend of Elastic Universal Profiling , which is a fleet-wide continuous profiler. In our benchmarks we have observed higher than desired latency in a query that retrieves data for flamegraphs. As this is a key aspect of our product we wanted to better understand the root cause. CPU Profiling We started to gather CPU profiles with async-profiler in Wall-clock profiling…

Downsampling Profiles

I currently work on the backend of Elastic Univeral Profiling , which is a fleet-wide continuous profiler. At Elastic we live the concept of space-time , which means that we regularly get to experiment in a little bit similar vein to Google’s 20% time . Mostly recently, I’ve experimented with possibilities to either store less profiling data or query data in a way that allows us to…

Life as a remote worker: Organization

I work for more than two years at Elastic where I focus on benchmarking, performance analysis and performance tuning for Elasticsearch. In my daily work, I have to deal with many people: our users, various of our engineering teams, support, consulting, marketing, sales, product management and our developer relations team. As you might imagine, these are a lot of balls to juggle. Structuring Work…

Xprof, the forgotten HotSpot profiler

Did you know that every HotSpot-based JVM includes a profiler? You can activate it on the command line with -Xprof and it dumps its output to stdout. The information about it is pretty sparse, so I decided to write a short blog post about it. Getting Started Let&rsquo;s dive right in with an example: public class Fibonacci { private static long fib(long n) { if (n <= 0) { throw new…

Simplicity

I admit it: I use noscript , I block trackers like Google Analytics and all sorts of ads. If you browse the web this way, you see strange things: in the best case layouts are completely broken but in some cases pages even do not show up. And no, I am not talking about interactive pages like Google Maps. I am talking about pages that are content heavy. To me these people are just downright sloppy.

There goes my low latency: Analyzing hiccups with jHiccup, Elasticsearch and Kibana

Image by USMC Archives ; license: CC The other day I had to analyze search latency spikes in Elasticsearch for a customer. When latency spikes are involved, one of the first things I want to know is the &ldquo;noiseness&rdquo; of the host where the problem occurs. A great tool that helps with this analysis is Gil Tene&rsquo;s jHiccup . It records hiccups in the application and also in a control…

Hidden Gems in the JVM: jcmd

jcmd is one of those neat tools that only a few people seem to know about. It is a command line tool that is shipped with each Oracle JDK installation and provides basic information about a running Java process, which is practical for unobtrusively inspecting a running production instance. How to Use jcmd To use jcmd we need to specify the process id of a running Java process. When jcmd is invoked…

Handling InterruptedException Properly

Image by Juan Antonio Capó Alonso ; license: CC InterruptedException is among the most misunderstood exceptions in the JDK. How often did we come across exception handlers like this one: public void enqueue ( Object value ) { try { queue . put ( value ); } catch ( InterruptedException e ) { // ignore } } Or even: public void enqueue ( Object value ) { try { queue . put ( value ); } catch (…

Microbenchmarking in Java with JMH: Digging Deeper

This is the fifth and last post in a series about microbenchmarking on the JVM with the Java Microbenchmarking Harness (JMH) . part 1: Microbenchmarking in Java with JMH: An Introduction part 2: Microbenchmarks and their environment part 3: Common Flaws of Handwritten Benchmarks part 4: Hello JMH In the previous post, I have introduced JMH with a Hello World benchmark. Now, let&rsquo;s dig a bit…

Cheap Read-Write Lock Explained

I have recently stumbled across a nice idiom called the cheap read-write lock . It is intended for very frequent concurrent reads of a field where synchronization would lead to too much contention. I think that the idiom is a bit odd and begs for an explanation. Usage Scenario For the sake of demonstration consider the following situation: Our system has a globally available calendar that holds…

Microbenchmarking in Java with JMH: Hello JMH

This is the fourth post in a series about microbenchmarking on the JVM with the Java Microbenchmarking Harness (JMH) . part 1: Microbenchmarking in Java with JMH: An Introduction part 2: Microbenchmarks and their environment part 3: Common Flaws of Handwritten Benchmarks part 5: Digging Deeper In the previous post I have shown different problems that we might miss when writing microbenchmarks from…

Microbenchmarking in Java with JMH: Common Flaws of Handwritten Benchmarks

Image by Sarah ; license: CC This is the third post in a series about microbenchmarking on the JVM with the Java Microbenchmarking Harness (JMH) . part 1: Microbenchmarking in Java with JMH: An Introduction part 2: Microbenchmarks and their environment part 4: Hello JMH part 5: Digging Deeper In the previous post I have shown typical issues that have to be considered when executing…

Microbenchmarking in Java with JMH: Microbenchmarks and their environment

Image by Eduardo Diez Viñuela ; license: CC This is the second post in a series about microbenchmarking on the JVM with the Java Microbenchmarking Harness (JMH) . part 1: Microbenchmarking in Java with JMH: An Introduction part 3: Common Flaws of Handwritten Benchmarks part 4: Hello JMH part 5: Digging Deeper In the previous post I have introduced microbenchmarking. In this blog post we&rsquo;ll…

False Sharing

Normally, Java programmers are not too concerned about the hardware on which their beautiful software runs as long as provides loads of memory. Most of the time this is a good thing as software should solve a business problem rather than satisfying a machine. The JVM does a decent job hiding the underlying platform but as we know, abstractions are leaky. Sometimes we have to peek under hood,…

Microbenchmarking in Java with JMH: An Introduction

Image by Zach Dischner ; license: CC This is the first post in a series about microbenchmarking on the JVM with the Java Microbenchmarking Harness (JMH) . part 2: Microbenchmarks and their environment part 3: Common Flaws of Handwritten Benchmarks part 4: Hello JMH part 5: Digging Deeper In this post I&rsquo;ll introduce benchmarking conceptually and describe the specific flavor microbenchmarking.…

Using Perlock with Spring

Perlock - a simple Java path watching library I have written - is available in Maven Central since a few weeks now. I thought it would be nice to provide another demo application to show how it can be used with Spring. It is provided along with Perlock on Github in examples/perlock-spring-demo . Demo Scenario The demo application implements a XML file processing application. Clients put XML files…

Perlock - Path Watching without Headaches

Image by Sandra ; license: CC As I have written in my previous post the JDK 7 WatchService API is too low level to be used directly in an application. To my surprise, to this day no Java library has existed that abstracts the JDK 7 WatchService API and provides an easy high level API on top. A Simplified API: Perlock Therefore I created perlock (short for Path-Sherlock). It supports the standard…

Watching File Changes with the JDK 7 WatchService

Have you ever needed to watch the file system for changes in a Java application? Java 7 ships with the WatchService API that is suited exactly for this use case as you might know. My journey with the WatchService API began a few months ago when I stumbled across this code I have originally written a few years ago: //TODO: Update to JDK 7 and replace with native watcher FileSystemManager fsManager…

Hello World on (20)131211

What&rsquo;s this all about ? Well, let the pictures speak for themselves: Image , Image , Image by Geek&Poke ; license: CC