Practical Engineering
open-menu closeme
Engineering
github linkedin rss
  • Replacing socat with systemd-socket-proxyd

    calendar Mar 30, 2026 · 3 min read · Linux Systemd Bottlerocket  ·
    Share on: twitter copy

    Bottlerocket v11.0.0 dropped the socat package from bottlerocket-core-kit (#742). If you had a service that relied on socat to bridge a Unix Domain Socket (UDS) to a TCP port, you need a replacement. This post shows how to use systemd-socket-proxyd instead. Why socat was used soci-snapshotter exposes its metrics …


    Read More
  • Use KillMode=process with caution: restart loop could deplete resources

    calendar Dec 12, 2025 · 4 min read · Linux systemd  ·
    Share on: twitter copy

    I recently debugged a resource leak where a systemd service kept restarting while leaving a process behind after each restart. The root cause isn't particularly interesting: a backward-incompatible third-party dependency upgrade. But the debugging process and lessons learned are. Thousands of zombie processes from a …


    Read More
  • Spawning a New Process for Socket-Activated Daemons is Error-Prone

    calendar Dec 10, 2025 · 4 min read · Linux systemd Container  ·
    Share on: twitter copy

    I recently debugged a mysterious latency issue: after migrating a systemd service from path-activation to socket-activation, there was a consistent ~1 second time-to-available latency. The culprit was a bad practice—starting the daemon program as a new process in socket-activation. Let's dive into the details. Starting …


    Read More

Peng Zhang

Software Engineer

Recent Posts

  • Replacing socat with systemd-socket-proxyd
  • You probably want to disable cgo: Go's stdlib has pure-Go implementations
  • Who killed my service: collecting kernel kill logs with OTEL
  • Avoid using 2D map for transition table in Go
  • cached-imds-client: cache static IMDS responses to improve robustness
  • Using WaitGroup to Track Work Items, Not Workers: A Multi-threaded BFS Example
  • Simplify device path on boot with udev
  • Use KillMode=process with caution: restart loop could deplete resources

Tags

GO 20 LINUX 20 ALGORITHMS 8 BOTTLEROCKET 7 INTERVIEW 7 CONTAINER 5 CONCURRENCY 3 GUIDE 3 SYSTEMD 3 AWS 2 DISTRIBUTED SYSTEM 2 SELINUX 2 WEB 2 CRYPTOGRAPHY 1
All Tags
ALGORITHMS8 AWS2 BOTTLEROCKET7 CONCURRENCY3 CONTAINER5 CRYPTOGRAPHY1 DATABASES1 DISTRIBUTED SYSTEM2 DOCKER1 EC21 GO20 GUIDE3 INTERVIEW7 LINUX20 SELINUX2 SHELL1 SYSTEMD3 TESTING1 WEB2
[A~Z][0~9]
Peng Zhang

Copyright 2022-  PENG ZHANG. All Rights Reserved

to-top