Shopify
Shopify logoShopify · Feature trail

Container Resource Management with Systemd and CGroups

3 posts · Oct 2014 – Jul 2022

What this trail covers

Shopify has evolved its approach to container resource management, specifically addressing issues with systemd processes within containers not adhering to Kubernetes resource limits due to cgroup driver configurations. Initial efforts focused on containerizing applications and managing secrets. Subsequent development has focused on container resource management, addressing issues with systemd processes within containers not adhering to Kubernetes resource limits due to cgroup driver configurations. This post details a deep dive into a specific Linux kernel memory cgroup controller bug that caused inconsistent MySQL Pod startup times in KateSQL, leading to performance degradation. The investigation involved analyzing system calls, perf flamegraphs, and cgroup counts, ultimately identifying a cgroup leak. Mitigation strategies included node replacement and a workaround using `memory.force_empty`. The fix was confirmed by upgrading to GKE 1.18, which included upstream fixes for cgroup slab re-parenting bugs.

All Shopify trails