<?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 Eugene Paniot on Medium]]></title>
        <description><![CDATA[Stories by Eugene Paniot on Medium]]></description>
        <link>https://medium.com/@e.paniot?source=rss-b8c5eee83fd3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fBwiZgeZH9WV_KmzDzNCRw.png</url>
            <title>Stories by Eugene Paniot on Medium</title>
            <link>https://medium.com/@e.paniot?source=rss-b8c5eee83fd3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:12:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@e.paniot/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[Chasing throughput: What I learned benchmarking an HTTP/2 tunnel in Go]]></title>
            <link>https://medium.com/@e.paniot/chasing-throughput-what-i-learned-benchmarking-an-http-2-tunnel-in-go-7e523db0610e?source=rss-b8c5eee83fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e523db0610e</guid>
            <category><![CDATA[http2]]></category>
            <category><![CDATA[high-performance]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Eugene Paniot]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 15:50:08 GMT</pubDate>
            <atom:updated>2025-12-05T15:50:08.640Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<p>When you build a high‑throughput HTTP/2 tunnel in Go, it is very easy to blame “the tunnel” when numbers don’t look right. I went down that path, and it turned into a useful case study in:</p><ul><li>How misleading localhost benchmarks can be (especially on mac);</li><li>Where CPU time actually goes in a modern HTTPS tunnel;</li><li>How TCP buffer tuning and tunnel fan‑out affect memory and throughput.</li></ul><p>These experiments are not synthetic benchmarks for their own sake: they come from developing a <strong>custom inference ingress server </strong>in Go for AI workloads. Conceptually, it plays a similar role to the “inference gateway” patterns described for Gateway API extensions (for example, the endpoint‑picker based approach in <a href="https://kgateway.dev/blog/deep-dive-inference-extensions/">Deep Dive into the Gateway API Inference Extension</a>), but focuses heavily on maximising raw HTTP/2 over TLS throughput between edge and model‑serving backends.</p><p>This article summarises what I measured, what the profiles showed, and the settings that ended up working best in practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*_5vU4tAiYDlkPmLhqpxwKg.png" /></figure><h3>Mac: When localhost benchmarks lie</h3><p>My first tests were all on mac, doing large binary downloads over:</p><ul><li>A <strong>direct HTTP server </strong>(no tunnel);</li><li>A <strong>Go HTTP/2 over TLS tunnel.</strong></li></ul><p>On localhost I saw:</p><ul><li><strong>1 tunnel: </strong>~430 MByte/s;</li><li><strong>2 tunnels: </strong>~147 MByte/s each (~294 MByte/s total), even though a single direct curl to the app could do <strong>~1600 MByte/s.</strong></li></ul><p>At first glance, it looked like adding tunnels reduced total throughput and that the tunnel stack was the bottleneck.</p><p>But comparing with direct app benchmarks:</p><ul><li><strong>1 direct curl app: </strong>~1600 MByte/s;</li><li><strong>2 direct curls app: </strong>~800 MByte/s each (~1600 MByte/s total).</li></ul><p>This strongly suggested a shared localhost limit on mac loopback of about <strong>1.6 GB/s</strong>, which then gets divided across connections! <em>The tunnel path also uses several TCP connections in series, so the loopback budget is effectively split across those hops.</em></p><p>Roughly:</p><ul><li>Mac loopback budget: ~1600 MByte/s;</li><li>3+ TCP links in the tunnel chain;</li><li>Theoretical per‑link budget: ~1600/3 = ~530 MByte/s;</li><li>Measured per‑tunnel: <strong>~430 MByte/s<em> </em></strong><em>(about 80% of that, which is reasonable after HTTP2 protocol and TLS overhead).</em></li></ul><p><strong>Conclusion: </strong>On mac, localhost is the bottleneck.</p><h3>Linux: Removing the loopback ceiling</h3><p>To get a clearer picture, I repeated the tests on a Linux machine with much faster local I/O and no obvious loopback cap.</p><p>Direct to the app:</p><ul><li><strong>1 direct connection: </strong>~9142 MByte/s;</li><li><strong>2 direct connections: </strong>~7700 MByte/s each (~15400 MByte/s total).</li></ul><p>Through the Go HTTP/2 over TLS tunnel:</p><ul><li><strong>1 tunnel: </strong>~1656 MByte/s (~18% of direct);</li><li><strong>2 tunnels: </strong>~1158 MByte/s each (~2316 MByte/s total).</li></ul><p>Total throughput increased by about <strong>40% </strong>when adding the second tunnel.</p><p>So on Linux:</p><ul><li>The tunnel <strong>does </strong>scale with additional tunnels;</li><li>The mac behavior was a test‑environment artifact, not a tunnel design flaw.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*YBispaTiViwa7RSX1DAT2A.png" /></figure><h3>Profiling the tunnel: Where the CPU actually goes</h3><p>On Linux I captured CPU profiles for both the <strong>agent </strong>and the <strong>gateway </strong>processes during sustained high‑throughput transfers.</p><p>Key findings from the profiles:</p><ol><li><strong>Syscalls dominate (~45–50% CPU);</strong></li></ol><p>Both processes spend about half their time in syscall.Syscall6 and related I/O wait paths. For a proxy that is constantly moving bytes, this is expected and essentially unavoidable.</p><p><strong>2. TLS costs ~20% of CPU, but is not the main bottleneck;</strong></p><p>With hardware‑accelerated AES‑GCM, this is actually a good result.</p><p><strong>3. Memory copies are significant;</strong></p><p>Most of this is attributable to HTTP/2&#39;s internal dataBuffer implementation and the general buffering chain.</p><p><strong>In other words, the tunnel is mostly:</strong></p><ul><li>Waiting on I/O (syscalls);</li><li>Encrypting/decrypting with AES‑GCM;</li><li>Copying data between buffers.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*Bu30Uja695ykxIoxISTluA.png" /></figure><h3>The memory copy chain</h3><p>Looking at the profiles and code paths, the ingress runtime.memmove usage is largely caused by the HTTP/2 data path. A simplified view of the copy chain for a large response looks like this:</p><ol><li>App writes response to its TCP socket (<strong>copy #1</strong>);</li><li>Agent reads from TCP into a buffer (<strong>copy #2</strong>);</li><li>Agent’s HTTP/2 server writes that data into an internal data buffer (<strong>copy #3</strong>);</li><li>TLS layer encrypts and writes to its own buffers (<strong>copy #4</strong>);</li><li>Encrypted data goes to the TCP send buffer (<strong>copy #5</strong>);</li><li>Gateway receives from TCP and TLS decrypts into buffers (<strong>copy #6</strong>);</li><li>Gateway’s HTTP/2 transport data buffer reassembles data for the handler (<strong>copy #7</strong>);</li></ol><p>Each layer (HTTP/1.1, HTTP/2, TLS, kernel) has its own view of the world and its own buffers. That shows up in runtime.memmove and http2.(*dataBuffer).Write/Read in profiles.</p><p>To really reduce these copies you would have to significantly change how HTTP/2 and TLS are wired together, which in practice would mean forking or replacing parts of the standard HTTP/2 stack. For this project, that was out of scope, so the focus shifted to <strong>reasonable tunings </strong>rather than invasive rewrites.</p><h3>TCP buffer tuning: Searching for the sweet spot</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdzMNFkj_Dx2bz-CNRT3Xg.png" /></figure><p>The next step was to tune TCP buffer sizes and measure:</p><ol><li><strong>Throughput (BW) </strong>in MByte/s;</li><li><strong>Memory usage </strong>(primarily RSS);</li><li><strong>Kernel socket memory</strong> accounting (sock in cgroup memory.stat).</li></ol><p>The main knobs were:</p><ul><li><em>net.ipv4.tcp_rmem = min default max</em></li><li><em>net.ipv4.tcp_wmem = min default max</em></li></ul><p>All tests used:</p><ul><li>Go HTTP2 tunnel implementation in Go;</li><li>HTTP/2 over TLS;</li><li>Multiple “tunnels” per app instance.</li></ul><h3>Baseline (large TCP max, 1 tunnel)</h3><p>With large system‑wide TCP buffers and a single tunnel, the agent:</p><ul><li>Achieved <strong>~2440 MBit/s;</strong></li><li>Used <strong>~4300 MByte </strong>of memory.</li></ul><p>Good throughput, but too much memory pressure.</p><h3>Systematic TCP max tuning</h3><p>I then experimented with per‑pod TCP buffer limits via sysctls:</p><ol><li><strong>Max 512 KB:</strong></li></ol><ul><li>2–4 tunnels: ~2.36-4.65 Gb/s;</li><li>Agent memory: ~1.48-1.49 GB.</li></ul><p>Lower memory, but also lower top‑end throughput.</p><p><strong>2. Max 1 MByte:</strong></p><ul><li>2 tunnels: ~4.55 Gb/s, ~2.45 GB agent memory;</li><li>3 tunnels: ~5.72 Gb/s, ~2.44–2.70 GB agent memory;</li><li>4 tunnels: ~5.71 Gb/s, ~2.64 GB agent memory.</li></ul><p>This configuration gave a <strong>good balance</strong>: strong throughput scaling with manageable memory usage.</p><p><strong>3. Max 2 MByte:</strong></p><ul><li>2 tunnels: ~5.53 Gb/s, ~4.35 GB agent memory;</li><li>4 tunnels: ~5.53 GB/s, ~4.35 GB agent memory.</li></ul><p>Higher memory consumption with only modest speed‑up over 1 MByte, and more risk of hitting host/socket limits.</p><p>Overall, results showed <strong>diminishing returns </strong>beyond roughly <strong>1 MByte </strong>of TCP buffer per connection for this tunnel workload.</p><p>Using the same benchmark setup, I also looked at how throughput scales with the number of tunnels (long‑lived HTTP/2 over TLS connections) per app instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUMO853ac2QNbHoTSZN1Nw.png" /></figure><p>This showed:</p><p>Per‑tunnel throughput tends to top out around <strong>2.5-3.0 Gbps </strong>under realistic conditions.</p><p>About <strong>3 tunnels per app </strong>is a good practical target: it delivers most of the available throughput without exploding connection count or memory usage.</p><p>On Linux with a <strong>1 MByte</strong> TCP max per connection:</p><ul><li>3 tunnels per app with <strong>1 MByte TCP max </strong>gave very good throughput (~5.7 Gb/s) with reasonable memory usage (~2.4-2.7 GB).</li></ul><p><strong>Rule of thumb that emerged:</strong></p><ul><li>Assume ~<strong>2.5 Gbps per tunnel;</strong></li><li>Plan for <strong>~3 tunnels per app </strong>to get healthy aggregate throughput while staying memory‑efficient.</li></ul><h3>Memory Accounting: RSS vs “missing” memory</h3><p>One interesting observation from the same host:</p><ul><li>Go process <strong>RSS</strong>: ~1.3-1.4 GB;</li><li>container_memory_usage_bytes: ~23 GB;</li><li>memory.stat showed <strong>sock ~11 GB!</strong></li></ul><p>In other words:</p><p>The Go heap and stacks are <em>not</em> the whole story. A huge portion of memory is in <strong>kernel socket buffers</strong>, which scales with:</p><ul><li>Number of active connections;</li><li>Per‑connection TCP buffer max sizes;</li><li>In‑flight data during high‑throughput.</li></ul><p>This is why TCP buffer tuning had such a dramatic impact on apparent container memory usage while leaving Go heap sizes relatively stable.</p><h3>Practical recommendations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*DYQajO09IEGcwgb9jUp-2Q.png" /></figure><p>Based on these experiments, for high‑throughput HTTP/2 over TLS in Go:</p><ol><li><strong>Don’t trust localhost benchmarks on mac</strong> for throughput scaling!</li></ol><p>They can be limited by loopback bandwidth and shared across connections, which hides the real behavior.</p><p>2. <strong>Profile on Linux (or realistic servers) </strong>to understand actual bottlenecks;</p><p>Chaining TCP, TLS, and HTTP/2 layers will naturally add copies and syscalls. Getting to “direct app speed” is not realistic. Yet, the question is whether you are close enough to the hardware limits for your use case.</p><p>3. <strong>Tune TCP buffers, especially the max, but stop at around 1 MByte;</strong></p><p><em>tcp_rmem/tcp_wmem</em> with a <strong>1 MByte max </strong>gave an excellent balance of throughput and memory usage.</p><p>2 MByte max increased memory pressure without a proportional speed gain.</p><h3>Closing thoughts</h3><p>The key lesson from this exercise is that <strong>performance work is as much about the environment and the kernel as it is about application code</strong>:</p><ul><li>Mac loopback made the things look much worse than it really was;</li><li>Linux showed scaling well once the environment stopped being the bottleneck.</li></ul><p>By combining careful profiling with controlled TCP tuning and a sensible number of tunnels, it is possible to get close to the practical limits of the underlying hardware while keeping memory usage predictable and under control.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e523db0610e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VMM: Cloud-hypervisor a new era of virtualization]]></title>
            <link>https://medium.com/@e.paniot/vmm-cloud-hypervisor-a-new-era-of-virtualization-dbfebc393830?source=rss-b8c5eee83fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbfebc393830</guid>
            <category><![CDATA[kata-container]]></category>
            <category><![CDATA[cloud-hypervisor]]></category>
            <category><![CDATA[kvm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Eugene Paniot]]></dc:creator>
            <pubDate>Wed, 15 Jan 2025 17:31:13 GMT</pubDate>
            <atom:updated>2025-01-15T17:31:13.947Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is a virtual machine?</h3><p>A virtual machine is an isolated environment with its own isolated proccesing capabilities — memory, CPU, interrupts, etc.</p><h3>Virtual Machine Monitor (VMM)</h3><p>I Virtual Machine Monitor (VMM) is a software layer that supports one or more virtual machines. It manages virtual machine MMU, vCPU, hardware interrupts, memory access, and other hardware resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*QWauN04vCKmi-T6vWgzQ1Q.png" /></figure><p>VMM is also known as — hypervisor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*3496vDuSBKEGcPn8cmQMxQ.png" /></figure><h3>VMM implementations issues</h3><p>vCPU: Gues OS runs as it is executing directly on the hardware CPU. But in reality, it is running on top of the VMM;</p><p>Memory: Guest OS thinks it is managing its own memory, but in reality, it is managed by the VMM;</p><ul><li>Paravirtualization: Guest OS is modified to be aware of the hypervisor and cooperate with it.</li><li>Binary translation: Guest OS is not modified, but the hypervisor translates the guest OS instructions to host OS instructions.</li></ul><p>Hardware assisted virtualization:</p><ul><li>Intel VT-x: Intel’s virtualization technology.</li><li>AMD-V: AMD’s virtualization technology.</li></ul><h3>KVM</h3><p>Kernel-based Virtual Machin is a set of Linux kernel modules that when loaded, turn Linux kernel into hypervisor. Linux continues its normal operations as OS but also provides hypervisor facilities to user space.</p><p>KVM modules can be grouped into two types: core module and machine specific modules. <br>kvm.ko is the core module which is always needed. Depending on the host machine CPU, a machine specific module, like kvm-intel.ko (uses the functionality for Intel Virtualization Technology (also known as VT-x)) or kvm-amd.ko will be needed.</p><p>/dev/kvm is the main API exposed by KVM. It supports a set of ioctl s which allow VMM to manage VMs and interact with them.</p><h3>KVM and QEMU</h3><p>KVM interacts with user space — in our case QEMU — in two ways: through device file /dev/kvm and through memory mapped pages. Memory mapped pages are used for bulk transfer of data between QEMU and KVM.</p><p>/dev/kvm is the main API exposed by KVM. It supports a set of ioctls which allow QEMU to manage VMs and interact with them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*61XMb1cHLIwO9kmSxNGkww.png" /></figure><h3>QEMU Architecture</h3><p>Below is a diagram of the i440fx architecture(from qemu sites).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*fDMOdlOV2An0X4yr8QyC_w.png" /></figure><p>As we can see the topology of qemu emulates is nearly same as the physical machine. We need a i440fx motherboard, the pci host bridge, the pci bus bus tree, the superio controller and isa bus tree.</p><h3>Rust-vmm</h3><p>The rust-vmm project came to life in December 2018 when Amazon, Google, Intel, and Red Hat started talking about the best way of sharing virtualization packages. More contributors have joined this initiative along the way. Rust-vmm was born as the host for sharing core virtualization components.</p><p>The goal of rust-vmm is to enable the community to create custom VMMs that import just the required building blocks for their use case.</p><p>It runs in user space and uses the KVM to create microVMs. The fast startup time and low memory overhead of each microVM enables you to pack thousands of microVMs onto the same machine. This means that every function, container, or container group can be encapsulated with a virtual machine barrier, enabling workloads from different customers to run on the same machine, without any tradeoffs to security or efficiency. It is an alternative to QEMU.</p><p>Rust-vmm abstracts the common virtualization components which implements a Rust-based VMM required to be crate. These components contains kvm wrapper, virtio devices and some utils, etc. People who wants to implement a Rust-based VMM can util these components. This makes write a Rust-based VMM very easy.</p><p>For example, let’s say we want to build a custom VMM that allows users to create and configure a single VM running on top of KVM. As part of the configuration, users will be able to specify the kernel image file, the root file system, the number of vCPUs, and the memory size. Creating and configuring the resources of the VM can be implemented using the kvm-ioctls crate. The kernel image can be loaded in guest memory with kernel-loader, and specifying a root filesystem can be achieved with the virtio-devices block module. The last thing needed for our VMM is writing VMM Glue, the code that takes care of integrating rust-vmm components with the VMM user interface, which allows users to create and manage VMs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*8qB6gYh0rddBn5oBz-QKbw.png" /></figure><h3>Cloud-hypervisor</h3><p>Project roadmap <a href="https://github.com/orgs/cloud-hypervisor/projects/6/views/4">https://github.com/orgs/cloud-hypervisor/projects/6/views/4</a></p><p>Cloud Hypervisor is an open source Virtual Machine Monitor (VMM) that runs on top of the <a href="https://www.kernel.org/doc/Documentation/virtual/kvm/api.txt">KVM</a> hypervisor and the Microsoft Hypervisor (MSHV).</p><p>Features include CPU, memory and device hotplug, support for running Windows and Linux guests, device offload with vhost-user and a minimal compact footprint. Written in Rust with a strong focus on security.</p><p>The project focuses on running modern, <em>Cloud Workloads</em>, on specific, common, hardware architectures. In this case <em>Cloud Workloads</em> refers to those that are run by customers inside a Cloud Service Provider. This means modern operating systems with most I/O handled by paravirtualised devices (e.g. <em>virtio</em>), no requirement for legacy devices, and 64-bit CPUs.</p><p>Cloud Hypervisor is implemented in <a href="https://www.rust-lang.org/">Rust</a> and is based on the <a href="https://github.com/rust-vmm">Rust VMM</a> crates.</p><p>The cloud-hypervisor’s development is driven by the idea that in modern world we need a more light, more security, and more efficiency VMM. The traditional solution of cloud virtual machine is qemu and kvm. In cloud, we just need an environment to run workloads, there is no need to pay for the legacy devices which qemu emulates.</p><p>Cloud-hypervisor has a clear architecture, it reduces the complexity of devices/buses which qemu has to emulate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*9dijIECxnPhKROTrV7Am_g.png" /></figure><p>As we can see, the cloud-hypervisor’s architecutre is very easy, it even has no abstract of motherboard. It has just several virtio devices, no isa bus, no PCI bus tree.</p><h4>Windows Support</h4><p>Starting with the release version 0.10.0, Cloud Hypervisor supports Windows guests.</p><h4>Windows installation</h4><p>Currently requires QEMU to install Windows onto the guest. QEMU is only used at the preparation stage, the resulting image is then fully functional with Cloud Hypervisor.</p><h4>Device Model</h4><p><a href="https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/device_model.md">https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/device_model.md</a></p><h4>Cloud Hypervisor VFIO</h4><p>VFIO (Virtual Function I/O) is a kernel framework that exposes direct device access to userspace. cloud-hypervisor, as many VMMs do, uses the VFIO framework to directly assign host physical devices to the guest workloads.</p><p>To assign a device to a cloud-hypervisor guest, the device needs to be managed by the VFIO kernel drivers.</p><h4>Virtio Data Path Acceleration</h4><p>vDPA aims at achieving bare-metal performance for devices passed into a virtual machine. It is an alternative to VFIO, as it provides a simpler solution for achieving migration.</p><p><a href="https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/vdpa.md">https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/vdpa.md</a></p><p><a href="https://docs.nvidia.com/networking/display/bluefielddpuosv398/virtio-net+emulated+devices">VirtIO-net Emulated Devices</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*F6C49ODMPYxlm4B8.png" /></figure><h4>Cloud Hypervisor Hot Plug</h4><p>Currently Cloud Hypervisor supports hot plugging of CPUs devices (x86 only), PCI devices and memory resizing.</p><p><a href="https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/hotplug.md">https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/hotplug.md</a></p><h3>Kata containers</h3><p>Architecture of the Kata containers secure container platform. The guest section consists of a namespaced container running within a VMM, in which the workload is run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*R1rn9J8YqwiEVdk-Lh9b2A.png" /></figure><h3>Networking</h3><p>Kata Containers supports both <a href="https://github.com/moby/libnetwork/blob/master/docs/design.md#the-container-network-model">CNM</a> and <a href="https://github.com/containernetworking/cni">CNI</a> for networking management.</p><p><a href="https://github.com/kata-containers/kata-containers/blob/main/docs/design/architecture/networking.md">https://github.com/kata-containers/kata-containers/blob/main/docs/design/architecture/networking.md</a></p><p>Sources:</p><p><a href="https://github.com/kata-containers/kata-containers/blob/main/src/runtime-rs/crates/hypervisor/src/device/driver/virtio_net.rs">https://github.com/kata-containers/kata-containers/blob/main/src/runtime-rs/crates/hypervisor/src/device/driver/virtio_net.rs</a></p><p><a href="https://github.com/kata-containers/kata-containers/tree/main/src/runtime-rs/crates/resource/src/network/endpoint">https://github.com/kata-containers/kata-containers/tree/main/src/runtime-rs/crates/resource/src/network/endpoint</a> supports tap, veth, macvlan, macvtap, etc.</p><p><a href="https://github.com/kata-containers/kata-containers/blob/main/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go">https://github.com/kata-containers/kata-containers/blob/main/src/runtime/virtcontainers/pkg/cloud-hypervisor/client/model_net_config.go</a> client config</p><h3>Kubernetes integration</h3><p>Kata Containers is generally used in Kubernetes. First, Kubelet finds containerd or CRI-O through the container runtime interface (CRI).</p><p>CRI API: <a href="https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto">https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto</a></p><p>According to the request, Kubelet converts the runtime-related requirement to an OCI spec and sends it to the OCI runtime for execution. The OCI runtime can be kata-runtime or the simplified containerd-shim-kata-v2. The process is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MXjQzN_ZzPrZNqFTrWUNw.png" /></figure><p>Kata Containers is generally used in Kubernetes. First, Kubelet finds containerd or CRI-O through the container runtime interface (CRI). At this time, operations such as mirroring are performed by containerd or CRI-O. According to the request, Kubelet converts the runtime-related requirement to an OCI spec and sends it to the OCI runtime for execution. The OCI runtime can be kata-runtime (shown in the upper part of the figure) or the simplified containerd-shim-kata-v2 (shown in the lower part). The process is as follows:</p><ul><li>When receiving a request, containerd creates a shim-v2. The shim-v2 is a representative of a pod sandbox or virtual machine monitor (VMM).</li><li>Each pod provides a shim-v2 for containerd or CRI-O to perform operations. The shim-v2 starts a VM for the pod. The VM includes a Linux kernel, which is the guest kernel in the figure. If the VM includes QEMU, we can downsize the VM through configuration and patching. The VM does not include a guest operating system, such as CentOS or Ubuntu.</li><li>The container spec and the container are packaged for storage. rootfs and the file system are delivered to the pod sandbox. The pod sandbox starts the container on the VM through the kata-agent.</li><li>According to the CRI semantics and OCI specification, multiple associated containers can be started in a pod. These containers are located on the same VM and share namespaces as needed.</li><li>Other external storage devices and volumes can be hot-plugged into the pod sandbox.</li><li>A network can be seamlessly connected to nearly all Kubernetes CNI plug-ins through tcfilter. The Enlightened mode is provided to improve the network capabilities of containers through a special CNI plug-in.</li></ul><p>In the pod sandbox, a guest kernel runs container packages and applications, but it does not contain a complete operating system. Kata Containers is not like a conventional VM. From the container’s perspective, Kata Containers only includes the container engine and reduces memory overhead by lowering memory usage and sharing memory resources.</p><h3>Kata Containers VMM support</h3><p><a href="https://github.com/kata-containers/kata-containers/blob/main/docs/hypervisors.md">https://github.com/kata-containers/kata-containers/blob/main/docs/hypervisors.md</a></p><p>Kata Containers supports multiple hypervisors</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swB5ySLKMaSOB_XjBOq59Q.png" /></figure><h3>The direct access (DAX)</h3><p><a href="https://github.com/kata-containers/kata-containers/blob/main/docs/design/architecture/README.md#dax-advantages">https://github.com/kata-containers/kata-containers/blob/main/docs/design/architecture/README.md#dax-advantages</a></p><p>The direct access (DAX) technology designed for non-volatile storage and memory can be used to share read-only memory resources between pod sandboxes, between pods, and between containers. This saves a lot of memory between different pod sandboxes. Kubernetes manages the containers of all pods externally, and obtains metrics and debugging information from the external environment. This saves users the trouble of logging on to VMs. Kata Containers supports containerized operations and works like a VM at the underlying layer. However, Kata Containers is virtualized based on cloud-native.</p><p>Mapping files using DAX provides a number of benefits over more traditional VM file and device mapping mechanisms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*An4QM-PNjWIWQC4u.png" /></figure><h3>Looking Forward</h3><p>The evolution of virtualization is marked by projects like Cloud Hypervisor and Rust-vmm, setting new benchmarks for lightweight, secure, and efficient virtual machine management. As cloud demands grow, these advancements will continue driving innovation, shaping the future of cloud-native computing environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbfebc393830" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Passwordless Google Cloud SQL access control with Cloud SQL Auth proxy]]></title>
            <link>https://tech.loveholidays.com/passwordless-google-cloud-sql-access-control-with-cloud-sql-auth-proxy-42066ff79c58?source=rss-b8c5eee83fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/42066ff79c58</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Eugene Paniot]]></dc:creator>
            <pubDate>Tue, 23 May 2023 09:37:03 GMT</pubDate>
            <atom:updated>2023-05-23T09:37:03.410Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*9BbB1S_3bZpmn66EnZbUzA.jpeg" /></figure><p>Database user and permission management can prove to be a challenging task, particularly in large-scale environments with complex authorisation requirements.</p><p>As <a href="https://www.loveholidays.com/">loveholidays</a> matured from a startup to a scale up, we were faced with a variety of challenges related to database user management:</p><ul><li>engineers having excessive privileges;</li><li>shared users amongst many applications;</li><li>reliance on a centralised team for user management and IP/Network/Allowlist management, which can be slow and inefficient as the company grows;</li><li>lack of auditability of database user and permission changes;<br>manual password rotation / no password rotation.</li></ul><p>The above challenges can be put into two categories: permission management and password management. This article will provide insights into how we migrated to passwordless access for Google Cloud SQL by adopting Google IAM authentication with Cloud SQL Auth proxy. Furthermore, it will explore how we manage database users and their permissions.</p><h3>User Permissions management</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*gYqZvM8lMP31DcYk2qhk7Q.jpeg" /></figure><p>For configuration, we use Infrastructure as Code (IaC) in YAML versioned in Git, instead of executing raw SQL queries. This makes the process transparent, auditable and repeatable. <br>In the following code snippet, you can see the definition of permissions for both the user account and the service account:</p><pre>- username: engineer1@loveholidays.com<br>  permissions: &amp;platform-team-permissions<br>   - database: “...”<br>     table: &quot;*&quot;<br>     privileges:<br>       - SELECT<br>       - SHOW VIEW<br>       - CREATE TEMPORARY TABLES<br>       - TRIGGER<br><br>   - database: &quot;*&quot;<br>     privileges:<br>       - PROCESS<br>       - RELOAD<br>       - SHOW DATABASES<br><br>- username: engineer2@loveholidays.com<br>  permissions: *platform-team-permissions<br><br>- username: wi-gsa@project.iam.gserviceaccount.com<br>  permissions: &amp;service-account-read-write<br>   - database: &quot;...&quot;<br>     privileges:<br>       - SELECT<br>       - UPDATE<br>       - INSERT<br>       - DELETE<br>       - SHOW VIEW<br>       - CREATE TEMPORARY TABLES<br>       - TRIGGER<br>       - EXECUTE<br><br>- username: wi-gsa2@project.iam.gserviceaccount.com<br>  permissions: *service-account-read-write<br><br>- username: wi-gsa3@project.iam.gserviceaccount.com<br>  permissions: *service-account-read-write<br><br>...</pre><p>When managing a considerable number of users across multiple database servers in different projects, this approach becomes highly effective.<br>YAML anchors can be used to define a set of permissions once and then reference them for additional users, without needing to repeat the permission set for each user. Additionally, using YAML anchors can help to avoid excessive copying and pasting, which can be error-prone and time-consuming.<br>Granting granular access to each user enables them to access only the required data to perform their job. Additionally, mapping applications on a 1:1 basis with service accounts simplifies access control, making it easier to manage and regulate what application has access to what data.</p><h3>How the Cloud SQL Auth proxy works</h3><p>Cloud SQL Auth proxy is a database connector that provides secure access to Cloud SQL instances without a need for authorised networks or for configuring SSL.</p><p>Cloud SQL Auth proxy has the following benefits:</p><ul><li><strong>Secure connections:</strong> Cloud SQL Auth proxy automatically encrypts traffic to and from the database. SSL certificates are used to verify client and server identities, and are independent of database protocols; we won’t need to manage SSL certificates;</li><li><strong>Easier connection authorisation:</strong> Cloud SQL Auth proxy uses GCP IAM permissions to control who and what can connect to our Cloud SQL instances. Thus, Cloud SQL Auth proxy handles authentication with Cloud SQL, removing the need to provide static IP addresses;</li><li><strong>IAM database authentication:</strong> Cloud SQL Auth proxy supports an automatic refresh of OAuth 2.0 access tokens for passwordless authentication.</li></ul><p>Learn more <a href="https://cloud.google.com/sql/docs/mysql/sql-proxy">about the Cloud SQL Auth proxy</a> and <a href="https://cloud.google.com/sql/docs/mysql/authentication">Cloud SQL IAM database authentication</a>.</p><p>To establish a secure connection between a user’s local environment or Kubernetes POD and a Cloud SQL instance, a local Cloud SQL Auth proxy should be used or deployed as a sidecar container.</p><p>The communication between the application and Cloud SQL Auth Proxy is performed through the standard database protocol:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*6z1htia6BTePGhQLy67jJw.png" /></figure><h3>Cloud SQL Auth proxy with Google IAM Authentication</h3><p>Using passwordless authentication for Google Cloud SQL is not a new concept and has already been implemented in Cloud SQL for PostgreSQL since version 9.6, as well as in recent <a href="https://cloud.google.com/sql/docs/mysql/release-notes#December_16_2022">Cloud SQL for Mysql 5.7.39+</a>. The approach is based on the use of short-lived tokens for Google IAM user or kubernetes service accounts running on <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity">workload identity in GKE</a> nodes.</p><p>To implement CloudSQL Auth Proxy with Google IAM authentication, we need to perform the following steps:</p><ul><li>Add user or service accounts to the database instance;</li><li>Grant IAM roles within GCP to the user or service account to allow database instance login. Add the <em>roles/cloudsql.instanceUser</em> IAM role on the User account to perform this task. It is a predefined role that contains the necessary Cloud SQL IAM permission <em>cloudsql.instances.login</em>;</li><li>Grant database/table/other object privileges using database specific SQL query.</li></ul><h3>Creating users</h3><p>Creating users and granting IAM Roles is easy to do with the google terraform provider — <a href="https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_user">google_sql_user</a> and <a href="https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_project_iam">google_project_iam_member</a>.</p><h3>Grant permissions</h3><p>To grant database privileges (e.g. table, schema, sequence, function) to a user or service account, we need to execute database specific SQL queries.</p><p>Despite the PostgreSQL Terraform provider support for connecting to a Cloud SQL Instance to manage permissions, we had to contribute (<a href="https://github.com/petoju/terraform-provider-mysql/pull/48">#48</a>, <a href="https://github.com/petoju/terraform-provider-mysql/pull/55">#55</a>) support for IAM Authentication to the <a href="https://github.com/petoju/terraform-provider-mysql">petoju/terraform-provider-mysql</a> to connect to the Cloud SQL MySQL Instance:</p><pre>provider &quot;mysql&quot; {<br> endpoint = &quot;cloudsql://${var.connection_name}&quot;<br>...<br>}<br><br>resource &quot;mysql_grant&quot; &quot;this&quot; {<br> for_each = { for item in local.user_permissions : item.key =&gt; item }<br> database   = each.value.database<br> table      = each.value.table<br> host       = each.value.host<br> user       = each.value.username<br> privileges = each.value.privileges<br> grant      = each.value.grant<br>}</pre><p>Having learned how to manage database users and their permissions, let’s now dive into how our Kubernetes workloads connect to Cloud SQL.</p><h3>Kubernetes implementation</h3><p>Our workloads are deployed on nodes that are enabled with <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity">Workload Identity</a>. This allows us to configure a kubernetes service account (KSA) to act as a Google service account (GSA), which means that pods running with the KSA can automatically authenticate as the corresponding GSA when accessing Google Cloud APIs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*Ah1KIu9aNokGZdt7UbtT4A.png" /></figure><h3>Service Account Workload Identity</h3><p>All of our kubernetes service accounts have workload identity annotations:</p><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br> annotations:<br>   iam.gke.io/gcp-service-account: wi-gsa@project.iam.gserviceaccount.com<br> name: ksa-name</pre><p>The Cloud SQL Auth Proxy container in each kubernetes application deployment will use this Google service account to access the Cloud SQL Instance:</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br> name: application<br>spec:<br> template:<br>   spec:<br>...<br>     serviceAccountName: ksa-name<br>     containers:<br>       - name: cloudsql-proxy<br>         image: gcr.io/cloudsql-docker/gce-proxy:1.33.1-alpine<br>         command:<br>           - /cloud_sql_proxy<br>           - -term_timeout=60s<br>           - -verbose=false<br>           - -enable_iam_login<br>         args:<br>           - -instances=project:region:name=tcp:3306<br><br>       - name: application<br>         env:<br>           - name: SPRING_DATASOURCE_URL<br>             value: jdbc:mysql://localhost:3306/db?autoReconnect=true<br>           - name: SPRING_DATASOURCE_USERNAME<br>             value: wi-gsa<br>           - name: SPRING_DATASOURCE_PASSWORD<br>             value: &quot;&quot;<br>...</pre><h3>Cloud SQL Auth Proxy with IAM Authentication</h3><ol><li>Cloud SQL Auth Proxy obtains a GSA token from the google metadata server;</li><li>SQL Proxy submits token to the Cloud SQL instance as the password attribute on behalf of the client;</li><li>The Cloud SQL Instance then validates this information with google IAM to establish the connection.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*jga8e0C4B_dJQgxuhT8VLQ.png" /></figure><p>IAM database authentication tokens are short-lived and valid only for one hour. Cloud SQL auth proxy requests and renews this token, ensuring our applications have a stable connection.</p><h3>Conclusion</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*_uBCRYab6trWOtuygIymvA.jpeg" /></figure><p>Abstracting Cloud SQL user management with a custom terraform module and YAML based configuration has proven to be an efficient approach for granular access control and simplification of the database access management process. This is in line with one of the key objectives of our Platform Engineering team, which is to hide complexity from users by creating an abstraction layer between the user and the underlying infrastructure, allowing users to interact with the platform without needing to understand all of its technical details. It is also aligned with our <a href="https://tech.loveholidays.com/the-5-principles-that-helped-scale-loveholidays-7ea0b0fd3df9">engineering principle</a> of “Invest in simplicity”. Moreover, it facilitates granular access control for users and applications with an audit trail in git history to see when and by whom a user and permission was granted.</p><p>Additionally, we have solved the problem of long-lived database credentials and shared database user accounts using workload identity and Google IAM. We have eliminated the need for password management, reducing the overhead of storing and rotating passwords.</p><p>Love engineering? We have a <a href="https://careers.loveholidays.com/jobs/2450208-senior-site-reliability-engineer">Site Reliability Engineering</a> role open.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42066ff79c58" width="1" height="1" alt=""><hr><p><a href="https://tech.loveholidays.com/passwordless-google-cloud-sql-access-control-with-cloud-sql-auth-proxy-42066ff79c58">Passwordless Google Cloud SQL access control with Cloud SQL Auth proxy</a> was originally published in <a href="https://tech.loveholidays.com/">loveholidays tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding SRE: Burn rate of error budget, and leaky bucket]]></title>
            <link>https://medium.com/@e.paniot/understanding-sre-burn-rate-of-error-budget-and-leaky-bucket-8f53a7e2d432?source=rss-b8c5eee83fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f53a7e2d432</guid>
            <category><![CDATA[sli]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[slo]]></category>
            <category><![CDATA[error-budget]]></category>
            <dc:creator><![CDATA[Eugene Paniot]]></dc:creator>
            <pubDate>Wed, 01 Mar 2023 11:00:17 GMT</pubDate>
            <atom:updated>2023-03-01T11:00:17.076Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bNKLV4wYwIhYJQyUay9IQ.png" /></figure><p>One of the key concepts in SRE is <strong>the error budget</strong>, which represents the amount of allowable service downtime or error rate. The error budget is typically calculated based on the Service Level Objective (<strong>SLO</strong>), which is the agreed-upon level of performance that a system should maintain.</p><p>In the context of the basket with water, the incoming water represents the requests coming into the system, and the level of water in the basket represents the <strong>SLO</strong>. The lost water due to holes in the basket represents defects or bugs that affect the system’s performance or availability.</p><p>The <strong>burn rate of the error budget</strong> refers to the rate at which the system is losing its error budget. In other words, it is a measure of how fast the system is using up its allowable downtime or error rate. In the basket analogy, the burn rate would be the rate at which the water is leaking out of the holes in the basket.</p><blockquote>The burn rate tells you how fast you are consuming your error budget.</blockquote><p><a href="https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/alerting-on-budget-burn-rate">Alerting on your burn rate | Operations Suite | Google Cloud</a></p><p>The size of the holes in the basket represents the criticality of the defects or bugs that affect the system’s performance. Larger holes will lead to a faster burn rate and a more rapid depletion of the error budget, while smaller holes will have a slower burn rate and a slower depletion of the error budget.</p><p>For example, if the system has an error budget of 99.9% uptime per month, and it experiences a critical defect that causes the system to be down for 10 hours in a month, then the burn rate would be 0.3% per month (10 hours / 720 hours in a month). This means that the system has used up 0.3% of its error budget for the month, and it has 99.6% uptime remaining.</p><p>In summary, the burn rate of the error budget in SRE is a measure of how quickly a system is using up its allowable downtime or error rate. The size of the holes in the basket represents the criticality of the defects or bugs that affect the system’s performance or availability. The faster the burn rate, or the larger the holes, the more critical the defects or bugs are, and the greater the impact on the user or business.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f53a7e2d432" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leave no stone unturned]]></title>
            <link>https://medium.com/@e.paniot/leave-no-stone-unturned-a08d60a781e1?source=rss-b8c5eee83fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a08d60a781e1</guid>
            <category><![CDATA[investigation]]></category>
            <category><![CDATA[sre]]></category>
            <dc:creator><![CDATA[Eugene Paniot]]></dc:creator>
            <pubDate>Thu, 23 Feb 2023 13:05:47 GMT</pubDate>
            <atom:updated>2023-02-23T22:05:04.743Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/0*bdSxzoHCfoTavpwL.jpg" /></figure><p>As a Site Reliability Engineer (SRE), it’s your job to ensure that your system is always running smoothly. But what happens when you encounter an issue or performance problem? The answer is simple — <strong>leave no stone unturned</strong> when discovering the root cause of the problem.</p><p>Investigation is an essential part of an SRE’s role. Whether it’s a application, docker container, server failure, a memory leak, or a bottleneck, you need to identify the root cause of the issue to prevent it from happening again in the future. In most cases, the root cause is not obvious, and it takes a thorough investigation to uncover it.</p><p>To ensure that you don’t miss anything during the investigation process, you need to <strong>leave no stone unturned</strong>.</p><h3><strong>Use a systematic approach</strong></h3><p>A systematic approach is critical when investigating issues. Start by defining the problem and identifying its <strong>symptoms</strong>. Then, gather as much information as possible about the issue, including logs, metrics, and any other relevant data. Next, analyze the information to identify any patterns or trends. Finally, use this information to narrow down the scope — <strong>develop a hypothesis and test it.</strong></p><h3><strong>Narrow down the scope</strong></h3><p>This can help you focus on the most likely root cause and avoid wasting time on unrelated issues.</p><h3><strong>Think outside the box</strong></h3><p>Sometimes the root cause of an issue is not obvious, and you need to think outside the box. Don’t be afraid to try new things or explore uncharted territory. You never know what you might uncover.</p><h3><strong>Use data-driven analysis</strong></h3><p>Data-driven analysis is critical when investigating issues. It helps you to identify patterns, trends, and correlations that you might not have otherwise noticed. Make sure that you have access to all the relevant data and use it to inform your investigation.</p><h3><strong>Document everything</strong></h3><p>When investigating issues, it is crucial to Document or Post everything you have done into a Slack channel. Keep a record of all the steps you have taken, including any hypotheses you developed and tests you performed. This information will be invaluable if you need to revisit the issue in the future. It helps you to stay organized and ensures that you don’t miss anything.</p><h3>Collaborate with others</h3><p>Investigating issues require collaboration with other team members and developers. By working together, you can pool your knowledge and resources to identify the root cause of the issue.</p><h3><strong>Take corrective action</strong></h3><p>Once you have identified the root cause, take corrective action to address it. This may involve updating code, configuration, or processes.</p><h3><strong>Monitor the system</strong></h3><p>After taking corrective action, monitor the system closely to ensure that the issue is fully resolved.</p><p>In conclusion, leaving no stone unturned when investigating issues or performance problems is critical for an SRE. Identifying and addressing the root cause of issues is critical to ensuring that systems are reliable, scalable, and highly available.<br>Remember, <strong>the devil is in the details</strong>, so don’t overlook anything.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a08d60a781e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solaris 11: Replacing Devices in a Storage Pool]]></title>
            <link>https://medium.com/@e.paniot/solaris-11-replacing-devices-in-a-storage-pool-6523998b32d6?source=rss-b8c5eee83fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6523998b32d6</guid>
            <category><![CDATA[oracle-solaris]]></category>
            <category><![CDATA[zfs]]></category>
            <dc:creator><![CDATA[Eugene Paniot]]></dc:creator>
            <pubDate>Thu, 24 Mar 2022 09:10:46 GMT</pubDate>
            <atom:updated>2022-03-24T09:10:46.565Z</atom:updated>
            <content:encoded><![CDATA[<pre># zpool status -v<br>  pool: rpool<br> state: ONLINE<br>  scan: scrub repaired 0 in 2h51m with 0 errors on Mon Mar 14 04:51:22 2022</pre><pre>config:</pre><pre>NAME                       STATE      READ WRITE CKSUM<br>        rpool                      ONLINE        0     0     0<br>          mirror-0                 ONLINE        0     0     0<br>            c0t50014EE059DCC835d0  ONLINE        0     0     0<br>            c0t5000CCA24ECEB36Cd0  ONLINE        0     0     0<br>            c8t0d0                 ONLINE        0     0     0</pre><pre>errors: No known data errors</pre><p>You can replace a device in a storage pool by using the zpool replace command.</p><pre># zpool replace rpool c0t50014EE059DCC835d0 c8t3d0<br># zpool replace rpool c0t5000CCA24ECEB36Cd0 c8t2d0<br># zpool status<br>  pool: rpool<br> state: DEGRADED<br>status: One or more devices are currently being resilvered.  The pool will<br>        continue to function in a degraded state.<br>action: Wait for the resilver to complete.<br>        Run &#39;zpool status -v&#39; to see device specific details.<br>  scan: resilver in progress since Wed Mar 23 23:30:02 2022<br>    519G scanned<br>    366G resilvered at 119M/s, 36.04% done, 47m26s to go<br>config:</pre><pre>NAME                         STATE      READ WRITE CKSUM<br>        rpool                        DEGRADED      0     0     0<br>          mirror-0                   DEGRADED      0     0     0<br>            replacing-0              DEGRADED      0     0     0<br>              c0t50014EE059DCC835d0  ONLINE        0     0     0<br>              c8t3d0                 DEGRADED      0     0     0  (resilvering)<br>            replacing-1              DEGRADED      0     0     0<br>              c0t5000CCA24ECEB36Cd0  ONLINE        0     0     0<br>              c8t2d0                 DEGRADED      0     0     0  (resilvering)<br>            c8t0d0                   ONLINE        0     0     0</pre><pre>errors: No known data errors</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6523998b32d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solaris 11: Reinstalling GRUB 2 on rpool]]></title>
            <link>https://medium.com/@e.paniot/solaris-11-reinstalling-grub-2-on-rpool-2673d5117579?source=rss-b8c5eee83fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2673d5117579</guid>
            <category><![CDATA[grub2]]></category>
            <category><![CDATA[grub]]></category>
            <category><![CDATA[oracle-solaris]]></category>
            <category><![CDATA[solaris]]></category>
            <dc:creator><![CDATA[Eugene Paniot]]></dc:creator>
            <pubDate>Thu, 24 Mar 2022 09:02:42 GMT</pubDate>
            <atom:updated>2022-03-24T09:02:42.443Z</atom:updated>
            <content:encoded><![CDATA[<p>If the GRUB 2 boot loader becomes corrupted, and the system can no longer boot, you might be required to boot from media and manually reinstall the boot loader. To reinstall the boot loader, you must boot from the Oracle Solaris installation media (for example, by using the text installer ISO image) and get to a command prompt.</p><pre># bootadm install-bootloader -v -P rpool<br>...<br>+ gettext &#39;Installation finished. No error reported.&#39;<br>+ 1&gt;&amp; 2<br>Installation finished. No error reported.+ echo<br>+ 1&gt;&amp; 2</pre><pre>+ exit 0</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2673d5117579" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automated canary analysis based on logs level, severity]]></title>
            <link>https://medium.com/@e.paniot/automated-canary-analysis-based-in-logs-level-severity-de2142850bfc?source=rss-b8c5eee83fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/de2142850bfc</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[grok]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[automated-canary-analysis]]></category>
            <category><![CDATA[spinnaker]]></category>
            <dc:creator><![CDATA[Eugene Paniot]]></dc:creator>
            <pubDate>Mon, 13 Sep 2021 17:24:32 GMT</pubDate>
            <atom:updated>2023-03-01T14:28:44.334Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Problem Statement</strong></p><p>The developer invested a considerable amount of time reviewing logs and analyzing them, specifically focusing on the number of errors and warnings recorded.</p><p>My preference is to perform an automated comparison of metrics, such as logs, and identify any deviations.</p><p><strong>Success criteria</strong></p><p>No manual investigations, interactions in deployments.</p><p><strong>Proposal</strong></p><p>So to save testers and developers from all this exhausting redundancy, I propose the idea of using <a href="https://github.com/spinnaker/kayenta">Spinnaker Canary Kayenta</a> with Prometheus provider.</p><blockquote>Kayenta is a platform for Automated Canary Analysis (ACA). It is used by Spinnaker to enable automated canary deployments. Please see the comprehensive <a href="https://www.spinnaker.io/guides/user/canary/stage/">canary documentation</a> for more details.</blockquote><ol><li>Application sends metrics to Logstash;</li><li>Logstash parses and additionally sends data/string to grok exporter via http post;</li><li>Grok exporter calculates metrics based on input data;</li><li>Prometheus scrapes/gathers data from grok exported and store it for further analysis;</li><li>Spinnaker Kayenta compares those metrics and renders a decision to pass or fail the canary.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*Pf3k41SmA-4GforLu_zyHw.png" /></figure><p><strong>Grok Exporter</strong></p><p><a href="https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html">Grok</a> is a tool to parse crappy unstructured log data into something structured and queryable. Grok is heavily used in <a href="https://www.elastic.co/products/logstash">Logstash</a> to provide log data as input for <a href="https://www.elastic.co/">ElasticSearch</a>.</p><p>Grok ships with about 120 predefined patterns for syslog logs, apache and other webserver logs, mysql logs, etc. It is easy to extend Grok with custom patterns.</p><p>The grok_exporter aims at porting Grok from the <a href="https://www.elastic.co/webinars/introduction-elk-stack">ELK stack</a> to <a href="https://prometheus.io/">Prometheus</a> monitoring. The goal is to use Grok patterns for extracting Prometheus metrics from arbitrary log files, http or kafka.</p><p><strong>Deployment pipeline</strong></p><p>The following pipeline spend 54 minutes waiting for User interaction. <strong>It’s too shame…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A83dvlXD7YQqgYnqzGxaRQ.jpeg" /></figure><p><strong>Canary Analysis Results (Test Logs Based)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvUKSc7XFSNaP0gxtMxFEA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de2142850bfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>