<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Christopher Kujawa on Medium]]></title>
        <description><![CDATA[Stories by Christopher Kujawa on Medium]]></description>
        <link>https://medium.com/@zelldon91?source=rss-4b944b52b800------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NAQqaitOsuuW7zphtdSy7g.jpeg</url>
            <title>Stories by Christopher Kujawa on Medium</title>
            <link>https://medium.com/@zelldon91?source=rss-4b944b52b800------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:20:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zelldon91/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Extracting JVM Data from Crash-Looping Java Containers in Kubernetes]]></title>
            <link>https://medium.com/@zelldon91/getting-data-out-of-burning-java-containers-6e0c8bb53eec?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e0c8bb53eec</guid>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[debugging]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 06:20:31 GMT</pubDate>
            <atom:updated>2026-01-14T15:11:50.151Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9PI5ypKrAVDrWqFQJQhH9w.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@gwendbary?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Gwendal Bar</a> on <a href="https://unsplash.com/photos/man-riding-on-motorcycle-with-smoke-coming-from-it-1cmUs5eXOtg?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>Imagine you get an alert, page, or any other notification that there is a Java deployment crash looping on production, and you have to investigate and root-cause the issue. It is not as easy as it seems, because you need some data from a burning house. You will need to find a way to get it stable enough to get the necessary information out of it. I have seen this several times over the years working in Support, Incident response, OnCall, etc.</p><p>As I was not able to find similar resources covering the whole process, I felt it might be worth creating a more extensive blog and sharing it with a wider audience. I hope someone finds this helpful.</p><p>In today’s blog post, I want to share some lessons learned from real-life incidents on how to retrieve the actual data, like Java heap dumps or Java flight recording, of crash-looping Java applications deployed in Kubernetes. This means this post is solely focusing on JVM-specific applications and tools. These techniques may also be adaptable to .NET/NodeJS applications, but commands and tools will differ.</p><p>To retrieve such, you must take several measures. As always, it depends heavily on the context and setup, but this might give you a good starting point.</p><p>After reading this blog post, you should be able to retrieve a JFR or heap dump for further root cause analysis.</p><p>The problem space is the following:</p><ul><li>There is a <a href="https://kubernetes.io/docs/concepts/workloads/pods/">pod</a> container, deployed in Kubernetes, crash looping.</li><li>The pod has no persistence configured, most likely because it is part of a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Deployment</a></li><li>This pod contains a Java application.</li><li>This Java application fails because it goes out of memory (OOM). <strong>Terminating due to java.lang.OutOfMemoryError: Java heap space</strong></li></ul><blockquote><strong>Pre-requisites (important note):</strong></blockquote><blockquote><em>All of the following must be executed at your own risk and require certain precautions and privileges. In the examples, deployments will be modified. If in doubt, ask your DevOps, SRE, or other Software Engineer who is familiar with this topic.</em></blockquote><p>In the following examples, make sure to replace:</p><ul><li><strong>&lt;DEPLOYMENT_NAME&gt;</strong> with the name of the deployment containing the pod in which the Java application is running</li><li><strong>&lt;POD_NAME&gt;</strong> with the name of the pod containing the Java Application</li><li><strong>&lt;CONTAINER_NAME&gt;</strong> with the name of the container of the Java application</li><li><strong>&lt;MEM_VALUE&gt;</strong> with something useful for your application</li><li><strong>&lt;PID&gt;</strong> with the Java application process ID inside the container</li><li><strong>&lt;CONTAINER_PATH&gt;</strong> where the resulting file should be stored temporarily at the container storage</li><li><strong>&lt;PATH_TO_MOUNT&gt;</strong> where the volume should be mounted in the container</li></ul><h3>Get a running pod with more memory</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQoU5nv9GvbmTAhZHuJ6LQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@villxsmil?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Luis Villasmil</a> on <a href="https://unsplash.com/photos/orange-band-aid-on-concrete-surface-crack-jPpHpgWNCKs?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>The following is just a band-aid; it will not resolve the problem in your application. It will mostly defer it to a later date.</p><p>It might also not be applicable, as you can’t increase memory because of cost or other reasons.</p><p>The simplest band-aid would be to increase the resources. You probably already did this, but just to be sure, I’m mentioning it here.</p><pre>$ kubectl set resources deployment &lt;DEPLOYMENT_NAME&gt;  \<br>  --limits=memory=&lt;VALUE&gt;Gi --requests=memory=&lt;VALUE&gt;Gi</pre><p>If this works and the crash looping has been resolved already, it might have been just a spike, or you deferred it to a later point in time.</p><h3>Get data from the running pod</h3><p>You can use the time the pod is running fine to create a Heap dump (with <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr014.html">jmap</a>) manually or a Java flight recording (with <a href="https://docs.oracle.com/javacomponents/jmc-5-4/jfr-runtime-guide/about.htm">jfr</a>) and investigate this. Under the assumption that the pod is not crashing in the next 1–5 minutes, check the following sections if it does.</p><blockquote>This assumes that your container has the right tools available. You can check the next section about using a debug container if it doesn’t.</blockquote><p><strong>Example to create a Heap Dump:</strong></p><pre>$ kubectl exec -it &lt;POD_NAME&gt; \<br>  -- jmap -dump:live,format=b,file=&lt;CONTAINER_PATH&gt;/dump.hprof &lt;PID&gt;</pre><p><strong>Example to execute a Java flight recording:</strong></p><pre>$ kubectl exec -it &lt;POD_NAME&gt; \<br>-- jcmd &lt;PID&gt; JFR.start duration=600s filename=&lt;CONTAINER_PATH&gt;/flight-$(date +%d%m%y-%H%M).jfr  </pre><p>After this, we can download the respective files:</p><pre>$ kubectl cp &lt;POD_NAME&gt;:&lt;CONTAINER_PATH&gt;/flight.jfr /tmp/flight.jfr</pre><p><em>You can now start your investigation. If not applicable, check the next section.</em></p><h3>Get data from the running pod via a debug container</h3><blockquote>Running ephemeral containers might be blocked by certain <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/">RBAC policies</a></blockquote><p>Containers often lack the right tools installed because of security concerns. One option is to create an <a href="https://kubernetes.io/docs/concepts/workloads/pods/ephemeral-containers/">ephemeral container</a>, which I like to refer to as a <a href="https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/">debug container</a>. These containers allow us to use the right tools for a better root-cause analysis.</p><pre>$ kubectl debug \ # add an ephemeral container to the pod<br>  -it \ # Run in interactive mode<br>  -c debugger \ # Name of the debug container<br>  --profile=restricted # Restricted policy is aimed at enforcing current Pod hardening best practices<br>  # Sysadmin profile might be necessary to get access to the other processes - if not visible<br>  # --profile=sysadmin<br>  --image=eclipse-temurin:21.0.3_9-jdk-alpine \ # The image to use<br>  --target=&lt;CONTAINER_NAME&gt; \ # The target container<br> # If your container is running with runAsNonRoot=true you might need to set the following:<br> # -custom=&lt;(echo &#39;{&quot;securityContext&quot;:{&quot;runAsNonRoot&quot;:false,&quot;runAsUser&quot;:0}}&#39;)<br>  &lt;POD_NAME&gt; \ # The target pod<br>  -- sh # The command to execute inside the debug container<br><br># Inside the debug container<br>~ $ jps # Here all jdk tools are available<br>&lt;PID&gt; YOUR_APPLICATION # Output from JPS</pre><p>For more details on existing profiles for debug containers, refer to <a href="https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/#static-profile">this section</a>. Regarding the runAsNonRoot feature, please refer to this GitHub <a href="https://github.com/nicolaka/netshoot/issues/163">issue</a>.</p><p>With this debug container set up, we should now be able to run jcmd to get a Java flight recording:</p><pre>$ jcmd &lt;PID&gt; JFR.start duration=100s filename=flight.jfr<br>&lt;PID&gt;:<br>Started recording 1. The result will be written to:<br><br>&lt;CONTAINER_PATH&gt;/flight.jfr</pre><p>If you see issues like:</p><pre>com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file /proc/1/root/tmp/.java_pid1: target process 1 doesn&#39;t respond within 10500ms or HotSpot VM not loaded</pre><p>It may be related to the fact that the JVM attached listener is not running; you can enable it by using the <strong><em>-XX:+StartAttachListener </em></strong>option. To set this configuration on your deployment, you could pass it as part of the <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html"><strong>JAVA_TOOL_OPTIONS</strong></a> environment variable. With this, you should be able to run the <strong>jcmd</strong> command from above.</p><p>After this, we can download the recording from the actual container:</p><pre>$ kubectl exec -it &lt;POD_NAME&gt; -- ls -la flight.jfr<br>-rw-r--r--    1 xxx  xxx    1452909 Jun 28 11:32 flight.jfr<br>$ kubectl cp &lt;POD_NAME&gt;:&lt;CONTAINER_PATH&gt;/flight.jfr /tmp/flight.jfr</pre><p><em>You can now start your investigation. If not applicable, check the next section.</em></p><h3>Still crash looping pod</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qmEuj2K7A-evDbdfS-I4SQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@_aditya_10?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Aditya mishra</a> on <a href="https://unsplash.com/photos/fire-in-fire-pit-during-nighttime--zigZUEuPbc?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>It can still happen that the application continuously crashes in a loop, either because you could not increase the resources or because there were not enough.</p><p>What we have to do to get the necessary data for our actual root-cause analysis is the following:</p><ol><li>Dump a heap dump on an out-of-memory error</li><li>Add some sort of persistence to your deployment</li><li>Get access to the data by preventing the container from crashing in a loop</li></ol><p>We have a crash-looping container, so we can’t easily access the data like a JVM heap dump. To access it, we need to cache it somehow.</p><p>An essential property of Kubernetes is that a crashing container doesn’t cause the pod to restart. We can store the necessary data, like heap dumps, in ephemeral volumes. The ephemeral volume is lost only when the pod restarts, as <a href="https://kubernetes.io/docs/concepts/storage/volumes/#how-volumes-work">it is bound to the pod’s lifetime.</a></p><blockquote><em>Important note: In the following, we make manual changes to deployments and apply the manifest, assuming you have the right permissions. Depending on the environment, it might be more appropriate to use established pipelines or tools, like GitOps, Terraform, etc.</em></blockquote><h3>Add an emptyDir</h3><p>We can attach volumes to multiple containers in the same pod. To avoid creating unnecessary, persistent volumes and claims, we can use an <a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir">emptyDir</a>.</p><blockquote>All containers in the Pod can read and write the same files in the emptyDir volume, though that volume can be mounted at the same or different paths in each container.</blockquote><blockquote><a href="https://kubernetes.io/docs/concepts/storage/volumes/#emptydir">https://kubernetes.io/docs/concepts/storage/volumes/#emptydir</a></blockquote><p>To do this, we can reconfigure our existing deployment to add an emptyDir volume and mount it on our existing container.</p><pre>$ kubectl edit deployment &lt;DEPLOYMENT_NAME&gt;</pre><pre># In editor:<br>      # At existing container add new volume mount<br>        volumeMounts:<br>        - mountPath: /usr/local/camunda/data<br>          name: data-volume    <br><br>      # Create a new emptyDir volume used by both containers<br>      volumes:<br>      - name: data-volume<br>        emptyDir:<br>          sizeLimit: 2Gi</pre><h3>Add persistence to your deployment</h3><p><em>As an alternative to the emptyDir approach from above (likely the more straightforward approach), we could add some real persistent volume, which will even survive pod restarts.</em></p><p>One option is to <a href="https://medium.com/@muppedaanvesh/a-hand-on-guide-to-kubernetes-volumes-%EF%B8%8F-b59d4d4e347f">create a persistent volume claim</a>:</p><pre>apiVersion: v1<br>kind: PersistentVolumeClaim<br>metadata:<br>  name: persistence-claim<br>spec:<br>  accessModes:<br>    - ReadWriteOnce<br>  resources:<br>    requests:<br>      storage: 5Gi # Depends on your max heap size, change it accordingly<br>  volumeMode: Filesystem</pre><p>Save this in a <strong>pvc.yaml</strong> and apply it in your Kubernetes namespace:</p><pre>$ kubectl apply -f pvc.yaml <br>persistentvolumeclaim/static-claim created</pre><p>Now we have to reconfigure our existing deployment.</p><pre>$ kubectl edit deployment &lt;DEPLOYMENT_NAME&gt;</pre><pre># In editor:<br># spec.template.spec.<br>#<br>      containers:<br>      - # ...<br>        volumeMounts:<br>        # - ... other mounts, like for configs<br>        - mountPath: &lt;PATH_TO_MOUNT&gt;<br>          name: data-volume<br>        # ....  <br>      volumes:<br>      # - configMap: ....<br>      - name: data-volume<br>        persistentVolumeClaim:<br>          claimName: persistence-claim </pre><p>In short, the volume declares the persistence volume claim to use, and the volume mount says where to mount it. You can read more details <a href="https://kubernetes.io/docs/concepts/storage/volumes/#how-volumes-work">here</a>.</p><h3>Dump heap on Out-Of-Memory</h3><p>After we have the persistence configured in either way, we need to ensure that our Java application is dumping some heap dumps.</p><p>There is a neat <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/clopts001.html">JVM command line option</a> to dump the heap when the JVM experiences an Out-Of-Memory error: <strong>-XX:+HeapDumpOnOutOfMemoryError</strong>.</p><p>Additionally, we need <strong>-XX:HeapDumpPath=&lt;PATH_TO_MOUNT&gt;</strong>. Make sure to set these options as part of the Java application start configuration, for example, as <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html">JAVA_TOOL_OPTIONS</a></p><p><strong>Example:</strong></p><pre>$ kubectl edit deployment &lt;DEPLOYMENT_NAME&gt;</pre><pre># In editor:<br># spec.template.spec.<br>#<br>      containers:<br>      - env:<br>        - name: JAVA_TOOL_OPTIONS<br>          value: -XX:+ExitOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=&lt;PATH_TO_MOUNT&gt;</pre><h3>Make sure to prevent the container from crashing loop</h3><p>Now we have persistence and are dumping the heap when running into OOM, but we cannot copy it from the container, as it is constantly restarting.</p><p>We now have different ways to solve this. One option is to set up an extra container or an init container to prevent or delay the start-up after failure. Another would be to override the container <strong>ENTRYPOINT</strong> or <strong>CMD</strong>.</p><h3>Adding an extra container</h3><p>It is interesting to note that <a href="https://kubernetes.io/docs/concepts/workloads/pods/">one Kubernetes pod</a> can have multiple containers attached to it. When one of the containers restarts, it will <strong>not</strong> affect the other containers. Furthermore, we can attach volumes to various containers in the same pod. An extra container allows manual file extraction.</p><p>We can reconfigure our existing deployment by adding a separate container to the pod to access the data while the other container is crashing.</p><p>Here, we need to make sure that we pull an available image (like busybox) and have, for example, sleep available. Furthermore, we need to mount the same volume to access the heap dump later.</p><pre>$ kubectl edit deployment &lt;DEPLOYMENT_NAME&gt;</pre><pre># In editor:<br><br>      # Add a new container to the pod<br>      - command: # Run in endless loop - so we can access the data<br>        - sh<br>        - -c<br>        - while [ true ]; do echo &quot;Sleep for 1s&quot;; sleep 1; done;<br>        image: busybox:1.37.0<br>        imagePullPolicy: IfNotPresent<br>        name: extra-container<br>        resources: {}<br>        securityContext: # This depends on the security policies you might have<br>          allowPrivilegeEscalation: false<br>          capabilities:<br>            drop:<br>            - ALL<br>        terminationMessagePath: /dev/termination-log<br>        terminationMessagePolicy: File<br>        volumeMounts:<br>        - mountPath: &lt;PATH_TO_MOUNT&gt;<br>          name: data-volume    </pre><p>After changing the deployment, it will restart the Java container, but the new container will run forever. The extra container is running in a loop, printing Sleep for 1s. You can check this via:</p><pre>$ kubectl logs &lt;POD_NAME&gt; -c extra-container<br>Sleep for 1s<br>Sleep for 1s<br>Sleep for 1s<br>Sleep for 1s<br>Sleep for 1s<br>Sleep for 1s</pre><p>Furthermore, when checking the pod details, you might see something like <strong>1/2 CrashLoopBackOff</strong> on your pod. This is our chance to get the actual heap dump.</p><p>For example, copy the heap dump from the extra container to your local file system.</p><pre>$ kubectl  cp -c extra-container \<br>  &lt;POD_NAME&gt;:&lt;PATH_TO_MOUNT&gt;/java_pid&lt;PID&gt;.hprof /tmp/heap.dump</pre><h4>Override Container CMD</h4><p>Alternatively, we can override the actual container command (which is executed on start) by adding the following to the deployment (but here we need to make sure that it is restarted at least once to dump the actual heap before doing this).</p><pre>$ kubectl edit deployment &lt;DEPLOYMENT_NAME&gt;</pre><pre># In editor:<br># spec.template.spec.<br>#<br>      containers:<br>      - command:<br>        - sh<br>        - -c<br>        - while [ true ]; do echo &quot;Sleep for 1s&quot;; sleep 1; done;</pre><p>This will run the container in a loop, printing <strong>Sleep for 1s</strong>. You can check this via:</p><pre>$ kubectl logs &lt;POD_NAME&gt;<br>Sleep for 1s<br>Sleep for 1s<br>Sleep for 1s<br>Sleep for 1s<br>Sleep for 1s<br>Sleep for 1s</pre><p>Now it is time to get the heap dump. For example, via:</p><pre>$ kubectl cp &lt;POD_NAME&gt;:&lt;PATH_TO_MOUNT&gt;/java_pid&lt;PID&gt;.hprof /tmp/heap.dump</pre><h4>Adding an init container</h4><p>In addition to the above, there exists the option to use an<a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/"> init container</a>. This is similar to the extra container approach, except that it runs before our actual Java container.</p><pre>$ kubectl edit deployment &lt;DEPLOYMENT_NAME&gt;</pre><pre># In editor:<br># spec.template.spec.<br>#<br>      initContainers:<br>      - command:<br>        - sh<br>        - -c<br>        - sleep 100<br>        image: busybox:1.37.0<br>        imagePullPolicy: IfNotPresent<br>        name: init-myservice<br>        resources: {}<br>        securityContext: # This depends on the security policies you might have<br>          allowPrivilegeEscalation: false<br>          capabilities:<br>            drop:<br>            - ALL<br>        terminationMessagePath: /dev/termination-log<br>        terminationMessagePolicy: File<br>        volumeMounts:<br>        - mountPath: &lt;PATH_TO_MOUNT&gt;<br>          name: data-volume<br></pre><p>When changing the deployment, it will stop restarting and stay in the init phase. This is our chance to get the actual heap dump.</p><pre>$ kubectl cp &lt;POD_NAME&gt;:&lt;PATH_TO_MOUNT&gt;/java_pid&lt;PID&gt;.hprof \<br>  /tmp/heap.dump -c init-myservice<br>tar: removing leading &#39;/&#39; from member names<br></pre><blockquote><em>Ensure you bring everything back in place after you have the necessary data.</em></blockquote><p>For example, via</p><pre>$ kubectl rollout undo deployment/&lt;DEPLOYMENT_NAME&gt;</pre><h3>Actual root cause analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBWu_D6zQRNNq9S9F5lXtg.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@markuswinkler?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Markus Winkler</a> on <a href="https://unsplash.com/photos/green-and-white-typewriter-on-blue-textile-cS2eQHB7wE4?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>This blog guided you through retrieving data from a crash-looping pod, such as a heap dump or Java flight recording. Now, the actual root cause analysis starts!</p><p>Here are some resources to help you with this:</p><ul><li><a href="https://docs.oracle.com/javase/8/docs/technotes/guides/visualvm/heapdump.html">Investigate the Heap dump with Java VisualVM</a></li><li><a href="https://www.oracle.com/java/technologies/jdk-mission-control.html">Investigate JFR with JMC</a> — you can also investigate your heap dumps with JMC</li></ul><p><em>I hope this was helpful to someone. Please feel free to share your incident recovery experiences or troubleshooting tips in the comments! If you liked the post, leave a clap. Thank you.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e0c8bb53eec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Exporter to Rule Them All]]></title>
            <link>https://medium.com/@zelldon91/one-exporter-to-rule-them-all-c8b12016ffd7?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8b12016ffd7</guid>
            <category><![CDATA[software-design]]></category>
            <category><![CDATA[camunda]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[scaling]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Mon, 17 Feb 2025 12:55:32 GMT</pubDate>
            <atom:updated>2025-02-17T12:55:32.158Z</atom:updated>
            <content:encoded><![CDATA[<h3>One Exporter to Rule Them All: Exploring Camunda Exporter</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*nswJE1HRpSabgZwPs0YPXw.png" /><figcaption>One exporter to rule them all (Image by <a href="https://camunda.com/">Camunda</a>)</figcaption></figure><p>When using Camunda 8, you might encounter the concept of an exporter. An exporter is used to push out historic data, generated by our processing engine, to a secondary storage.</p><p>Our web applications have historically used i<a href="https://docs.camunda.io/docs/next/self-managed/tasklist-deployment/importer-and-archiver/">mporters and archivers</a> to consume, aggregate, and archive historical data provided by our <a href="https://docs.camunda.io/docs/next/self-managed/zeebe-deployment/exporters/elasticsearch-exporter/">Elasticsearch</a> (ES) or <a href="https://docs.camunda.io/docs/next/self-managed/zeebe-deployment/exporters/opensearch-exporter/">OpenSearch</a> (OS) Exporter.</p><p>In the past year, we’ve engineered a new <a href="https://docs.camunda.io/docs/next/self-managed/zeebe-deployment/exporters/camunda-exporter/">Camunda Exporter</a>, which brings the importer and archiving logic of web components (<a href="https://camunda.com/platform/tasklist/">Tasklist</a> and <a href="https://camunda.com/platform/operate/">Operate</a>) closer to our distributed platform (<a href="https://docs.camunda.io/docs/next/components/zeebe/zeebe-overview/">Zeebe</a>). This allows us to simplify our installation, enable scalability for web apps, reduce the latency to show runtime and historical data, and reduce data duplication (resource consumption).</p><p>In this blog post, we want to share more details about this project and the related architecture changes.</p><h3>Challenges with the current architecture</h3><p>Before we introduce the Camunda Exporter, we want to go into more detail about the challenges with the current Camunda 8 architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MDSkvxxqF0LPCuGV" /><figcaption><em>A simplified view of the architecture of Camunda 8.7, highlighting 6 process steps</em></figcaption></figure><p>When a user sends a command to the <a href="https://docs.camunda.io/docs/next/components/zeebe/technical-concepts/clustering/">Zeebe cluster</a> (1), it is acknowledged (2) and processed by the Zeebe engine. The engine will confirm the processing with an event.</p><p>The engine has its own <em>primary data store</em> for runtime data. The primary data store is optimized for low-latency local access. It contains the execution state that allows the engine to execute process instances and move its data along in their corresponding processes.</p><p>Our users need a way to search and visualize process data (running and historical data), so Camunda 8 makes use of Elasticsearch or OpenSearch (RDBMS in the future) as secondary storage. It allows the separation of concerns between runtime data for process execution and history data for querying.</p><p>Camunda’s exporters are a bridge between primary and secondary data stores. The exporters allow the Zeebe system to stream out data (events) (3). Within the Camunda 8 architecture, we support both the ES and OS exporters. For more information about this concept and supported exporters, please visit our <a href="https://docs.camunda.io/docs/self-managed/concepts/exporters/">documentation</a>.</p><p>The exported data is stored in what we unofficially refer to as <em>Zeebe indices</em> inside ES or OS. Web applications like <a href="https://docs.camunda.io/docs/next/components/tasklist/introduction-to-tasklist/">Tasklist</a> and <a href="https://docs.camunda.io/docs/next/components/operate/operate-introduction/">Operate</a> make use of <a href="https://docs.camunda.io/docs/next/self-managed/tasklist-deployment/importer-and-archiver/">importers and archivers</a> to read data from Zeebe indices (4), aggregate, and write them back into their indices (5). Based on these indices, users can query and search process data (6).</p><h3>Performance</h3><p>Customers have reported performance issues, which are inherited with this architecture. For example, the delay of data shown in Operate can range from around five seconds to, in the worst scenarios, minutes or hours.</p><p>The time is spent in processing, exporting, flushing, importing, and flushing again, before the users see any data change. For more detailed information, you can also take a look at <a href="https://camunda.github.io/zeebe-chaos/2024/12/12/News-from-Camunda-Exporter-project#latency">this blog post</a>.</p><p>This means the user is never able to follow a process instance in real time. But there is a general expectation that it is at least close to real time, meaning that it should at max take 1–2 seconds to show updates.</p><p>Reducing such latency and improving the general throughput needs a general architecture change.</p><h3>Scalability</h3><p>What we can see in our architecture above is that when we scale Zeebe clusters and partitions or set them up for large workloads, the web applications do not scale automatically with it, as they are not directly coupled.</p><p>This means additional effort to make sure the web applications can handle certain loads. The current architecture limits the general scalability of the web applications, due to the decoupling of exporter-importer and no real partitioning of data in the secondary storage.</p><p>We want to make the web application more scalable to handle changing processing workloads.</p><h3>Installation complexity</h3><p>You can run the different components of the Camunda platform separately, e.g. separate deployments for Zeebe, Tasklist, Operate, etc. This gives you a lot of flexibility and allows for massive scale. But at the same time, this makes the installation harder to do — even with the help of Helm charts.</p><p>We want to support a simpler installation as an alternative. That wasn’t possible in this architecture because of a missing single application and the need for separate components.</p><h3>Data duplication and resource consumption</h3><p>Web applications like Operate and Tasklist have historically been grown and developed separately. As we have seen, they could have been deployed separately as well.</p><p>This was also why they had separate schemas. Tasklist used a subset of Operate schema but added additional necessary indices to store information about user tasks, etc. When deploying both applications, this caused an unnecessary duplication of data in ES or OS.</p><p>As a consequence of this, we are consuming more disk space than necessary. Furthermore, ES/OS has a higher load on indexing new data than should be necessary.</p><p>We want to reduce this to minimize the memory and disk footprint needed to run Camunda.</p><h3>One exporter to rule them all</h3><p>Understanding those challenges, we rearchitected our platform to get rid of the aforementioned challenges. In the new architecture, we have built a Camunda exporter to replace the exporter/importer from the old architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BPLVZUfRTTdF6XVO" /><figcaption><em>A simplified view of the new streamlined architecture</em></figcaption></figure><p>The Camunda Exporter brings the importer and archiving logic of web components (Tasklist and Operate) closer to the distributed platform (Zeebe).</p><p>The exporter consumes Zeebe records, aggregates data, and stores the related data into shared and harmonized indices that are used by both web applications. Archiving of data is done in the background, coupled with the exporter but not blocking the exporter’s progress.</p><p>Introducing this Camunda Exporter allows it to scale with Zeebe partitions and simplifies the installation, as importer and archiver deployments will be removed in the future.</p><p>The architecture diagram above is a simplified version of the actual work we have done. It shows an installation for a greenfield and a new cluster (no previous data).</p><p>More complex is a brownfield installation as shown in the diagram below, where data already exists.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZtUHskpxhKOWUvzO" /></figure><p>We were able to harmonize the existing index schema used by Tasklist and Operate, reducing data duplication and resource consumption. Several indices can now be used by both applications without a need to duplicate the data.</p><p>With this new index structure, there is no need for additional Zeebe indices anymore.</p><p><em>Note: With 8.8, we likely will still have the importer/exporter (including Zeebe indices) to make use of Optimize (if enabled), but we aim to change that in the future as well.</em></p><h3>Migration (brownfield installation)</h3><p>Brownfield scenarios, where the data already exists and processes are running in an old architecture, are much more complex than greenfield installations. We have covered this in our solution design and want to briefly talk about it in this blog post. A more detailed update guide will follow with the Camunda 8.8 release.</p><p>When you update to the new Camunda version, there will be no additional effort for the user regarding data migration. We are providing an additional migration application that takes care of enhancing process data (in Operate indices) which can be used by Tasklist. Other than that, all existing Operate indices Operate can be used by Tasklist.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9fUd4uhQ7ImUCYLl" /><figcaption><em>A simplified view of the brownfield (migration) scenario to the new streamlined architecture</em></figcaption></figure><p>Reducing the installation complexity is a slower process for brownfield installations. Importers still need to be executed to drain the preexisting data in indices created by ES or OS exporters.</p><p>After all older data (produced before the update) is consumed and aggregated, importers and exporters can be turned off as well but can also be kept for simplicity. The importers will communicate via metrics if they are done and by writing to a special ES/OS index. More details will be provided in the following update guide.</p><h3>Conclusion</h3><p>The new Camunda Exporter helps us achieve a more streamlined architecture, better performance, and stability (especially concerning ES/OS). The target release for the Camunda Exporter project is the 8.8 release.</p><p>To recap the highlights of the new Camunda Exporter, we can:</p><ol><li><strong>Scale with Zeebe partitions, as exporters are part of partitions.</strong> The data injection and the data archiving scales inherently.</li><li><strong>Reduce resource consumption with harmonized schema. </strong>Data is not unnecessarily duplicated between web applications. ES and OS are not unnecessarily overloaded with index requests for duplicated data.</li><li><strong>Improve performance, due to reducing additional hop. </strong>As we do not need to wait for ES/OS to flush twice and make data available, we can reduce one flush interval from our equation. We don’t need to import the data and store it in Zeebe indices, so we shorten the data pipeline. This was shown <a href="https://camunda.github.io/zeebe-chaos/2024/12/12/News-from-Camunda-Exporter-project/#main-latency">in one of our recent chaos days</a> but needs to be further investigated and benchmarked, especially with higher load scenarios.</li><li><strong>Simplify installation by bringing business logic closer to the Zeebe system. </strong>We no longer need separate applications or components for importing and archiving data. It can be easily enabled within the Zeebe brokers. The Camunda Exporter has everything built in.</li></ol><p>I hope this was insightful and helpful to understand what we are working on and what we want to achieve with the newest Camunda Exporter. Stay tuned for more information about benchmarks and other updates.</p><h3>Join us at CamundaCon to learn more</h3><p>Looking to learn more about this new architecture and how the Camunda Exporter will help you? I’ll be <a href="https://www.camundacon.com/event-session/camundacon-amsterdam-2025/one-exporter-to-rule-them-all-exploring-camunda-exporter/">giving a talk on the new Camunda Exporter</a> at <a href="https://www.camundacon.com/amsterdam/tickets/">CamundaCon Amsterdam</a> in May. Join us there in person to catch the session and so much more.</p><p><a href="https://www.camundacon.com/amsterdam/tickets/">Register for CamundaCon right here</a>.</p><p>—</p><p><em>Thanks to </em><a href="/service/mailto:aleksander.dytko@camunda.com"><em>Aleksander Dytko</em></a><em> </em><a href="/service/mailto:bernd.ruecker@camunda.com"><em>Bernd Ruecker</em></a><em> and </em><a href="/service/mailto:daniel.shain@camunda.com"><em>Daniel Shain</em></a><em> for reviewing this post</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8b12016ffd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why batching matters: Real-world example of performance]]></title>
            <link>https://medium.com/@zelldon91/why-batching-matters-real-world-example-of-performance-39bd4b3a9350?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/39bd4b3a9350</guid>
            <category><![CDATA[example]]></category>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[latency]]></category>
            <category><![CDATA[theory]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Thu, 16 Jan 2025 21:20:38 GMT</pubDate>
            <atom:updated>2025-01-20T13:16:57.802Z</atom:updated>
            <content:encoded><![CDATA[<h4>The interaction of latency and throughput.</h4><figure><img alt="Woodpile — Photo by Christopher Kujawa" src="https://cdn-images-1.medium.com/max/1024/1*4SPmjEc4KU7H2y6GYrQhcw.png" /><figcaption><em>Woodpile — Photo by Christopher Kujawa</em></figcaption></figure><p>Have you ever had a case in your real life where you had to collect a lot of items/objects and move them from A to B? I’m pretty sure you had.</p><p>May it be something like putting dishes into the dishwasher, clothes for the laundry, doing a relocation, or even rearranging some firewood, as I did.</p><p>On every task, every day, we naturally improve our performance, for example by taking more objects at a time (batching) or taking a shorter route (reducing latency). Thus to reduce the total time it takes us to do the work. In this blog post, I want to bring you closer to the theory behind that.</p><p>In my work as a software engineer at Camunda, where I do a lot of benchmarking, we talk about performance frequently. Different terms like latency and throughput are used all day. Sometimes it is not clear or tangible for everyone what they mean, and how they interact with each other. Especially how important the right batching is.</p><p>As I’m interested in such topics personally and professionally, I would like to share a real-world situation I had and use it as an example to explain latency, throughput, and batching. My ambition with this blog post is that you have a better understanding of the interaction between latency and throughput and why batching matters, after reading this post.</p><h3>A real-world example</h3><p>A while ago, I had a real-life challenge (or ambition?). I had the glorious idea to rearrange the firewood in my garden.</p><p>The wood was next to my shed (place A) and I wanted to move it next to the entrance of the property (place B).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/0*zziCpIwjwqCVmSqV" /></figure><p>When I started, I picked two or three logs at a time and walked from place A to place B. I quickly realized that this is actually quite inefficient, and it would take ages (it felt at least to me like it).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RpbUtCOgX4jPGkPDN3G6gQ.png" /><figcaption>Wood with wheelbarrow — <em>Photo by Christopher Kujawa</em></figcaption></figure><p>I realized that I had a wheelbarrow, so I started to fill it and walk with the wheelbarrow the way back and forth. I did this until I was done. I felt (and it was) way more performant. During the time of doing this exercise, I thought actually that is a great example of batching (and finding the right limits). The idea of this blog post was born.</p><h3>Example in depth</h3><p>Let’s unfold the scenario and explain the example in more detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/0*caUiZm8EOGfbgJR5" /></figure><p>We have the place A, where the old woodpile is located. We want to move all the logs to place B (the new place). The way from A to B takes us around 20 seconds.</p><p>For simplicity, we take this as constant. Imagine we are a robot which walks all the time very fast, with the same speed :). In reality, this is not true (especially if you work with software and networks).</p><h3>Latency</h3><p>There are some good definitions of latency out there, I don’t want to replace them, I just want to bring you closer to the topic.</p><p>When we talk about latency in our example then this means we take <strong>one </strong>log from place A and walk to place B and put it there. This will take us 20 seconds.</p><blockquote>Latency: A -&gt; B = 20 s</blockquote><p>This means the latency for moving one log is 20 seconds.</p><p>Important to note for the latency is that low values are preferable and higher values are bad. We always want to decrease the latency.</p><h3>Throughput</h3><p>Throughput is how many logs we can move during a certain time unit. In our example one (or more) per 20 seconds. Normally throughput is measured per second, meaning in our case:</p><blockquote>Throughput = Amount of objects / latency</blockquote><p>For our example, this would mean:<strong> 1/20 log/s = 0.05 log/s.</strong> Our throughput is <strong>0.05 log/s</strong>. In other words, we can move 0.05 log per second from A to B.</p><p>Different from latency, for the throughput we want to increase the values, here higher values are better. If the latency is lower, in reverse the throughput is going up (as you can see in the formula above).</p><h3>Batching</h3><p>Based on the formula above, we can see that if we change the amount of logs, that we move, we can increase the throughput.</p><p>This means when we start batching, we can increase the throughput.</p><p>This is what I naturally did in the described scenario: taking more than one log and collecting them in my arms (it describes our batch).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/0*IM5PB1RiSinXs6Dz" /></figure><p>If we take three logs at a time this would mean<strong> 3/20 log/s = 0.15 log/s. </strong>With that, we tripled the throughput! But this is <strong>only true if the batching itself is free.</strong></p><p>I claim that you have been in this situation already, at least once, when collecting dishes, clothes, or whatever. It takes some time to collect them, carry and hold more of them (adding more to the batch). We call it <strong>delay</strong> before you start with your actual task carrying/moving them over.</p><p>This delay is added to the actual latency of every item/log we collect. For simplicity let us say every log added to our batch takes <strong>1 second</strong>. They are heavy, you have to pick them up, put them in your collection, etc.</p><p>This means latency is now a function:</p><blockquote>latency(batch size) = 20s + batch size * 1s</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZGdMoFcNPlia8zOp1FS0g.png" /></figure><p>If we come back to our example of three logs instead of one, this would mean our latency is now: <strong>23 seconds. </strong>This means it takes 23 seconds for a log to move from A to B, as it needs to be put first into the batch, the batch needs to be filled until its <strong>limits</strong> (three logs) and then moved. This is the <strong>maximum latency</strong> in our case. The last log in the batch might have lower latency, but the maximum is 23s.</p><p>As our latency and batch size have changed, our throughput in consequence changed as well and is now: <strong>3/23 log/s ~ 0.130 log/s</strong></p><p>We can see a significant throughput <strong>increase</strong> of <strong>260%</strong> (0.13 log/s vs before 0.05 log/s), while the latency increased by <strong>15%</strong> (23s vs before the 20s).</p><p>As I mentioned above I used a wheelbarrow, so we could increase the batch size even further, maybe to 10–15 logs.</p><p>Batch size <strong>10 logs</strong></p><ul><li>Latency: 20 s + 10 logs * 1 s = 30s -&gt; <strong>50% increase</strong></li><li>Throughput: 10/30 = ⅓ ~ 0.333 log/s -&gt; <strong>666% increase</strong></li></ul><p>Batch size <strong>15 logs</strong></p><ul><li>Latency: 20s + 15 logs * 1 s = 35s -&gt; <strong>75% increase</strong></li><li>Throughput: 15 / 35 = 3/7 = 0.429 log/s -&gt;<strong> 858% increase</strong></li></ul><h3>Total Execution Time</h3><p>Depending on your scenario/use case you might have to look at different metrics and tune them accordingly.</p><p>Sometimes latency of a singular object is more important than the throughput of multiple, sometimes it is the total execution time that is important.</p><p>In the software world, you often have endless data which you have to process and work on. In reality, this is different, the data or objects are limited. Like my woodpile (luckily).</p><p>To calculate the total execution time we need to move everything from A to B we can use the following formula:</p><blockquote>total execution time = total amount / batch size * latency(batch size)</blockquote><h4>Taking one log</h4><p>Let’s say we have 200 logs in the woodpile, which we want to move. If we would take one log at a time it would take us:</p><blockquote>200 logs * 20 s = 4000s = 4000s / 60s = 66,666 min.</blockquote><p>After around one hour we would be done with moving the woodpile.</p><h4>Batch size three</h4><p>If we had increased the batch size to three, then this would mean:</p><blockquote>200 log/ 3 log * 23 s = 1533,33s = 1533,33s / 60s = 25,55 min.</blockquote><p>We would be done after around 25 minutes when taking three logs at a time.</p><h4>Batch size ten</h4><p>With our wheelbarrow and taking ten logs:</p><blockquote>200 log/ 10 log * 30 s = 600s =600s / 60s = 10 min</blockquote><p>We would be done after 10 minutes.</p><h4>This is why batching matters</h4><p>We learn this naturally as kids. If we take more at once and walk less, we are faster.</p><p>It is <strong>important to note</strong> that the total execution time will behave differently when the latency, which is a function of batch size, grows significantly/non-linearly. It’s not uncommon for the latency to grow faster than the batch size, leading to the so-called latency/throughput tradeoff.</p><h3>Conclusion</h3><p>We have seen that latency and batching influence throughput and the total execution time. They interact or cohere with each other.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O6ZGSF_JG-lkbctp" /><figcaption>Interaction of latency and throughput</figcaption></figure><p>It is always a tradeoff. It always depends on the situation. It is an art of finding the right balance between batch sizes, throughput, and good latency.</p><p>In software systems acting on requests, we need to keep the balance between being responsive, having an acceptable latency, and a good throughput (reacting/processing multiple requests at the same time). This means it doesn’t make sense to batch all requests forever and send them at once. Luckily we can parallelize more in software systems, which is a way to compensate for high latency.</p><p>This is not easily doable in a real-world scenario, except if you have a big family or a lot of friends to ask for help. We are limited by physical laws (or to be specific to our example there is no more room in our wheelbarrow).</p><p>As we have seen batching can and will introduce delays and impact the latency of an individual object, like adding the log. In our example, it is not an issue, as the important metric is the total execution time and the latency is linear growing with the batch size.</p><p>There exist situations where latency grows non-linear with the batch size producing more trouble. In general, if we reduce the latency or make sure that the growth with the batch size is close to linearity we can improve the throughput.</p><p>I hope this gave you some insights into how latency and throughput interact with each other and why batching matters.</p><p>Thanks for reading so far. Let me know what you think and share your stories. Thank you. :)</p><p><em>Thanks to </em><a href="https://github.com/lenaschoenburg"><em>Lena Schoenburg</em></a><em> and </em><a href="https://github.com/entangled90"><em>Carlo Sana</em></a><em> for reviewing this post.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39bd4b3a9350" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Incident.io daily statistics with Camunda]]></title>
            <link>https://medium.com/@zelldon91/incident-io-daily-statistics-with-camunda-b26a01c4dd34?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/b26a01c4dd34</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[camunda]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[incident-management]]></category>
            <category><![CDATA[incident-response]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 13:34:41 GMT</pubDate>
            <atom:updated>2024-02-23T13:34:41.300Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tm8no55mzJgOdJ1KBXpFiA.png" /><figcaption>BPMN Process: Get incident statistics</figcaption></figure><p>When using tools like <a href="https://incident.io/">incident.io</a> to manage your incidents it is often useful to get an overview of ongoing incidents. Furthermore, it is beneficial to get reports based on certain (custom) filters like affected teams, severity, etc.</p><p>Unfortunately, incident.io doesn’t support this out-of-the-box. Camunda can help here 🚀</p><p>Today, I want to show you how you can get the necessary statistics from incident.io, extract the necessary results, and post them for example to <a href="https://slack.com/">slack</a> to create a daily incident statistics update with Camunda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*sB9TOEUq_0i9CGS7WRljGQ.png" /><figcaption>Screenshot: Incident statistics daily update</figcaption></figure><h3>Get details from incident.io</h3><p>The incident.io API is rather simple and well-documented. All necessary information can be found in their API docs <a href="https://api-docs.incident.io/">https://api-docs.incident.io/</a>.</p><h4>API Key</h4><p>As a first step, you have to create an API token. Follow this <a href="https://api-docs.incident.io/#section/Making-requests/Authentication">guide</a> to create one.</p><p>After you have this make sure to store it somewhere safe.</p><h3>Incidents API</h3><p>We want to get the current statistics for the Incidents for that we have to query <a href="https://api.incident.io/v2/incidents"><em>https://api.incident.io/v2/incidents</em></a><em>.</em></p><p>In our daily update, we are only interested in ongoing incidents for that we need to filter status_category[one_of]=live Details of this filtering mechanism are also described in their <a href="https://api-docs.incident.io/tag/Incidents-V2/#operation/Incidents%20V2_List">documentation</a>.</p><p>It becomes interesting if you want to filter for custom_fields (which you have defined earlier on your own). That can be for example the affected team, or other details you add to your incidents. Be aware that you have to find the corresponding IDs for the custom_field and also the potential options.</p><p>To find these you can either query the<a href="https://api.incident.io/v2/custom_fields">https://api.incident.io/v2/custom_fields</a> endpoint or run a query against the incidents endpoint, as the response contains all necessary information.</p><h4>Example</h4><p>After you find all the necessary filtering (or just if you want to experiment with something) you can use the following script to try your query.</p><pre>#!/bin/bash<br>#<br># Script to query incident.io API<br>set -euo pipefail<br><br><br>if [ -z $1 ];<br>then<br>  echo &quot;Must provide an api token to query incident.io api&quot;<br>fi<br><br>token=$1<br><br>incidents=$(curl --verbose --get https://api.incident.io/v2/incidents \<br>  -H &quot;Accept: application/json&quot; \<br>  -H &quot;Authorization: Bearer $token&quot; \<br>  --data &#39;custom_field[&lt;CUSTOM_FIELD_ID&gt;][one_of]=&lt;CUSTOM_FIELD_OPTION_ID&gt;&amp;status_category[one_of]=live&#39;<br>)<br><br># Custom fields need to be adressed with IDs<br><br>count=$(echo $incidents | jq &#39;.incidents | length&#39;)<br><br>echo &quot;$count incidents&quot;<br>echo $incidents | jq &#39;.incidents[].name&#39;</pre><p><strong>Example usage:</strong></p><pre>$ ./incidentsStats.sh $token <br>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current<br>                                 Dload  Upload   Total   Spent    Left  Speed<br>100  459k    0  459k    0     0  1054k      0 --:--:-- --:--:-- --:--:-- 1055k<br>10 incidents<br>&quot;support-123&quot;<br>&quot;support-2124&quot;<br>&quot;support-20124&quot;<br>&quot;123124&quot;<br>&quot;SUPPORT-1232&quot;<br>&quot;Some other incident&quot;<br>&quot;test incident&quot;<br>&quot;SUPPORT-2012&quot;<br>&quot;support-2014212&quot;<br>&quot;SUPPORT-112&quot;</pre><p>With that script running we have everything ready and can get things automated.</p><h3>Automating with Camunda</h3><p>You can either get a trial account <a href="https://signup.camunda.com/accounts">here</a>, or host Camunda on your own, for example with the provided <a href="https://docs.camunda.io/docs/self-managed/about-self-managed/">Self-managed version</a>.</p><p>For simplicity reasons, I will skip the details here, and we expect the usage of the Camunda SaaS offering. Furthermore, will concentrate on the modeling details mostly (using <a href="https://docs.camunda.io/docs/components/modeler/web-modeler/new-web-modeler/">Web-Modeler</a>).</p><p>Follow these instructions <a href="https://docs.camunda.io/docs/components/modeler/web-modeler/model-your-first-diagram/">here</a> if you are unsure how to model your first diagram.</p><h4>Adding Incident.io API key as Connector secret</h4><p>When querying the incident.io API we need an API key, as described above. To make this available to our process instances and connectors we have to create a secret in our Camunda cluster.</p><p>How to create a secret for your Camunda cluster take a look at this <a href="https://docs.camunda.io/docs/components/console/manage-clusters/manage-secrets/">guide</a>.</p><p>In the end, it should be similar to the below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9fC4RNFLtbHVHDnSKgiBNQ.png" /><figcaption>Screenshot: Connector secrets</figcaption></figure><h4>Query incident statistics via REST connector</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*rsJTW1A0bmqam1Zzla2Hog.png" /><figcaption>BPMN: Rest connector</figcaption></figure><p>After we have created our Camunda cluster, added our Connector secret, and started modeling we can add a REST Connector. Details about this can be found in the documentation <a href="https://docs.camunda.io/docs/components/connectors/protocol/rest/#create-a-rest-connector-task">here</a>.</p><p>In the properties panel of the REST Connector, we have to specify all important details, similar to what we used in our script above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*xQS6L2H0oB_jKoWVSGgn8g.png" /><figcaption>Screenshot: REST connector properties panel</figcaption></figure><p>One important part we need to add as well is the result expression which would look like this:</p><pre>{<br>    incidentIoResponse: response.body<br>}</pre><p>This maps the response body to our variable incidentIoResponse.With that, we are already ready to query the details of our incidents. You can either test this by creating a process instance and verifying the results or you just continue with the next step.</p><h4>Extracting incident details</h4><p>After we get all the incident details from incident.io we need to extract the important details. We can do this by defining a <a href="https://docs.camunda.io/docs/components/modeler/bpmn/script-tasks/">script task</a> in our process model and implementing it with <a href="https://docs.camunda.io/docs/components/modeler/feel/what-is-feel/">FEEL</a> expressions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*8UfxT9VOLLSkpk79IevsvA.png" /><figcaption>BPMN: Extracting statistics</figcaption></figure><p>Depending on what you are interested in you want to extract different details. For all the potential properties of incidents, you can take a look at the incident.io API documentation <a href="https://api-docs.incident.io/tag/Incidents-V2#operation/Incidents%20V2_List">here</a>.</p><p>In our example, we are interested in:</p><ul><li>Incident name</li><li>Incident Severity</li><li>Incident permalink, which points to the incident.io page</li><li>The related Slack details (channel name and ID)</li><li>The incident command (with name and Slack ID)</li><li>Incident count</li></ul><p>All of this can be extracted with the following FEEL expression:</p><pre>{<br>    incidents:<br>      for incident in incidentIoResponse.incidents <br>      return { name: incident.name,<br>               severity: incident.severity.name,<br>               permalink: incident.permalink,<br>               slack_channel_id: incident.slack_channel_id, <br>               slack_channel_name: incident.slack_channel_name,              <br>               ic_name: incident.incident_role_assignments[item.role.shortform = &quot;commander&quot;].assignee.name[1],                 <br>               ic_slack_id: incident.incident_role_assignments[item.role.shortform = &quot;commander&quot;].assignee.slack_user_id[1]<br>             }<br>    ,<br>    incidents_count: count(incidentIoResponse.incidents)<br>}</pre><p>With the <a href="https://docs.camunda.io/docs/components/modeler/feel/language-guide/feel-control-flow/#for-loops">FEEL for loop</a>, we are iterating over the incidents, and creating for each incident <a href="https://docs.camunda.io/docs/components/modeler/feel/language-guide/feel-context-expressions/">a new context (object)</a>.</p><p>The <a href="https://docs.camunda.io/docs/components/modeler/feel/language-guide/feel-list-expressions/#filter">FEEL list filter</a> allows us to find the incident commanders and their respective names and Slack IDs.</p><h4>Sending statistics via Slack Connector</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*eUeXmsi6cTblgOltnxM5Bg.png" /><figcaption>BPMN: Slack connector added</figcaption></figure><p>Camunda supports several Connectors out-of-the-box not only the REST Connector but also a <a href="https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/#create-a-slack-connector-task">Slack Connector</a>. That Slack Connector we use in our example to send our statistics to a respective channel.</p><p>Of course also here we need an API key to access the Slack API you can follow <a href="https://api.slack.com/tutorials/tracks/getting-a-token">this guide</a> to create a Slack OAuth token.</p><p>Similar to the REST Connector we need to add the Slack OAuth Token to our Connector Secrets. Follow <a href="https://docs.camunda.io/docs/components/console/manage-clusters/manage-secrets/">this documentation</a> if you need to know how to create/add them to your cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A5YZUGNmRBFQMZmD8uNLKQ.png" /><figcaption>Screenshot: Connector Secrets</figcaption></figure><p>After adding the secret we can start with modeling the Slack connector.</p><p>We have to specify some details like, which channel or user should get the update. Furthermore, we have to specify how the message should look like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nrJ9PMQdMpN-8LV3YeXedw.png" /><figcaption>Screenshot: Slack connector props</figcaption></figure><p>For the Slack message, we can use again a FEEL expression.</p><pre>&quot;:incident-heart: This is your daily incident update :incident-io:\n\n&quot;<br>+ &quot;We have currently *&quot; +string(incidents_stats.incidents_count) + &quot; ongoing Incidents*\n\n\n&quot;<br>+<br>string join(<br>  for incident in sort(incidents_stats.incidents, function(x,y) x.severity &lt; y.severity)<br>  return incident.severity + &quot; - &lt;&quot; + incident.permalink + &quot;|&quot; + incident.name + &quot;&gt;&quot; + &quot; IC: &lt;@&quot; + incident.ic_slack_id + &quot;&gt;&quot;<br>, &quot;\n&quot;)</pre><p>Formating the Slack message has to follow some guidelines, which we can find in the Slack documentation <a href="https://api.slack.com/reference/surfaces/formatting#basics">here</a>.</p><p>As the first part of the message, we want to post some header (with some nice Emojis this of course depends on your Slack workspace whether this is available or not).</p><p>As the message field expects a string we have to concatenate everything to one string. We have to iterate over the incidents and join them via the <a href="https://docs.camunda.io/docs/components/modeler/feel/builtin-functions/feel-built-in-functions-list/#string-joinlist">string join</a> function. This function allows us to specify a delimiter, which is in our case a newline.</p><p>To sort our incident list by severity we can use the <a href="https://docs.camunda.io/docs/components/modeler/feel/builtin-functions/feel-built-in-functions-list/#sortlist-precedes">FEEL sort function</a>.</p><p>We can now experiment with our model and it should send a message already to a specified channel or DM, when we create a process instance for the definition.</p><h4>Running it every working day</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tm8no55mzJgOdJ1KBXpFiA.png" /><figcaption>BPMN: Daily incident statistics</figcaption></figure><p>As the last step, we want to execute/run it every working day at the same time. In our example, we want to do it always before lunch (around 12 o’clock CET). To achieve this we model a timer start event with a cycle expression, details about this can be found in the documentation <a href="https://docs.camunda.io/docs/components/modeler/bpmn/timer-events/#time-cycle">here</a>.</p><p>The example expression we would use is 0 0 11 * * MON-FRI we referring here to 11 as we specify here the time in UTC.</p><p>Be aware that tools like crontab-guru don’t parse this expression correctly as they don’t expect the seconds (at the beginning). Here the expression would be <a href="https://crontab.guru/#0_11_*_*_MON-FRI">0 11 * * MON-FRI</a>.</p><h3>Daily incident statistics with Camunda</h3><p>After modeling all our logic (wiring everything together) we can deploy this to our previously created Camunda cluster, and as soon as the right time is reached we will see a Slack message like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*sB9TOEUq_0i9CGS7WRljGQ.png" /><figcaption>Screenshot: Daily incident statistics</figcaption></figure><p>As you can see there is not much magic behind it, it is quite “easy” to generate a daily report from an external source, like <a href="https://incident.io/">incident.io</a>.</p><p>You don’t need to scrape the statistics manually anymore and put them into a good format to share them with others. We were able to completely automate this.</p><p>That is the power of Camunda “Automate Any Process, Anywhere”.</p><p><em>P.S.: The possibilities for further things are endless, for example, auto-assigning an engineer to an incident, based on current ongoing incidents (related to statistics and load).</em></p><p><em>P.P.S.: If you like this post please leave a clap. I’m open to any other feedback as well.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b26a01c4dd34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zeebe Performance 2023 Year In Review]]></title>
            <link>https://medium.com/@zelldon91/zeebe-performance-2023-year-in-review-cea6252206a3?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/cea6252206a3</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[benchmarking]]></category>
            <category><![CDATA[year-in-review]]></category>
            <category><![CDATA[camunda]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Fri, 09 Feb 2024 19:18:49 GMT</pubDate>
            <atom:updated>2024-02-09T19:18:49.860Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*s00wpJ2ibjmpfu_lzYVyuw.png" /><figcaption>Zeebe Performance</figcaption></figure><p>Zeebe is the distributed and fault-tolerant process engine behind Camunda 8 and has been engineered for over five years by a dedicated team at <a href="https://camunda.com/">Camunda</a>. At the beginning of 2023, the Zeebe team was split into two separate teams to focus on different aspects of the system. One team concentrates on the distributed system and overall performance (Zeebe Distribution Platform Team, ZDP), and the other fully focuses on all process automation details across BPMN and DMN (Zeebe Process Automation Team, ZPA).</p><p>Of course, features like supporting new BPMN elements or having DMN support are more visible than features like improved throughput with large state, etc. This is why we want to spend some time here to recap what happened in 2023 from the perspective of the ZDP team regarding performance and improving the distributed system.</p><p>In this blog post, you will find several details about features we have implemented over the year on a high level. Most of the time, we will link to related GitHub issues, so you can dive deeper if you want. Most of these features have been benchmarked with our benchmarking setup. I want to shortly go into the details so we can clarify this upfront.</p><h3>Benchmarking</h3><p>We set up performance and load tests for new features or bug fixes where we think it makes sense to see how the change affects the cluster performance. Furthermore, we have weekly benchmarks which are set up automatically to detect regressions.</p><p>The basis for our benchmarks is our <a href="https://helm.camunda.io/">Camunda Platform Helm chart</a>, where we added some testing applications on top. One of these applications is in charge of creating new instances at a specific rate, called the “Starter.” In all our benchmarks (if not otherwise specified) we will run with the same load of 150 process instances per second (PI/s). The second application is the “Worker” which makes sure that Jobs are activated and completed (after a configurable delay). By default, the completion delay is 50ms. That means at minimum a process instance takes at least 50ms.</p><p>We always use the same process model (if not otherwise specified), which consists of one service task, and a <a href="https://github.com/camunda/zeebe/blob/main/benchmarks/project/src/main/resources/bpmn/big_payload.json">big payload</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/0*NrTcI70_sqPcMcF1" /><figcaption>One task process</figcaption></figure><p>In all our benchmarks the Zeebe clusters are configured the same, and only the Docker image changes. We run with three brokers, two standalone gateways, three partitions (replication factor three), three workers, and one starter.</p><p>For more details, you can check the <a href="https://github.com/zeebe-io/benchmark-helm/blob/main/charts/zeebe-benchmark/README.md">readme</a> in our Benchmark Helm chart repo.</p><p>After that short excursion, let’s jump into the features we have implemented.</p><h3><a href="https://github.com/camunda/zeebe/issues/11416">Batch processing</a></h3><p>The year started with an interesting topic: how can we improve the process instance execution latency in an environment where the network latency is high? The answer? Batch processing.</p><p><em>I already wrote a full article about this </em><a href="https://medium.com/@zelldon91/zeebe-or-how-i-learned-to-stop-worrying-and-love-batching-17396891a040"><em>here</em></a><em>, where you can find more in-depth details.</em></p><h3>Summary</h3><p>Since Zeebe uses Raft and wants to provide strong consistency, Zeebe needs to make sure that user commands (which are driving the execution of a process instance) are committed before being processed.</p><p>A command is committed when it is replicated to and acknowledged by a quorum of nodes. This can result in high commit latency if the network is slow. Zeebe splits the processing into user commands and internal commands. Previously, each of them was committed and processed individually. It has shown, based on our investigation and benchmarks, that it is worth batching internal commands together. This is quite similar to what is done in Camunda 7 where we process the process instances <a href="https://docs.camunda.org/manual/7.20/user-guide/process-engine/transactions-in-processes/#transaction-boundaries">until a wait state</a>.</p><h3>Result</h3><p>With this change, as you can see below, we were able to reduce the process instance execution latency by half and increase the maximum throughput by 20% in our benchmarks. For more details, <a href="https://github.com/camunda/zeebe/issues/11416#issuecomment-1450684504">see</a> this issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Md7nIwbraxOQOVkx" /><figcaption>Latency diff</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZU9vjPt4nK0tvqS9" /><figcaption>General overview diff</figcaption></figure><h3><a href="https://github.com/camunda/zeebe/issues/12033">Improving the performance of hot data with large state</a></h3><p>Due to certain investigations, benchmarking, testing, etc., we observed that our system runs into performance issues when working with a larger state. Particularly, when we hit a certain limit of state in RocksDB (used in Zeebe) the performance unexpectedly drops. <a href="https://zeebe-io.github.io/zeebe-chaos/2021/10/29/Throughput-on-big-state">We documented this in a Chaos day as well.</a></p><p>We worked on some initiatives to resolve this situation following a few customer requests. For example, the idea that hot data should always be executed fast/performant, and cold data or big state shouldn’t have an impact on new data and their performance.</p><h3>Summary</h3><p>After <a href="https://github.com/camunda/zeebe/issues/12033#issuecomment-1536119755">evaluating several approaches on how to improve our performance with accessing RocksDB</a>, we found quite an interesting configuration in RocksDB that changes how we write our data. It <a href="https://github.com/camunda/zeebe/pull/12483">separates key-value pairs</a>, based on a prefix into their own SST files.</p><p>It is worth mentioning here that Zeebe uses only one real column family in RocksDB (to minimize disk space and memory usage) and uses key prefixes to produce an artificial data separation (also called virtual column families). This works since keys are sorted in RocksDB. This allows one to seek to a certain prefix, iterate with the given prefix to find all related data, and stop when a different prefix has been encountered.</p><p>We have observed that having this setup and a lot of data, read access and especially iteration becomes slower as soon we hit a certain size limit. By partitioning data into their own SST files, grouped by prefixes, we were able to restore performance. The performance was similar to what we would get by separating data into real column families but with much less overhead.</p><p>We documented several benchmark results <a href="https://github.com/camunda/zeebe/issues/12241#issuecomment-1511196808">here</a>.</p><h3>Result</h3><p>Before our change, our benchmark ran stable until ~1 gig of state had been reached, which caused it to drop in accepting and processing more instances. In this scenario, we were blindly creating instances without completing them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YWMsDe5IGhFfkbdU" /><figcaption>Drop in performance</figcaption></figure><p>After using the SST partitioning feature from RocksDB, we were able to continuously accept and process new instances until we reached our disk limit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WTGMIbqlFc7AiDGB" /><figcaption>Snapshot size</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H2F4KFP-H57mjk7c" /><figcaption>Several days of cont. creating new instances</figcaption></figure><p>We did some chaos days (<a href="https://zeebe-io.github.io/zeebe-chaos/2023/05/15/SST-Partitioning-toggle">1</a>, <a href="https://zeebe-io.github.io/zeebe-chaos/2023/05/19/Continuing-SST-Partitioning-toggle">2</a>) to validate and verify the behavior of this feature, especially how it behaves when enabling existing data or disabling it again without breaking running installations.</p><h3><a href="https://github.com/camunda/product-hub/issues/1480">Cluster availability should not be impacted by runtime state</a></h3><p>Similar to the previous topic was cluster availability impacted by a large state in Zeebe. We experienced degradation of availability (and especially recovery) when the state was large.</p><p>For example, we had an <a href="https://github.com/camunda/zeebe/issues/13775">incident</a> where a large state of data caused Zeebe to no longer recover since our defined liveness probe (with a 45s timeout) caused it to restart the pod every time. This prevented Zeebe from recovering at all.</p><h3>Summary</h3><p>We investigated various options to improve the situation and more quickly recover a broker, which includes copying an existing snapshot, opening the database, etc.</p><p>Previously when a node bootstrapped, we copied an existing snapshot into the runtime folder, such that we could open and work on the database (RocksDB). This can be quite time-consuming and IO inefficient, depending on the filesystem and size of the state.</p><p>RocksDB offers a checkpoint of an open database, which essentially creates hard links to existing SST files; this works great when snapshots and runtime are on the same file system. We use this already for normal snapshots.</p><p>One improvement we made was using the same mechanics on recovery. We open the snapshot as a read-only database and create a checkpoint to make the database available as runtime. It turned out to be much faster than copying all the content, especially with larger states. Depending on whether both source and target are different file systems, it might mean that we still copy files, but then we have similar behavior as before.</p><p>We previously replicated snapshots into a pending snapshot directory. If the replication was successful, we copied the complete snapshot into the correct snapshot directory; this was to make sure that we only have valid and committed snapshots as part of our snapshot directory. We improved this mechanism in a way that we no longer need to copy the snapshot. <a href="https://github.com/camunda/zeebe/pull/14230">We will directly write into the correct folder, and mark the snapshot via a checksum file as complete/valid</a>. This helped to reduce the time spent during snapshot replications. Additionally, we found a way t<a href="https://github.com/camunda/zeebe/pull/14184">o reuse previously calculated checksums</a>, which gave us a great boost in <a href="https://github.com/camunda/zeebe/issues/14045#issuecomment-1709656377">performance on persisting larger snapshots</a>.</p><h3>Result</h3><p>Snapshot persistence has been improved significantly by not calculating checksums multiple times:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uSVfaqzaUMSlZUY9" /><figcaption>Snapshot persistence performance</figcaption></figure><p>We can see that as soon as we reach around one gigabyte, we already have around 10 seconds of snapshot persistence duration (which is the maximum to record, so might be even higher). With our change, we stay under one-half of a second.</p><h3><a href="https://github.com/camunda/zeebe/issues/12302">Concurrent tasks</a></h3><p>Aside from normal stream processing, Zeebe also has to run other tasks. For example, trigger timers or cleaning up buffered messages after they expire.</p><p>Previously, these tasks interrupted regular stream processing. This was a problem when these tasks took a long time to process, <a href="https://github.com/camunda/zeebe/issues/11594">for example when many timers expired at once</a>. For users with strong latency requirements, this is unacceptable and we needed to find a solution where these <a href="https://github.com/camunda/zeebe/issues/12302">tasks don’t interfere with regular processing</a>.</p><h3>Summary</h3><p>To not have tasks interfere with regular processing, we decided that they should run on a different thread and concurrently with regular processing. This was complicated by two factors that we needed to address first. First, we needed to ensure that processing and tasks use different transaction contexts. This is important because tasks should not be able to read uncommitted processing results. For example, when we process a new process instance and create timers for it, the processing might fail and the transaction where we create a timer is rolled back.</p><p>To fix this, we now create a new transaction for every task execution. This ensures that tasks and processing are isolated from each other and can only read committed results. To improve the safety further, we decided that tasks are not allowed to write to the state directly. For example, the <a href="https://github.com/camunda/zeebe/issues/12797">job timeout checker task was no longer allowed to update the job state directly</a>. Instead, all tasks have to follow the usual stream processing rules and can only produce new commands that will be processed eventually.</p><p>The second issue was that tasks and processing <a href="https://github.com/camunda/zeebe/issues/12798">shared mutable state</a>. This worked fine while both were running on the same thread, but as soon as we ran them on two different threads, access to that data needed to be synchronized. We solved this by <a href="https://github.com/camunda/zeebe/pull/13072">making use of normal concurrent data structures</a> such as `ConcurrentHashMap`.</p><p>After addressing both issues, the <a href="https://github.com/camunda/zeebe/pull/13524">actual change</a> to run tasks on a new thread and concurrently to processing was trivial.</p><h3>Result</h3><p>As a result, processing in Zeebe 8.3 and newer is not interrupted by other tasks. Even if many timers or buffered messages expire at once, normal processing can continue.</p><p>This reduces latency spikes and makes processing performance more predictable. While it’s possible to revert to the previous behavior, we collected enough experience with this change to see this as a pure performance and latency improvement that everyone benefits from.</p><h3><a href="https://github.com/camunda/zeebe/issues/11231">Job push</a></h3><p>The following is a summarized version of <a href="https://zeebe-io.github.io/zeebe-chaos/2024/01/19/Job-Activation-Latency">this blog post</a>, which contains more tests and details. There, we test various workloads as well as resilience use cases.</p><p>Before this change, the only way to activate jobs in Zeebe was to poll for them, meaning:</p><ul><li>The client sends an `ActivateJobs` request to the gateway</li><li>The gateway, in turn, sends one request to each partition, polling for jobs, until either it activates enough jobs, or exhausts all partitions.</li><li>If long polling is enabled and all partitions are exhausted, then the request is parked until new jobs are available. At this point, the gateway starts a new partition polling cycle as described above.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/0*jq6XmJvHTAForxp0" /><figcaption>Job polling</figcaption></figure><p>This has several impacts on latency:</p><ul><li>Every request — whether client to gateway, or gateway to broker — adds a delay to the activation latency.</li><li><a href="https://github.com/camunda/zeebe/issues/11813">If you have a lot of jobs, you can run into major performance issues when accessing the set of available jobs</a>.</li><li>The gateway does not know in advance which partitions have jobs available.</li><li>Scaling out your clients may have adverse effects by sending out too many requests which all have to be processed independently. Even with long polling, this is only mitigated.</li><li>In the worst-case scenario, we have to poll <em>every</em> partition; even with long polling, when receiving a notification, we may <em>still</em> have to poll all partitions.</li><li>With long polling, if you have multiple gateways, all gateways will start polling if they have parked requests. Some of them may not get any jobs, but they will still have sent requests to brokers which still all have to be processed. A similar <a href="https://github.com/camunda/zeebe/issues/7659">issue</a> exists when many jobs are waiting.</li></ul><p>To solve these issues, the team decided to implement <a href="https://github.com/camunda/zeebe/issues/11231">a push-based approach to job activation</a>.</p><h3>Summary</h3><p>Essentially, we added a new `StreamActivatedJobs` RPC to our gRPC protocol, a so-called <a href="https://grpc.io/docs/what-is-grpc/core-concepts/#server-streaming-rpc">server streaming RPC</a>. In our case, this is meant to be a long-lived stream, such that the call is completed only if the client terminates it, or if the server is shutting down.</p><p>The stream itself has the following lifecycle:</p><ul><li>The client initiates the stream by sending a job activation request much like with the `ActivateJobs` RPC. Since the stream is meant to be long-lived, however, there is no upper bound on the number of jobs to activate.</li><li>The gateway registers the new stream with all brokers in the cluster. Note that there is no direct connection between brokers and clients; the gateway acts as a proxy for the client.</li><li>When jobs are available for activation (e.g. on creation, on timeout, on backoff, etc.), the broker activates the job and pushes it to the gateway.</li><li>The gateway forwards the job to the client.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/0*jzeStl9u5qVkkg7o" /><figcaption>Job push</figcaption></figure><p>Experienced readers will immediately notice the risk of overloading clients if the brokers/gateways are pushing too many jobs downstream. To avoid this, we also had to implement a form of client-controlled back pressure. Thankfully, we could reuse the built-in flow control mechanisms from gRPC and HTTP/2.</p><h3>Result</h3><p>To compare the advantages of pushing to polling, we ran four different experiments. Note that, unless otherwise specified, we always run a constant throughput of 150 PI/s, and our workers simulate work by waiting 50ms before completing a job.</p><p>As our baseline test, we ran a constant throughput of 150 PI/s of a process consisting of a single task:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RwMQA7_bQ2A7Krzk" /><figcaption>Job push vs. Job polling</figcaption></figure><p>The results show a sharp decrease in both the p50 and p99 of the job lifetime (i.e. the time between creation and completion). Since this workload only consists of a single task, this is mirrored in the overall process execution latency. Overall, we see that switching to a push approach yields a p50 latency improvement of 50%, and a p99 improvement of 75%!</p><h3><a href="https://github.com/camunda/product-hub/issues/1087">Broker Scaling</a></h3><p>While Zeebe’s design enables horizontal scalability through partitioning, it lacked dynamic scaling capabilities until now. This much-anticipated feature has finally been implemented. As a stepping stone towards infinite scaling, Zeebe can now dynamically add or remove brokers to an existing cluster. While you cannot yet change the number of partitions, this capability proves particularly valuable when clusters are configured with many partitions and vertical scaling is not feasible.</p><h3>Summary</h3><p>The main blocker to dynamic scaling was that most Zeebe components relied solely on the static configuration provided at startup. To address this, we introduced a new topology management mechanism over gossip that embeds cluster configuration within the Zeebe cluster itself. This topology maintains up-to-date information about the brokers forming the cluster and the partition distribution. When new brokers are added, the topology is updated accordingly, ensuring that upon restart, brokers utilize the current topology rather than the outdated static one.</p><p>When a cluster has to be scaled up, the existing partitions have to be re-distributed. To minimize disruptions to ongoing processing, this migration process is carried out in a step-by-step manner. For each partition to be moved from one broker to another, the partition is first added to the new broker and then removed from the old one. This transition is executed by Raft (the replication protocol employed for replicating partitions) and coordinated by the new topology management mechanism. To support this, we implemented a joint-consensus mechanism in Raft to allow changing the configuration of a Raft replication group safely and correctly.</p><p>Scaling is orchestrated by a Rest API exposed in Zeebe Gateway. You can read more about it in <a href="https://docs.camunda.io/docs/self-managed/zeebe-deployment/operations/cluster-scaling/">Camunda documentation</a>.</p><h3>Result</h3><p>To demonstrate the scaling, we did a small experiment to scale a cluster with three brokers and six partitions. The following image shows how throughput can be scaled when the cluster is scaled to six brokers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gqPJt8lvAqxK0SqV" /><figcaption>Throughput with broker scaling</figcaption></figure><p>We also held several Chaos days to test this feature and build up confidence. You can read more about it in the following blogs:</p><ul><li><a href="https://zeebe-io.github.io/zeebe-chaos/2023/12/18/Dynamically-scaling-brokers/">Pt. one: Dynamically-scaling-brokers</a></li><li><a href="https://zeebe-io.github.io/zeebe-chaos/2023/12/19/Dynamic-Scaling-with-Dataloss/">Pt. two: Dynamic-Scaling-with-Dataloss</a></li><li><a href="https://zeebe-io.github.io/zeebe-chaos/2023/12/20/Broker-scaling-performance/">Pt. three: Broker-scaling-performance</a></li></ul><h3>Conclusion</h3><p>As you have seen from the above, it was a great year from the Zeebe performance and distributed systems perspective. We were able to ship several new features and improvements to improve our user’s lives.</p><p>To better understand the impact of all these improvements, we have run some more benchmarks comparing different released versions. All the benchmarks have used the same process models (single task) and the same load of 150 PI/s.</p><p>In the following screenshot, we are showing how the process instance execution time (latency) has been improved. We use here the term p99, which indicates that 99% of requests are completed within the recorded latency, and p50, which indicates that 50% of requests are completed within the recorded latency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OAn9HCxDc5olTDvz" /><figcaption>Overview latency improvements</figcaption></figure><h3>Release 8.1 (Oct, 2022)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XzlsiD8Eju6a_e1J" /><figcaption>Release 8.1 latency</figcaption></figure><p>We can see that in the 8.1 release, we were in our p99 around four to five seconds of completing a process instance, with one single task. The p50 was around one to two seconds.</p><h3>Release 8.2 (April, 2023)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jFT7kWx2gHK5auYY" /><figcaption>Release 8.2 latency</figcaption></figure><p>In release 8.2, we already reduced the latency by half (mostly due to batch processing). Now having p99 around 2.5 seconds and p50 at around 0.500 seconds.</p><h3>Release 8.3 (Oct, 2023)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4p-biHfX9m1kENmu" /><figcaption>Release 8.3 latency</figcaption></figure><p>In release 8.3 we were able to further reduce the latency with job push to p99 0.750 and p50 ~0.200 seconds, which is another reduction in latency by a factor of two to three.</p><p>This doesn’t take into account changes we made related to big state support, concurrent tasks, or even broker scaling, which would allow us to improve the performance even more.</p><p>All in all, the year 2023 was filled with great achievements by the Zeebe Team, and we are looking for more things to come in 2024.</p><p><em>Thanks to all who contributed and reviewed this blog post. Namely: </em><a href="https://github.com/christinaausley"><em>Christina Ausley</em></a><em>, </em><a href="https://github.com/deepthidevaki"><em>Deepthi Akkoorath</em></a><em>, </em><a href="https://github.com/oleschoenburg"><em>Ole Schoenburg</em></a><em> and </em><a href="https://github.com/npepinpe"><em>Nicolas Pepin-Perreault</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cea6252206a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zeebe Debug and Inspection tool]]></title>
            <link>https://medium.com/@zelldon91/zeebe-debug-and-inspection-tool-ef0fde68aee9?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef0fde68aee9</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[camunda]]></category>
            <category><![CDATA[zeebe]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[tools]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Wed, 23 Aug 2023 14:43:58 GMT</pubDate>
            <atom:updated>2023-08-23T16:31:55.749Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever had the case of an incident and didn’t know what this thing you’re running in production was actually doing or how it ended up in that state?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3g6MpSKJDaCmIrVDIVdPSQ.jpeg" /><figcaption>Photo from <a href="https://unsplash.com/de/@jonathangallegos?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Jonathan Gallegos</a> on <a href="https://unsplash.com/de/fotos/MkAfH2N4l5g?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>With Zeebe (the <a href="https://docs.camunda.io/docs/components/zeebe/zeebe-overview/">process automation engine powering Camunda Platform 8</a>) we let our customer&#39;s business fly. But what if the thing which brings the business to fly, breaks? Similarly, if an airplane crashes you need something to read the flight recorder on board.</p><p>Today, I want to introduce you to a tool we created for Zeebe in order to read their “flight recorder” (state), and that support us in our incident management. In the past, if Zeebe ran into some processing problems, there was no possibility to find out the last processing state. If there was no exporter configured or they haven’t exported for a while, it was even worse since it was not clear what the last internal engine state was.</p><p>In order to shed some more light in the dark we build a tool called <a href="https://github.com/Zelldon/zdb/">zdb</a> — Zeebe Debugger. <a href="https://github.com/Zelldon/zdb/">Zdb</a> is a Java (17) CLI tool to inspect the internal state and log of a Zeebe partition. It was kicked off during the <a href="https://camunda.com/blog/2020/09/highlights-from-the-summer-hackdays-2020/#:~:text=Zeebe%20Event%20Log%20debug%20and%20inspection%20tool">Camunda Summer Hackdays in 2020</a> (by <a href="https://github.com/korthout">Nico Korthout</a>, <a href="https://github.com/deepthidevaki">Deepthi Akkoorath</a>, and <a href="https://medium.com/u/4b944b52b800">Christopher Kujawa</a>) and has been maintained and developed by <a href="https://github.com/zelldon">me</a> since then. Now reaching version <a href="https://github.com/Zelldon/zdb/releases/tag/1.8.0">1.8.0</a>, with new features (printing and filtering the log in a nicer way).</p><p>zdb allows us to find the root cause, create fixes, and be prepared for the next upcoming (since failures always happen eventually). We use it on many of our incidents if we need to take a look at the current state of Zeebe. But also when investing in certain bugs. With zdb, we finally know what Zeebe was doing and how it came into that state.</p><p>In the end, the goal is always to bring our customers back to fly and keep them there.</p><p>In the following blog post, I want to show you some examples of how we used zdb in the past to give you some inspiration on how it might help you.</p><p>Note: The output of zdb will always be JSON, which allows us to pipe it into <a href="https://jqlang.github.io/jq/">jq</a>, such that we can have nicer and filterable output. This is also used in our examples below.</p><h3>General statistics</h3><p>Often when you start working on an incident you need to get a first overview or understanding of what the state generally contains (depending on the problems of course). Here zdb can show you statistics of how many key-value pairs are stored in the internal state (in different column families).</p><pre>$ zdb state --path &lt;path-to-runtime-or-snapshot&gt; | jq<br>{<br>  &quot;DEFAULT&quot;: 1,<br>  &quot;KEY&quot;: 1,<br>  &quot;PROCESS_VERSION&quot;: 3,<br>  &quot;PROCESS_CACHE&quot;: 3,<br>  &quot;PROCESS_CACHE_BY_ID_AND_VERSION&quot;: 3,<br>  &quot;PROCESS_CACHE_DIGEST_BY_ID&quot;: 3,<br>  &quot;ELEMENT_INSTANCE_PARENT_CHILD&quot;: 6,<br>  &quot;ELEMENT_INSTANCE_KEY&quot;: 6,<br>  &quot;ELEMENT_INSTANCE_CHILD_PARENT&quot;: 6,<br>  &quot;VARIABLES&quot;: 12,<br>  &quot;TIMERS&quot;: 2,<br>  &quot;TIMER_DUE_DATES&quot;: 2,<br>  &quot;JOBS&quot;: 1,<br>  &quot;JOB_STATES&quot;: 1,<br>  &quot;JOB_DEADLINES&quot;: 1,<br>  &quot;MESSAGE_START_EVENT_SUBSCRIPTION_BY_NAME_AND_KEY&quot;: 1,<br>  &quot;MESSAGE_START_EVENT_SUBSCRIPTION_BY_KEY_AND_NAME&quot;: 1,<br>  &quot;EVENT_SCOPE&quot;: 3,<br>  &quot;EXPORTER&quot;: 2<br>}</pre><p>An experienced Zeebe engineer or power user can see here already how many processes have been deployed, how many instances, jobs, timers, messages, etc. have been created and are currently in the state. This often helps to determine where to look next.</p><p>For example, if we see there are incidents in process instances in the state and the reported failure (ongoing incident) is about not progressing process instances we would check next the <a href="https://github.com/Zelldon/zdb#inspect-incidents">open incidents</a> in the state.</p><h3>Restoring BPMN models</h3><p>There are cases where you might lose your models, or you just want to find out which model has been currently deployed or is actually executed. Here zdb can help.</p><p>First, you can print all deployed process model metadata (it will show information like process definition key, version, and name).</p><pre>zdb process list --path &lt;path-to-runtime-or-snapshot&gt; | jq<br>[<br>  {<br>    &quot;bpmnProcessId&quot;: &quot;benchmark&quot;,<br>    &quot;resourceName&quot;: &quot;bpmn/one_task.bpmn&quot;,<br>    &quot;processDefinitionKey&quot;: 2251799813685363,<br>    &quot;version&quot;: 1<br>  },<br>  {<br>    &quot;bpmnProcessId&quot;: &quot;timerProcess&quot;,<br>    &quot;resourceName&quot;: &quot;bpmn/timerProcess.bpmn&quot;,<br>    &quot;processDefinitionKey&quot;: 2251799813685249,<br>    &quot;version&quot;: 1<br>  },<br>  {<br>    &quot;bpmnProcessId&quot;: &quot;msg_one_task&quot;,<br>    &quot;resourceName&quot;: &quot;bpmn/msg_one_task.bpmn&quot;,<br>    &quot;processDefinitionKey&quot;: 2251799813685581,<br>    &quot;version&quot;: 1<br>  }<br>]</pre><p>With a specific process definition key, we can print the complete process entity. Piping it here to jq allows us to filter for the resource, and the--raw-output option returns us the resource string without quotes. We can then direct the output to a file and have the model restored (you can open it with for example the <a href="https://camunda.com/download/modeler/">Camunda Modeler</a>).</p><pre>zdb process entity 2251799813686656 --path &lt;path-to-runtime-or-snapshot&gt; \<br>|  jq --raw-output &#39;.resource&#39; &gt; model.bpmn</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*HA5dXvTNN_bAY_4nh4XQVw.png" /><figcaption>Restored Model</figcaption></figure><h3>Instances for a specific model</h3><p>Sometimes you’re interested in process instances of a specific process model.</p><p>You might have deployed a broken model and want to cancel all of the existing instances (that happened to us), but first, you need to find out all the keys of such instances.</p><p>You can use the following to print all instances for a certain process definition.</p><pre>zdb process instances 2251799813685363 --path &lt;path-to-runtime-or-snapshot&gt; | jq</pre><h3>Printing the log</h3><p>One of our most used zdb features is printing the entire log (default: as JSON).</p><pre>zdb log print --path &lt;path-to-log&gt;</pre><p>With the newest version (v1.8.0), zdb supports some built-in filters, like filtering for the process instance key. This means only records that correspond to a certain process instance are printed. Furthermore, we can limit the output now, with --fromPosition and --toPosition . You can read more about it <a href="https://github.com/Zelldon/zdb#print-log">here</a>.</p><p>Not only JSON is the supported output format. zdb can print the log in <a href="https://graphviz.org/doc/info/lang.html">dot format </a>as well, which allows tracing commands.</p><pre>zdb log print --format dot --path &lt;path-to-log&gt; &gt; output.dot</pre><p>With <a href="https://graphviz.org/">Graphviz</a> you can visualize such dot files easily</p><pre>dot -Tsvg -o output.svg output.dot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RiwyIXvyHS4WjUSuSsc3pg.png" /><figcaption>Trace of log</figcaption></figure><p>Printing and investigating the log is interesting since not all commands can be applied and are then not reflected in the state. The reasons can be many. Some might be rejected due to a wrong user input or wrong process instance state, etc. These commands and their rejections are still part of the log (if compaction hasn’t happened yet) and can give you some interesting insights.</p><p>I hope this small introduction and examples gave you some inspiration on how you can use zdb on your next potential incident or investigation related to Zeebe. If you want to know more, check out the <a href="https://github.com/Zelldon/zdb">GitHub repository.</a></p><p><em>Please leave a clap if you like the post or add a comment if you see any potential to improve it. I’m happy for any feedback. Thank you!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef0fde68aee9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drinking Our Champagne: Chaos Experiments with Zeebe against Zeebe]]></title>
            <link>https://medium.com/@zelldon91/drinking-our-champagne-chaos-experiments-with-zeebe-against-zeebe-57632dd2c280?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/57632dd2c280</guid>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[camunda]]></category>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Thu, 10 Aug 2023 19:27:58 GMT</pubDate>
            <atom:updated>2023-08-10T19:27:58.697Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*Uv4NyLziQo3xt01T_pKr6g.png" /><figcaption>Image by <a href="https://camunda.com/">Camunda</a> on <a href="https://camunda.com/blog/2023/08/automate-chaos-experiments/">Blog</a></figcaption></figure><p>At Camunda we have a mantra: <a href="https://page.camunda.com/wp-automate-any-process-anywhere">Automate Any Process, Anywhere</a>. Additionally, we’ll often say <a href="https://en.wikipedia.org/wiki/Eating_your_own_dog_food">“eat your own dog food,” or “drink your own champagne.”</a></p><p>Two years ago, I wrote an article about how we can use Zeebe to orchestrate our chaos experiments; I called it: <a href="https://zeebe-io.github.io/zeebe-chaos/2021/04/03/bpmn-meets-chaos-engineering/">BPMN meets chaos engineering</a>. That was the result of a hack day project, in which I worked alongside my colleague <a href="/service/mailto:philipp.ossler@camunda.com">Philipp Ossler</a>.</p><p>Since then, a lot of things have changed. We made a lot of improvements to our tooling, like creating our own chaos toolkit <a href="https://medium.com/@zelldon91/zbchaos-a-new-fault-injection-tool-for-zeebe-cbda56c5ba8d">zbchaos</a> to make it easier to run chaos experiments against Zeebe (which reached <a href="https://github.com/zeebe-io/zeebe-chaos/releases/tag/zbchaos-v1.0.0">v1.0</a>), improving the BPMN models in use, adding more experiments to it, etc.</p><p>Today, I want to take a closer look and show you how we automate and orchestrate our chaos experiments with Zeebe against Zeebe. After reading this you will see how beneficial it is to use Zeebe as your chaos experiment orchestrator.</p><p>You can use this knowledge in order to orchestrate your own chaos experiments, set up your own QA test suite or use Zeebe as your CI/CD framework. The use cases are endless. We will show you how you leverage the observability of the Camunda Platform stack and how it can help you to understand what is currently executed or where issues may lie.</p><p>But first, let’s start with some basics.</p><h3>Chaos engineering and experiments</h3><blockquote><em>Chaos Engineering is the discipline of experimenting on a system</em></blockquote><blockquote><em>in order to build confidence in the system’s capability to withstand turbulent conditions in production.</em></blockquote><blockquote><a href="https://principlesofchaos.org/"><em>https://principlesofchaos.org/</em></a></blockquote><p>One of the principles of chaos engineering is automating defined experiments to ensure that no regression is introduced into the system at a later stage.</p><p>A chaos experiment consists of multiple stages; three are important for automation:</p><ul><li>Verification of the steady state hypothesis</li><li>Running actions to introduce chaos</li><li>Verification of the steady state hypothesis (that it still holds or has recovered)</li></ul><p>These steps can also be cast into a BPMN model, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NDW1DlnvzUACfL1_" /><figcaption>Chaos experiment in BPMN</figcaption></figure><p>That is the backbone of our chaos experiment orchestration. Let’s take a closer look at the process models we designed and use now to automate and orchestrate our chaos experiments.</p><h3>BPMN meets chaos engineering</h3><p><em>If you are interested in the resources take a look at the corresponding GitHub repository </em><a href="https://github.com/zeebe-io/zeebe-chaos/"><em>zeebe-io/zeebe-chaos/</em></a><em>.</em></p><h3>Chaos toolkit</h3><p>The first process model is called: “chaosToolkit” because it bundles all chaos experiments together. It reads the specifications of all existing chaos experiments (the specification for each experiment is stored in a JSON file, which we will see later) and executes them one by one <a href="https://docs.camunda.io/docs/next/components/modeler/bpmn/multi-instance/">via a sequential multi-instance</a>.</p><p><em>For readers with knowledge of BPMN, be aware that in earlier versions of Zeebe it was not possible to </em><a href="https://docs.camunda.io/docs/next/components/modeler/bpmn/error-events/"><em>transfer variables with BPMN errors</em></a><em>, which is why we used return values of CallActivities and later interrupted the SubProcess.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ivI0P9qEi70mSaDN" /><figcaption>BPMN Model: ChaosToolkit</figcaption></figure><h3>Chaos experiment</h3><p>The second BPMN model describes a single chaos experiment, which is why it is called “chaosExperiment”. It has similarities (the different stages) to the simplified version above.</p><p>Here we see the three stages, verification, introducing chaos, and verification of the steady state again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NT0ajNgQU80BtM0R" /><figcaption>BPMN Model: Chaos Experiment</figcaption></figure><p>All of the <a href="https://docs.camunda.io/docs/next/components/modeler/bpmn/call-activities/">call activities</a> above are delegated to the third BPMN model.</p><h3>Action</h3><p>The third model is the most generic one. It will execute any action, which is defined in the process instance payload. The payload will be a chaos experiment specification. The specification can also contain timeouts and pause times which are reflected in the model as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oQrdqTsM_9z2_cwe" /><figcaption>BPMN Model: Action</figcaption></figure><h3>Specification</h3><p>As we have seen, the BPMN process models are quite generic and all of them are enlivened via a chaos experiment specification.</p><p>The chaos experiment specification is based on<a href="https://github.com/open-chaos/openchaos"> OpenChaos initiative</a> and the <a href="https://chaostoolkit.org/reference/api/experiment/#conventions-used-in-this-document">Chaos Toolkit specification</a>. We reused this specification to run these experiments as well with chaosToolkit (to run it locally).</p><p>An example is the following <strong>experiment.json</strong></p><pre>{<br>    &quot;version&quot;: &quot;0.1.0&quot;,<br>    &quot;title&quot;: &quot;Zeebe follower restart non-graceful experiment&quot;,<br>    &quot;description&quot;: &quot;Zeebe should be fault-tolerant. Zeebe should be able to handle followers terminations.&quot;,<br>    &quot;contributions&quot;: {<br>        &quot;reliability&quot;: &quot;high&quot;,<br>        &quot;availability&quot;: &quot;high&quot;<br>    },<br>    &quot;steady-state-hypothesis&quot;: {<br>        &quot;title&quot;: &quot;Zeebe is alive&quot;,<br>        &quot;probes&quot;: [<br>            {<br>                &quot;name&quot;: &quot;All pods should be ready&quot;,<br>                &quot;type&quot;: &quot;probe&quot;,<br>                &quot;tolerance&quot;: 0,<br>                &quot;provider&quot;: {<br>                    &quot;type&quot;: &quot;process&quot;,<br>                    &quot;path&quot;: &quot;zbchaos&quot;,<br>                    &quot;arguments&quot;: [&quot;verify&quot;, &quot;readiness&quot;],<br>                    &quot;timeout&quot;: 900<br>                }<br>            },<br>            {<br>                &quot;name&quot;: &quot;Can deploy process model&quot;,<br>                &quot;type&quot;: &quot;probe&quot;,<br>                &quot;tolerance&quot;: 0,<br>                &quot;provider&quot;: {<br>                    &quot;type&quot;: &quot;process&quot;,<br>                    &quot;path&quot;: &quot;zbchaos&quot;,<br>                    &quot;arguments&quot;: [&quot;deploy&quot;, &quot;process&quot;],<br>                    &quot;timeout&quot;: 900<br>                }<br>            },<br>            {<br>                &quot;name&quot;: &quot;Should be able to create process instances on partition 1&quot;,<br>                &quot;type&quot;: &quot;probe&quot;,<br>                &quot;tolerance&quot;: 0,<br>                &quot;provider&quot;: {<br>                    &quot;type&quot;: &quot;process&quot;,<br>                    &quot;path&quot;: &quot;zbchaos&quot;,<br>                    &quot;arguments&quot;: [&quot;verify&quot;, &quot;instance-creation&quot;, &quot;--partitionId&quot;, &quot;1&quot;],<br>                    &quot;timeout&quot;: 900<br>                }<br>            }<br>        ]<br>    },<br>    &quot;method&quot;: [<br>        {<br>            &quot;type&quot;: &quot;action&quot;,<br>            &quot;name&quot;: &quot;Terminate follower of partition 1&quot;,<br>            &quot;provider&quot;: {<br>                &quot;type&quot;: &quot;process&quot;,<br>                &quot;path&quot;: &quot;zbchaos&quot;,<br>                &quot;arguments&quot;: [&quot;terminate&quot;, &quot;broker&quot;, &quot;--role&quot;, &quot;FOLLOWER&quot;, &quot;--partitionId&quot;, &quot;1&quot;]<br>            }<br>        }<br>    ],<br>    &quot;rollbacks&quot;: []<br>}</pre><p>The first key-value pairs describe the experiment itself. The <strong>steady-state-hypothesis </strong>and its content<strong> </strong>describe the verification stage. All of the probes inside the <strong>steady-state-hypothesis </strong>are executed as actions in our third process model.</p><p>The <strong>method </strong>object<strong> </strong>is describing the chaos which should be inserted into the system. In this case, it consists of one action, restarting a follower (<a href="https://docs.camunda.io/docs/next/reference/glossary/#follower">a broker which is not leader of Zeebe partition</a>).</p><p>I don’t want to go into much detail about the specification itself, but you can find several examples of our experiments we already have defined <a href="https://github.com/zeebe-io/zeebe-chaos/tree/main/go-chaos/internal/chaos-experiments">here</a></p><h3>Automation</h3><p>Let’s imagine we have a Zeebe cluster which we want to run the experiments against. We call it Zeebe target.</p><p>As mentioned earlier, the specification is based on the <a href="https://chaostoolkit.org/reference/api/experiment/#conventions-used-in-this-document">chaos toolkit</a>. This means we can (if we have <strong>zbchaos</strong> and <strong>chaos toolkit</strong> installed) run it <strong>locally</strong> via `<strong>chaos run experiment.json</strong>`. If Zeebe is installed in Kubernetes and we have the right Kubernetes context set, this would work with <strong>zbchaos</strong> out of the box.</p><h3>Zeebe Testbench</h3><p>But we can also orchestrate that with Zeebe itself. Using a different Zeebe cluster, we call it Zeebe Testbench.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ij5itHhRr_4ctewI" /><figcaption>Chaos experiment orchestration</figcaption></figure><p>Our Zeebe Testbench cluster is in charge of orchestrating the chaos experiments. <strong>zbchaos</strong>, is a <a href="https://docs.camunda.io/docs/next/components/concepts/job-workers/">job worker</a> in this case and executes all actions. For example, verifying the healthiness of the cluster or of a node, terminating a node, creating a network partition, etc. We have seen in the chaos experiment specification above that all actions and probes are referencing <strong>zbchaos</strong> and specifying subcommands. These are executed no matter if <strong>zbchaos</strong> is used as a CLI tool directly or as a job worker. This means if you execute the chaos specification with the <strong>chaos toolkit</strong> it will execute the <strong>zbchaos</strong> CLI. If you orchestrate the experiments with Zeebe, the <strong>zbchaos</strong> workers will handle the specific actions.</p><p>From outside we are deploying the previously mentioned chaos models in Zeebe Testbench. This can happen on the setup of the Zeebe Testbench cluster (or when something changes on the models). New instances can be created either by us locally (e.g. via <a href="https://docs.camunda.io/docs/next/apis-tools/cli-client/">zbctl</a>, or any other client), via a Timer, or by our GitHub actions.</p><p>With our <a href="https://github.com/camunda/zeebe/blob/main/.github/workflows/qa-testbench.yaml">GitHub actions</a>, it is fairly easy to trigger a new Testbench run, which includes all chaos experiments, and some other tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/0*W2bn-pyKguZtsc71" /><figcaption>Zeebe Testebench run</figcaption></figure><p>To make this even greater, we even have automation to create the Zeebe Target cluster automatically. That can happen before each <strong>chaosToolkit</strong> execution. This allows us to always start with a clean state. Otherwise, errors might be hard to reproduce (and not to waste resources if no experiment is running).</p><h3>Run chaos experiments regularly</h3><p>We run our chaos experiments regularly. This means we create a <strong>chaosToolkit</strong> process instance every day and execute all chaos experiments against a new Zeebe target cluster. The creation of such process instances happens with earlier mentioned Github actions. This allows us to integrate this more in our CI which we also use in releases, meaning that we can run such tests before every release.</p><p>You can find the related GitHub action here:</p><ul><li><a href="https://github.com/camunda/zeebe/blob/main/.github/workflows/testbench.yaml">workflows/testbench.yaml</a></li><li><a href="https://github.com/camunda/zeebe/blob/main/.github/workflows/qa-testbench.yaml">workflows/qa-testbench.yaml</a></li><li><a href="https://github.com/camunda/zeebe/blob/main/.github/workflows/daily-qa.yml">workflows/daily-qa.yml</a></li></ul><p>If an experiment fails or all succeed we are notified in Slack with the help of a <a href="https://docs.camunda.io/docs/next/components/connectors/out-of-the-box-connectors/slack/">Slack Connector</a>.</p><p>This happens outside of the <strong>chaosToolkit</strong> process, which is essentially wrapped again around other larger process models to automate other parts. As I mentioned before, creating clusters, notifications, deleting clusters, etc.</p><h3>Benefits</h3><h3>Observability</h3><p>With <a href="https://camunda.com/platform/operate/">Operate</a>, you can observe a current running chaos experiment, what cluster it targets, what experiment and action it is currently executing, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e3HQKu0vIrWTFbch" /><figcaption>Operate: Running QA (ChaosToolkit process)</figcaption></figure><p>In the screenshot above, we can see a currently running chaosToolkit process instance. We can observe how many experiments have been executed (on the left in the “<strong>Instance History</strong>” green highlighted) and how many we still need to process (based on Variables).</p><p>Furthermore, we can see in the <strong>Variables</strong> tab (with the red border) what type of experiment we currently execute: “Zeebe should be fault-tolerant. We expect that Zeebe can handle non-graceful leader restarts”, and there is, even more, to dive into.</p><p>If we dig deeper into the current running experiment (we can do that via following the <a href="https://docs.camunda.io/docs/components/modeler/bpmn/call-activities/">call-activity</a> link) we can see that we are in the verification stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3MKa1P8eLoBQy6Go" /><figcaption>Operate: Running chaos experiment</figcaption></figure><p>In the verification after the chaos has been introduced (highlighted in green). We can investigate which chaos action has been executed, like here (highlighted in red): “Terminate leader of partition two non-gracefully”.</p><p>When following the call activity again we see which verification is currently executed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Yf0yYLkRAkZF44aV" /><figcaption>Operate: Running action</figcaption></figure><p>We are verifying that all pods are ready again after the leader of partition two has been terminated. This information can be extracted from the variables (highlighted in red).</p><p>As Operate keeps the history of a process, we can also take a look at past experiments. You can check and verify which actions or chaos has been introduced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uEfOIoLNQHSK3qMw" /><figcaption>Operate: Past chaos experiment</figcaption></figure><p>You can see a large history of executed chaos experiments, actions, and several other details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HuD-_rvhRJNekT0h" /><figcaption>Operate: Past action runs</figcaption></figure><p>This high degree of observability is important if something fails. Here you will see directly at which stage your experiment failed, what was executed before, etc. The <a href="https://docs.camunda.io/docs/next/components/concepts/incidents/">incident</a> message (depending on the worker) can also include a helpful note about why a stage failed.</p><h3>Drink your own champagne</h3><p>This setup might sound a bit complex at first, but once you understand the generic approach it actually isn’t and in contrast to scripting it, the BPMN automation greatly benefits observability. Furthermore, with this approach, we are still able to execute our experiments locally (which helps with development and debugging) and are able to automate them via our Zeebe Testbench cluster. It is fairly easy to use and execute new QA runs on demand. We drink our own champagne which helps us to improve our overall system, and that is actually the biggest benefit of this setup.</p><p>It just feels good to use our own product to automate our own processes. We can sit in the driver’s seat of the car we build and ship, feel what our users feel, and can improve based on that. It allows us to find bugs/issues earlier on, improve metrics and other observability measures, and build up confidence that our system can handle certain failure scenarios and situations.</p><p>I hope this was helpful to you and enlightened you a bit about what you can do with Zeebe. As I mentioned in the start the use cases and possibilities to use Zeebe are endless, and the whole Camunda Platform stack supports that pretty well.</p><p>—</p><p><em>Thanks to </em><a href="/service/mailto:christina.ausley@camunda.com"><em>Christina Ausley</em></a><em>, </em><a href="/service/mailto:deepthi.akkoorath@camunda.com"><em>Deepthi Akkoorath</em></a><em> and </em><a href="/service/mailto:sebastian.bathke@camunda.com"><em>Sebastian Bathke</em></a><em> for reviewing this blog post.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57632dd2c280" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Looks like bitnami/elasticsearch-curator is gone]]></title>
            <link>https://medium.com/@zelldon91/looks-like-bitnami-elasticsearch-curator-is-gone-db1fa2260a97?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/db1fa2260a97</guid>
            <category><![CDATA[bitnami]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[curator]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 08:16:07 GMT</pubDate>
            <atom:updated>2023-07-03T19:13:52.856Z</atom:updated>
            <content:encoded><![CDATA[<p>Maybe you have realized, since last week (mid of June 2023) the old <a href="https://hub.docker.com/r/bitnami/elasticsearch-curator/tags">bitnami/elasticsearch-curator </a>has been removed from DockerHub, which causes several issues with our elasticsearch installation.</p><p>Since I haven’t seen any announcement somewhere (which was kind of a surprise) I just want to shortly summarize what we did to overcome this, maybe it helps others as well.</p><p>We had quite a hard time with our benchmarks and clusters, since elasticsearch was filling up and caused several issues. Normally we track the throughput and latency of several clusters in one dashboard, which doesn’t look healthy end of last week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C4q3r3VaI2rHT9t5k93f_g.png" /></figure><p>We realized quickly that curator cronjobs were no longer running and crash loop because the images were no longer available.</p><p>You can also reproduce this via:</p><pre>$ bashdocker pull bitnami/elasticsearch-curator:5.8.4<br>Error response from daemon: pull access denied for bitnami/elasticsearch-curator, repository does not exist or may require &#39;docker login&#39;: denied: requested access to the resource is denied</pre><p>Turned out that the image has been renamed to <a href="https://hub.docker.com/r/bitnami/elasticsearch-curator-archived">https://hub.docker.com/r/bitnami/elasticsearch-curator-archived</a></p><pre>$ docker pull bitnami/elasticsearch-curator-archived:5.8.4<br>5.8.4: Pulling from bitnami/elasticsearch-curator-archived<br>Digest: sha256:46c98206dfaef81705d9397bd3d962d1505c8cfe9437f86ea0258d5cbef89e7f<br>Status: Downloaded newer image for bitnami/elasticsearch-curator-archived:5.8.4<br>docker.io/bitnami/elasticsearch-curator-archived:5.8.4</pre><p>If you use helm charts (like we do) and have a cronjob defined in the helm charts it will not help to upgrade the charts. The reason is that j<a href="https://github.com/helm/helm/issues/7725#issuecomment-1038280907">obs, cronjobs, etc. are immutable</a>.</p><p>You have to delete the job/cronjob and do a helm upgrade with--reuse-valuesand setting the right curator image.</p><p>If you use <a href="https://github.com/camunda/camunda-platform-helm">our charts</a> (camunda-platform-helm) you have to set -set camunda-platform.retentionPolicy.image.repository=bitnami/elasticsearch-curator-archived to use the new curator image.</p><pre>helm upgrade \<br> &quot;$releaseName&quot; &lt;YOUR-CHART&gt; \<br> --reuse-values \<br> --set camunda-platform.retentionPolicy.image.repository=bitnami/elasticsearch-curator-archived</pre><p>As an alternative, you can recreate the installed helm releases. To do so you can use the following script:</p><pre># we had several clusters to fix so this was part of a loop<br>ns=&quot;YOUR NAMESPACE&quot; <br># release name is in our case the namespace name<br>releaseName=&quot;$ns&quot;<br># Get the values for the installed chart release (to reuse them)<br>values=$(helm get values “$releaseName” --namespace “$ns” -o yaml); <br><br># You can store the values into a separate file to be on the safe side<br>echo &quot;$values&quot; &gt; &quot;$ns-values.yaml&quot;<br># ...<br># You could either set the curator image now here in the values<br># or set it directly on installation<br># ...<br># Uninstall the chart<br>helm uninstall &quot;$releaseName&quot; --namespace &quot;$ns&quot;<br># Install the chart inject values via stdin<br>echo &quot;$values&quot; | helm install &quot;$releaseName&quot; &lt;YOUR-CHART&gt; --namespace &quot;$ns&quot; --values -</pre><p>Another thing we run into was that elasticsearch was in on some cases soo full that it didn’t even recover and was not able to free up space (with a curator). Later we found out that you need to increase the disk a bit, such that elasticsearch can recover and curator can free up space.</p><p>If you ask why this change happened (renaming of the docker image), I haven’t found any resources for it. The current assumption is that the curator is deprecated with elasticsearch 8 and <a href="https://discuss.elastic.co/t/curator-and-elasticsearch-8/316550">likely will not work anymore with 8.x</a>.</p><p>But if you still use a lower version, you might still want or need to use the curator so I hope this will help someone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db1fa2260a97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zeebe, or How I learned To Stop Worrying And Love Batching]]></title>
            <link>https://medium.com/@zelldon91/zeebe-or-how-i-learned-to-stop-worrying-and-love-batching-17396891a040?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/17396891a040</guid>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[camunda]]></category>
            <category><![CDATA[zeebe]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[batch-processing]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Sat, 04 Mar 2023 09:44:55 GMT</pubDate>
            <atom:updated>2023-03-13T15:04:30.163Z</atom:updated>
            <content:encoded><![CDATA[<h3>Zeebe, or How I learned To Stop Worrying And Love Batch Processing</h3><p><em>Hi, I’m Chris, Senior Software Engineer at Camunda. I have worked now for around seven years at Camunda and on the Zeebe project for almost six years, and was recently part of a hackday effort to improve Zeebe’s process execution latency</em></p><p>In the past, we have heard several reports from users where they have described that the process execution latency of <a href="https://camunda.com/platform/zeebe/">Zeebe</a>, our cloud-native workflow decision engine for <a href="https://camunda.com/platform/">Camunda Platform 8</a>, is sometimes sub-optimal. Some of the reports raised that the latency between certain tasks in a process model is too high, others that the general process instance execution latency is too high. This of course can also be highly affected by the used hardware and wrong configurations for certain use cases, but we also know we have something to improve.</p><p>At the beginning of this year and after almost three years of COVID-19, we finally sat together in a meeting room with whiteboards to improve the situation for our users. We called that performance hackdays. It was a nice, interesting, and fruitful experience.</p><h3>Basics</h3><p>To dive deeper into what we tried and why, we first need to elaborate on what process instance execution latency means, and what influences it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/0*WelxptAuI7RWHgMw" /></figure><p>The image above is a <a href="https://docs.camunda.io/docs/next/components/concepts/processes/">process model</a>, from which we can create an instance. The execution of such an instance will go from the start to the end event; this is the process execution latency.</p><p><em>Since Zeebe is a complex distributed system, where the process engine is based on a distributed streaming platform, there are several influencing factors for the process execution latency. During our performance hackdays, we tried to sum up all potential factors and find several bottlenecks which we can improve. In the following post, I will try to summarize this on a high level and mention them shortly.</em></p><h4>Stream processing</h4><p>To execute such a process model, as we have seen above, Zeebe uses a concept called <a href="https://docs.camunda.io/docs/next/components/zeebe/technical-concepts/internal-processing/#stateful-stream-processing">stream processing</a>.</p><p>Each element in the process <a href="https://docs.camunda.io/docs/next/components/zeebe/technical-concepts/internal-processing/#state-machines">has a specific lifecycle</a>, which is divided into the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/0*KAV3RA8qCxr3lLtK" /><figcaption>BPMN Elements Lifecycle divided into Command/Events</figcaption></figure><p>One command asks to change the state of a certain element and an event that confirms the state change. Termination can happen when elements are canceled either internally by events or outside by users.</p><p>Commands drive the execution of a process instance. When Zeebe’s stream processor processes a command, state changes are applied (e.g. process instances are modified). Such modifications are confirmed via follow-up events. To split the execution into smaller pieces, not only are follow-up events produced, but also follow-up commands. All of these follow-up records are persisted. Later, the follow-up commands are further processed by the stream processor to continue the instance execution. The idea behind that is that these small chunks of processing should help to achieve high concurrency by alternating execution of different instances on the same partition.</p><h4>Persistence</h4><p>Before a new command on a partition can be processed, it must be replicated to a quorum (typically majority) of nodes. This procedure is called commit. Committing ensures a record is durable, even in case of complete data loss on an individual broker. The exact semantics of <a href="https://docs.camunda.io/docs/components/zeebe/technical-concepts/clustering/#commit">committing</a> are defined by the <a href="https://raft.github.io/">raft protocol</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YJh5jPKwTFXkQL8b" /><figcaption>Source: <a href="https://docs.camunda.io/docs/components/zeebe/technical-concepts/clustering/#commit">https://docs.camunda.io/docs/components/zeebe/technical-concepts/clustering/#commit</a></figcaption></figure><p>Committing of such records can be affected by network latency, for sending the records over the wire. But also by disk latency since we need to persist the records on disk on a quorum of nodes before we can mark the records as committed.</p><h4>State</h4><p>Zeebe’s state is stored in <a href="https://rocksdb.org/">RocksDB</a>, which is a key-value store. RocksDB persists data on disk with a <a href="https://en.wikipedia.org/wiki/Log-structured_merge-tree">log-structured merge tree</a> (LSM Tree) and is made for fast storage environments.</p><p>The state contains information about deployed process models and current process instance executions. It is separated per partition, which means a RocksDB instance exists per partition.</p><h3>Performance hackdays</h3><p>When we started with the performance hackdays, we already had necessary infrastructure to run benchmarks for our improvements. We made heavy use of the <a href="https://github.com/camunda-community-hub/camunda-8-benchmark">Camunda Platform 8 benchmark toolkit</a> maintained by <a href="https://github.com/falko">Falko Menge</a>.</p><p>Furthermore, we run weekly benchmarks (the so-called medic benchmark) where we test for throughput, latency, and general stability. Benchmarks are run for four weeks to detect potential bugs, regressions, memory leaks, performance regressions, and more as early as possible. This, all the infrastructure around it (like <a href="https://github.com/camunda/zeebe/tree/main/monitor">Grafana dashboards</a>,) and knowledge about how our system performs were invaluable to make such great progress during our hackdays.</p><h4>Measurement</h4><p>We measured our results continuously, and this is necessary to see if you are on the right track. For every small proof of concept (POC), we ran a new benchmark:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yYeZs1hXlB_CPNbf" /><figcaption><em>Screenshot of benchmarks over the week</em></figcaption></figure><p>In our benchmark, we used a process based on some user requirements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ByPWm21YnUTKM4ol" /><figcaption>Benchmark Process</figcaption></figure><p>Our target was a throughput of around 500 process instances per second (PI/s) with a process execution latency goal for one process instance under one second for the 99th percentile (p99). P99, meaning 99% of all process instance executions should be executed in under one second.</p><p>The benchmarks have been executed in the Google Kubernetes Engine. For each broker node, we assigned one <a href="https://cloud.google.com/compute/docs/general-purpose-machines"><strong>n2-standard-8</strong></a> node to reduce the influence of other pods running on the same node.</p><p>Each broker pod had the following configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*QFphuV03BuGulgTt6MM9Gg.png" /><figcaption>Benchmark configuration</figcaption></figure><p>There were also some other configurations we played around with during our different experiments, but the above were the general ones. We had eight brokers running, which gives us the following partition distribution:</p><pre>$ ./partitionDistribution.sh 8 24 4<br>Distribution:<br>P\N| N 0| N 1| N 2| N 3| N 4| N 5| N 6| N 7<br>P 0| L  | F  | F  | F  | -  | -  | -  | -  <br>P 1| -  | L  | F  | F  | F  | -  | -  | -  <br>P 2| -  | -  | L  | F  | F  | F  | -  | -  <br>P 3| -  | -  | -  | L  | F  | F  | F  | -  <br>P 4| -  | -  | -  | -  | L  | F  | F  | F  <br>P 5| F  | -  | -  | -  | -  | L  | F  | F  <br>P 6| F  | F  | -  | -  | -  | -  | L  | F  <br>P 7| F  | F  | F  | -  | -  | -  | -  | L  <br>P 8| L  | F  | F  | F  | -  | -  | -  | -  <br>P 9| -  | L  | F  | F  | F  | -  | -  | -  <br>P 10| -  | -  | L  | F  | F  | F  | -  | -  <br>P 11| -  | -  | -  | L  | F  | F  | F  | -  <br>P 12| -  | -  | -  | -  | L  | F  | F  | F  <br>P 13| F  | -  | -  | -  | -  | L  | F  | F  <br>P 14| F  | F  | -  | -  | -  | -  | L  | F  <br>P 15| F  | F  | F  | -  | -  | -  | -  | L  <br>P 16| L  | F  | F  | F  | -  | -  | -  | -  <br>P 17| -  | L  | F  | F  | F  | -  | -  | -  <br>P 18| -  | -  | L  | F  | F  | F  | -  | -  <br>P 19| -  | -  | -  | L  | F  | F  | F  | -  <br>P 20| -  | -  | -  | -  | L  | F  | F  | F  <br>P 21| F  | -  | -  | -  | -  | L  | F  | F  <br>P 22| F  | F  | -  | -  | -  | -  | L  | F  <br>P 23| F  | F  | F  | -  | -  | -  | -  | L</pre><p>Each broker node had 12 partitions assigned. We used a replication factor of four because we wanted to mimic the <a href="https://camunda.com/blog/2022/06/how-to-achieve-geo-redundancy-with-zeebe/">geo redundancy</a> for some of our users, which had certain process execution latency requirements. The geo redundancy introduces network latency into the system by default. We wanted to reduce the influence of such network latency to the process execution latency. To make it a bit more realistic, we used <a href="https://chaos-mesh.org/">Chaos Mesh</a> to introduce a network latency of 35ms between two brokers, resulting in a round-trip time (RTT) of 70ms.</p><p>To run with an evenly distributed partition leadership, we used the <a href="https://docs.camunda.io/docs/next/self-managed/zeebe-deployment/operations/rebalancing/">partitioning rebalancing API</a>, which Zeebe provides.</p><h4>Theory</h4><p>Based on the benchmark process model above, we considered the impact of commands and events on the process model (and also in general).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H9mAOR1ftRGIQHFZ" /><figcaption>Whiteboard session: Drawing commands/events</figcaption></figure><p>We calculated around 30 commands are necessary to execute the process instance from start to end.</p><p>We tried to summarize what affects the processing latency and came to the following formula:</p><pre>PEL = X * Commit Latency + Y * Processing Latency + OH<br>PEL - Process Execution Latency<br>OH - Overhead, which we haven&#39;t considered (e.g. Jobs * Job Completion Latency)</pre><p>When we started, <strong>X</strong> and <strong>Y</strong> were equal, but the idea was to change factors. This is why we split them up. The other latencies were based on:</p><pre>Commit Latency = Network Latency + Append Latency<br>Network Latency = 2 * request duration<br>Append Latency = Write to Disk + Flush<br>Processing Latency = Processing Command (apply state changes) <br>                   + Commit Transaction (RocksDB) <br>                   + execute side effects</pre><p>Below is a picture of our whiteboard session, where we discussed potential influences and what potential solution could mitigate which factor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B0IHT-ewXvhG7PAUH0-bwg.png" /><figcaption>Whiteboard session: Discussion potential factors and influences</figcaption></figure><h3>Proof of concepts</h3><p>Based on the formula, it was a bit more clear to us what might affect the process execution latency and where it might make sense to change or reduce time. For example, reducing the append latency affects commit latency and will affect process execution latency. Additionally, reducing the factor of how often commit latency is applied will highly affect the result.</p><h4>Append and commit latency</h4><p>Before we started with the performance hackdays, there was one configuration already present which we built <a href="https://github.com/camunda/zeebe/pull/5576">more than two years ago </a>and made available via an experimental feature: <a href="https://github.com/camunda/zeebe/blob/8.1.0/broker/src/main/java/io/camunda/zeebe/broker/system/configuration/ExperimentalCfg.java#L26">the disabling of the raft flush</a>. We have seen several users applying it to reach certain performance targets, but it comes with a cost. It is not safe to use it, since on fail-over certain guarantees of raft no longer apply.</p><p>As part of the hackdays we were interested in a similar performance, but with more safety. This is the reason why we tried several different other possibilities but also compared that with disabling the flush completely.</p><p><strong>Flush improvement</strong></p><p>In one of our POC’s, we tried to flush on another thread. This gave a similar performance as with completely disabling it, but it also has similar safety issues. Combining the async flush with awaiting the completion before committing brought back the old performance (base) and the safety. This was no solution.</p><p>Implementing a batch flush (flush only after a configured threshold,) having this in a separate thread, and waiting for the completion degraded the performance. However, we again had better safety than with disabling flush.</p><p>We thought about flushing async in a batch, without waiting for commit and making this configurable. This would allow users to trade safety versus performance.</p><p><strong>Write improvement</strong></p><p>We had a deeper look into system calls such as <a href="https://man7.org/linux/man-pages/man2/madvise.2.html">madvise</a>.</p><p>Zeebe stores its log in a segmented journal which is memory mapped at runtime. The OS manages what is in memory at any time via the page cache, but does not know the application itself. The <strong>madvise</strong> system call allows us to provide hints to the OS on when to read/write/evict pages.</p><p>The idea was to provide hints to reduce memory churn/page faults and reduce I/O</p><p>We tested with <strong>MADV_SEQUENTIAL</strong>, hinting that we will access the file sequentially and a more aggressive read-ahead should be performed (while previous pages can be dropped sooner).</p><p>Based on our benchmarks, we hadn’t seen much difference under low/mid load. However, read IO was greatly reduced under high load. We have seen slightly increased write I/O throughput under high load due to reduced IOPS contention. In general, there was a small improvement only in throughput/latency. Surprisingly, still it showed similar page faults as before.</p><h4>Reduce transaction commits</h4><p>Based on our formula above, we can see that the processing latency is affected by the RocksDB write and transaction commit duration. This means reducing one of these could benefit the processing latency.</p><p><strong>State directory separation</strong></p><p>Zeebe stores the current state (runtime) and snapshots on different folders on disk (under the same parent). When a Zeebe broker restarts, we recreate the state (runtime) every time from a snapshot. This is to avoid having data in the state which might not have been committed yet.</p><p>This means we don’t necessarily need to keep the state (runtime) on disk, and RocksDB does a lot of IO-heavy work which might not be necessary. The idea was to separate the state directory in a way that it can be separately mounted (in Kubernetes) such that we can run RocksDB in <a href="https://www.kernel.org/doc/html/v5.18/filesystems/tmpfs.html">tmpfs</a>, for example.</p><p>Based on our benchmarks, only p30 and lower have been improved with this POC:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eXdsseoUCYkzRRWK" /></figure><p><strong>Disable WAL</strong></p><p>RocksDB has a write-ahead log to be crash resistant. This is not necessary for us to recreate the state every time. We considered disabling it, we will see later in this post what influence it has. It is a <a href="https://github.com/camunda/zeebe/blob/8.1.0/dist/src/main/config/broker.standalone.yaml.template#L757">single configuration</a>, which is easy to change.</p><h4>Processing of uncommitted</h4><p>We mentioned earlier that we have thought about changing the factor of how many commits influence the overall calculation. What if we process commands already, even if they are not committed yet, and only send results to the user if the commit of the commands is done?</p><p>We worked on a POC to implement uncommitted processing, but it was a bit more complex than we thought due to the buffering of requests, etc. This is why we didn’t find a good solution during our hackdays. We still ran a benchmark to verify how it would behave:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qO7KyPxNx_tDjkAc" /></figure><p>The results were quite interesting and promising, but we considered them a bit too good. The production ready implementation might be different, since we have to consider more edge-cases.</p><h4>Batch processing</h4><p>Part of another POC we did was something we called <strong>batch processing.</strong> The implementation was rather easy.</p><p>The idea was to process the follow-up commands directly and continue the execution of an instance until no more follow-up commands are produced. This normally means we have reached a wait state, like a service task. Camunda Platform 7 users will know this behavior, <a href="https://docs.camunda.org/manual/latest/user-guide/process-engine/transactions-in-processes/#wait-states">as this is the Camunda Platform 7 default</a>. The result was promising as well:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ROVY8b46DvI3MhZZ" /></figure><p>In our example process model above, this would reduce the factor of commit latencies from ~30 commands to 15, which is significant. The best IO you can do, however, is no IO.</p><h4>Combining the POCs</h4><p>By combining several POCs, we reached our target line which showed us that it is possible and gave us some good insights on where to invest in order to improve our system further in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xzdFc_SWUJEtcm6w" /></figure><p>The improvements did not just improve overall latency of the system. In our weekly benchmarks we had to increase the load because the system was able to reach higher throughput. Before we reached ~133 (on avg) process instances per second (PI/s) over three partitions, now 163 PI/s (on avg) while also reducing the latency by a factor of 2.</p><h3>Next</h3><p>In the last weeks, we took several ideas from the hackdays to implement some production-ready solutions for Zeebe 8.2. For example:</p><ul><li><a href="https://github.com/camunda/zeebe/issues/11455">Disabling WAL per default</a></li><li><a href="https://github.com/camunda/zeebe/issues/11416">Implement batch processing</a></li><li><a href="https://github.com/camunda/zeebe/issues/11423">Make disabling raft flush more safe</a></li><li><a href="https://github.com/camunda/zeebe/issues/11494">Direct message correlation on the same partition</a></li></ul><p>We plan to work on some more like:</p><ul><li><a href="https://github.com/camunda/zeebe/issues/6044">Make state directory configurable</a></li><li><a href="https://github.com/camunda/zeebe/issues/11377">Advise OS on mmap usage</a></li><li><a href="https://github.com/camunda/zeebe/issues/11488">Configurable raft flush interval</a></li></ul><p><strong>You can expect some better performance with the 8.2 release; I’m really looking forward to April! :)</strong></p><p>Thanks to all participants of the hackdays for the great and fun collaboration, and to our manager (<a href="https://github.com/megglos">Sebastian Bathke</a>) who made this possible. It was a really nice experience.</p><p><strong>Participants (alphabetically sorted):</strong></p><ul><li><a href="https://github.com/Zelldon">Christopher Zell (myself)</a></li><li><a href="https://github.com/deepthidevaki">Deepthi Devaki Akkoorath</a></li><li><a href="https://github.com/falko">Falko Menge</a></li><li><a href="https://github.com/npepinpe">Nicolas Pepin-Perreault</a></li><li><a href="https://github.com/oleschoenburg">Ole Schönburg</a></li><li><a href="https://github.com/romansmirnov">Roman Smirnov</a></li><li><a href="https://github.com/megglos">Sebastian Bathke</a></li></ul><p><em>Thanks to all the reviewers of this blog post: </em><a href="https://github.com/cmausley"><em>Christina Ausley</em></a>, <a href="https://github.com/deepthidevaki"><em>Deepthi Devaki Akkoorath</em></a>, <a href="https://github.com/npepinpe"><em>Nicolas Pepin-Perreault</em></a>, <a href="https://github.com/oleschoenburg"><em>Ole Schönburg</em></a><em>, </em><a href="https://github.com/saig0"><em>Philipp Ossler</em></a><em> and </em><a href="https://github.com/megglos"><em>Sebastian Bathke</em></a></p><p><em>This post originally appeared on </em><a href="https://camunda.com/blog/2023/03/zeebe-batch-processing/"><em>the Camunda blog</em></a><em>. Check it out for the latest insights and news on everything about Camunda and process orchestration.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17396891a040" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting Camunda Platform 8 with GitHub Workflows]]></title>
            <link>https://medium.com/@zelldon91/connecting-camunda-platform-8-with-github-workflows-ee1f91488ad3?source=rss-4b944b52b800------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee1f91488ad3</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[zeebe]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[camunda]]></category>
            <dc:creator><![CDATA[Christopher Kujawa]]></dc:creator>
            <pubDate>Fri, 23 Dec 2022 14:43:24 GMT</pubDate>
            <atom:updated>2022-12-23T14:43:24.098Z</atom:updated>
            <content:encoded><![CDATA[<h3>Background</h3><p>In the Zeebe Team we drink our own champagne every day and based on this we model a lot of our engineering processes via BPMN. We of course not only model we also try as best to automate them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHtEclBV8NkS093gVSmDxA.png" /><figcaption>Release Process — QA</figcaption></figure><p>The above process is one part of our release process where we need to run several QA actions, most of which are manual (user) tasks. This is where the engineers need to set up benchmarks, start E2E tests, etc. We often thought it would be great to automate this more. Today is the day.</p><p>With Camunda 8 we launched a new project <a href="https://docs.camunda.io/docs/components/connectors/introduction-to-connectors/">called Connectors</a>.</p><blockquote>A Connector is a reusable building block that performs the integration with an external system and works out of the box.</blockquote><blockquote><a href="https://docs.camunda.io/docs/components/connectors/introduction-to-connectors/">https://docs.camunda.io/docs/components/connectors/introduction-to-connectors/</a></blockquote><p>Our SaaS offering comes with some <a href="https://docs.camunda.io/docs/components/connectors/introduction-to-connectors/">pre-built connectors</a> which you can use and assign during modeling.</p><p>Today I want to show you by example how we can leverage the REST connector to connect via the GitHub API to run GitHub Workflows. This will help us to automate our QA tasks.</p><h3>Run GitHub Workflows via Camunda Cloud</h3><h4>A triggerable GitHub Workflow</h4><p>As a first step, we need to adjust the GitHub workflow that we want to trigger from outside. On that workflow we need to add the following:</p><pre>on:<br>  repository_dispatch: {}<br></pre><blockquote>You can use the GitHub API to trigger a webhook event called <a href="https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads/#repository_dispatch">repository_dispatch</a> when you want to trigger a workflow for activity that happens outside of GitHub</blockquote><blockquote><a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch">https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch</a></blockquote><p>We will use the following <a href="https://github.com/Zelldon/camunda-github-connector-example/blob/main/.github/workflows/main.yml">example workflow</a>:</p><pre># https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch<br>on:<br>  repository_dispatch: {}<br><br>jobs:<br>  run_greeter:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - env:<br>          MESSAGE: ${{ github.event.client_payload.message }}<br>        run: echo $MESSAGE</pre><p>In order to trigger this workflow we need to add a new personal access token to our GitHub account <a href="https://github.com/settings/tokens">here</a>. It should have a repo and workflow scope.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*xOh11r7eZ6SibqM_WAhv9w.png" /><figcaption>GitHub — Creating personal access token</figcaption></figure><p>Store this token somewhere safe, we need it later.</p><h3>Automate your workflow</h3><p>After we have set up our workflow and token we can start automating it via the Camunda Platform 8 SaaS offering. If you don&#39;t have an account yet, sign up <a href="https://camunda.com/">here</a> for a trial account.</p><h4>Secret creation</h4><p>Before we start with our process model we first need to add the previously create GitHub token to our Camunda 8 cluster. You can find a tab called Connector Secrets where you can add secrets. This created secret will be available for our connector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*f3Mz0H39lwXpIugQB2oung.png" /><figcaption>Camunda Platform — Create New Secret</figcaption></figure><h4>Model connector</h4><p>As a next step, we go to the Camunda Modeler which is built-in in the Camunda Platform 8 SaaS offering. Either you have already a process model which you want to modify or you create a new one.</p><p>In our example, we add a new Activity to our model and select the REST Connector as the connector template. When you created an activity and select it you can see on the right an blue button, to select an connector template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQxec0yXeakZUkHasZd82w.png" /><figcaption>Camunda Modeler — Select Template</figcaption></figure><p>In the REST connector properties (on the right side of the screen) we need to set the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aE2aMCrS0iTO638ns6Wa1g.png" /><figcaption>Camunda Modeler — Configure REST Connector</figcaption></figure><h4>Authentication:</h4><p>We choose as authentication type Bearer Token Auth and define the Bearer Token via secrets.GITHUB_TOKEN. The value of this secret will be passed in during runtime. This is the secret that we created earlier. More about this topic you can read <a href="https://docs.camunda.io/docs/components/console/manage-clusters/manage-secrets/">here</a>.</p><h4>HTTP Endpoint:</h4><p>As method we have to choose POST the URL will be https://api.github.com/repos/&lt;user&gt;/&lt;repo&gt;/dispatches here you need to replace the user and repo with appropriate values. The HTTP Headers need to be</p><pre>{<br> &quot;Accept&quot;: &quot;application/vnd.github.everest-preview+json&quot;<br>}</pre><h4>Payload:</h4><p>In the payload which we want to send we can specify different properties, like the client_payload This is something the GitHub workflow can directly make use of, we will see that later in action.</p><pre>{<br>    &quot;event_type&quot;: &quot;greet&quot;,<br>    &quot;client_payload&quot;: {<br>      &quot;message&quot;: &quot;Happy Holidays from Camunda Cloud&quot;<br>    }<br>  }</pre><h4>Response Mapping:</h4><p>In order to see what was returned by the GitHub API we define a result variable as outputThis is the name of the variable where the response will be stored into.</p><h3>Executing our automation</h3><p>When we deploy this example model (via clicking on the Deploy diagram) and start an instance of it, we can check in Operate the running instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JWDB6oNzmshwKWpBt7V71A.png" /><figcaption>Operate — Executed instance</figcaption></figure><p>We can see that the tasks with the Connector was already executed, and we can see the result of the GitHub API in the outputvariable. It returned an 204 status code.</p><p>In our GitHub Repo under the Actions tab, we can see the executed workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gaUmjcEuqlb9iLa28AeO6A.png" /></figure><p>and it says: <strong>Happy Holidays From Camunda Cloud 🎅</strong></p><h3>Closing</h3><p>As we can see it is fairly simple to connect Camunda Platform 8 with an external service, which supports an HTTP API, like the GitHub API.</p><p>I hope I can make use of this soon in our automation. Probably next year :)</p><p>I hope you liked the blog post and I wish you all happy holidays and a new years eve. 🎉</p><h4>Resources</h4><ul><li><a href="https://github.com/Zelldon/camunda-github-connector-example">Example repo</a></li><li><a href="https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/rest/#create-a-rest-connector-task">REST connector </a>docs</li><li><a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#repository_dispatch">Repository dispatch docs</a></li><li><a href="https://blog.knoldus.com/trigger-a-github-action-with-an-http-request/">Thanks to this blog post I was able to connect to GitHub API quite quickly</a></li><li><a href="https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-a-repository-dispatch-event">REST API dispatch</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee1f91488ad3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>