SShortSingh.
Back to feed

Go Apps Throttled in Kubernetes Due to GOMAXPROCS Misconfiguration — Here's the Fix

0
·1 views

Go applications running in Kubernetes pods can suffer intermittent P99 latency spikes because the Go runtime defaults to reading the physical node's CPU count via runtime.NumCPU(), ignoring the container's CPU limits enforced by Linux cgroups. On a 32-core node with a pod limit of 2 CPUs, the runtime spawns 32 OS threads, causing the Linux CFS scheduler to throttle the entire application when cgroup quota is exceeded within its 100ms window. Uber's open-source package go.uber.org/automaxprocs solves this by reading cgroup values at startup and setting GOMAXPROCS to match the actual container quota. Alternatively, developers can set GOMAXPROCS manually at init, though this risks falling out of sync if the pod spec changes. Starting with Go 1.25, scheduled for August 2025, the runtime will natively read cgroup CPU quotas on Linux and adjust GOMAXPROCS automatically, eliminating the need for any external dependency.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

GitHub Launches Human-in-the-Loop Controls for AI Agent Automation in Issues

GitHub announced agent automation controls for GitHub Issues on July 23, 2026, currently available in public preview. The feature allows AI agents to attach confidence levels — high, medium, or low — to proposed issue actions such as labeling, triaging, or closing. Repository administrators can set a minimum confidence threshold, below which agent suggestions require human approval before being applied. Each suggested action also includes a rationale, helping reviewers understand why the agent proposed a change and make faster, informed decisions. The controls aim to bridge the gap between slow manual triage and risky fully autonomous automation by keeping humans involved where judgment matters most.

0
ProgrammingDEV Community ·

Developer hits four dead ends trying to build Apple Shortcuts programmatically

A developer attempted to automate publishing to a REST API using Apple Shortcuts, building a three-step shortcut that lets Siri dictate and POST content directly to an endpoint. While the shortcut worked fine when built manually on-device, every attempt to create, sign, or deploy it through code failed. The macOS 'shortcuts sign' CLI rejected hand-written property lists and, on macOS 14.6, returned an iCloud authentication error even on valid files with iCloud fully enabled. The URL import scheme only accepted links hosted on Apple's own icloud.com domain, blocking any self-hosted or third-party file imports. The only partial workaround discovered was reverse-engineering an undocumented iCloud API endpoint that returns unsigned, readable shortcut plists from shared links.

0
ProgrammingDEV Community ·

A User's Journey Into the Hidden World of Mobile App Testing

A regular app user shares how their perspective on software updates shifted after exploring a mobile testing platform. Previously indifferent to the effort behind app development, they assumed testing simply meant checking that an app opened and ran without crashing. Digging deeper revealed a complex process involving functional testing, exploratory testing, and cross-platform compatibility checks across different devices and operating systems. Testers must account for everyday edge cases such as denied permissions, mid-payment disconnections, and varying screen sizes before an app reaches users. The experience highlighted that effective testing is largely invisible — when apps work seamlessly, the extensive preparation behind them goes unnoticed.

0
ProgrammingDEV Community ·

Five Common Docker Security Mistakes and How to Avoid Them

A developer with several years of Docker experience has outlined five recurring security mistakes observed in containerized application deployments. Key errors include assuming small self-hosted projects remain undiscovered, when in reality automated bots scan public IP space within minutes of a server going live. Many developers also mistakenly treat HTTPS as comprehensive security, when encryption only protects data in transit and does not block malicious requests like SQL injection or credential stuffing. Neglecting Layer 7 protections, such as Web Application Firewalls, leaves application endpoints exposed to HTTP-level attacks that infrastructure-level hardening cannot address. The article urges developers to close unnecessary ports, validate application inputs, and layer security measures rather than relying on any single control.