Skip to main content

Posts

JVM container profiling from a container

In an earlier blog post, I talked about flame graphs and how I implemented those for a Scala app. Ever since I have been thinking if it would be possible to grab a flame graph from a container. Some time ago I made that happen inspired by this post.  It was not enough for me, I wanted to go deeper. I wanted also the profiler to run inside a container profiling another container. So I ended up making this It uses the JVM  async-profiler tool so not quite the same that in my previous blog post but the results are similar. To profile another container, you can use the one-liner and replace the $CONTAINER_ID with the id of the running JVM container you want to profile, $PERF_IMAGE as the built image id of the described container and  $JAVA_PID with the, you guessed it, the JVM pid inside the subject container. You also need to set a couple of runtime variables on the docker host as described in the async-profiler setup instructions. There are a couple of drawbacks....

MyReactNativeApp

The app is as typical a mobile app one could think of. The main feature is to show a customizable product catalog for a set of small business customers. From that catalog, they can filter out and order products for delivery. In other words, it is an online shop. The mobile app is made with React native with both IOS and Android releases. There is no native code specific to the app besides some third-party libraries which are used. The key libraries that are used in addition to react-native ones are firebase-react-native, redux and react-native-elements. Yet again, nothing special here. The first versions were developed and distributed via Expo. I found it very well suited for the first phases of development, running and debugging were straightforward. The customer did agree since trying out new versions was convenient especially for IOS users because alpha version distribution for that particular ecosystem is tedious, to say the least While developing the application I stumbled u...

Turn off a PC with Arduino and an IR remote

I have the bad habit of watching or listening something from my computer before I go to sleep while already lying in bed. Often when I am on the verge of falling asleep, it is frustrating to get up and turn off the computer. Usually, I put on a timed shutdown so that when I fall asleep, the computer won't wake me up in the middle of the night. However, I wanted to have some other way which does not involve getting up from bed nor having to light up any screen (like my phone) which would interfere with the process I thought about the problem from time to time and it was earlier this year when I bumped into an Instructables  post in which  somebody had made a remote controller for his PC with Arduino as a "keyboard". I thought I would do something similar to solve the shutting down problem because as it happened, I had a spare Arduino lying around After playing around with it for a while, I found out that in my Arduino Uno was lacking HID support so it was not going to ...

Vue and React experiences

Recently I have been doing a cross-platform mobile app with React native and also a web app frontend with Vue.js. As a reluctant java bull, building front-ends with something different than Java has been indeed something I have been looking for for a while. The React native mobile app is something I'm developing solo and is for a customer in importing tools for machine workshops business. It is a pretty straightforward shopping catalog-like app with a focus for customizable catalogs for each customer. I have found it to be pretty much perfect for a first project, the domain is simple and there are plenty of ready-made stuff and example applications where to look for inspiration On the project where Vue is being used, the old technology was Angular, versions 1 and 4. There was a decision to use Vue for the new front-end components and I was fortunate enough to be in the team making the first one and participate in building a template project that would be used by all new ...

OpenShift logging issues

I have been digging into some logging issues in an OpenShift production system. The first  problem what we noticed was that the pod logs viewed from the web console were clearly missing some lines. Initially, we thought that this was due to some rate limiting for the web console itself but it turned out to be an issue at the OS level. Another issue what we initially thought was related to the first one was that the Elasticsearch cluster which contains the aggregated logs from all nodes was missing some logs as well and we even had the Elasticsearch cluster members crashing a couple of times without being able to recover the cluster health. It turned out that we had two separate issues with similar symptoms First thing was to check why the web console was missing logs. Openshift (kubernetes) is logging the container logs to journald. After tailing the journald logs a while, it seemed fine. Upon closer inspection, I saw something strange though. It seems that the contai...

Elixir - first impressions

As any developer heading towards a burn-out, I spent my summer vacation learning a new programming language. I chose Elixir because it is a functional language with actor-like programming style. I thought that at least the latter feature would help me get started. Actually, the first thing I ended up figuring out was how the Erlang runtime works. I was interested in how the Erlang processes work in relation to the operating system. It turned out that the concurrency model is not based on spawning multiple user level threads but rather on Erlang runtime abstractions which isolate the running code to the Erlang processes which can communicate with each other via message passing. Erlang runtime has a scheduler which can run multiple processes concurrently on the runtime with a limited set of OS user level threads (number of available CPU threads). This is hardly surprising after reading about high performing applications written in Erlang. Threads can be expensive especially in the ca...