---
title: "Clouds, caches and connection conundrums"
description: "After migrating to Google Cloud, sporadic Postgres and memcached connection timeouts on GKE turned out to be node-wide, not process-local."
url: "https://swe.quest/articles/clouds-caches-and-connection-conundrums-9abdd4ad0c3450ff"
canonical: "https://incident.io/blog/clouds-caches-and-connection-conundrums"
source: "incident.io"
published: "2023-09-26"
difficulty: "medium"
kind: "Incident"
reading_minutes: 10
tags: ["kubernetes","networking","incident-response","debugging","postgres"]
---

# Clouds, caches and connection conundrums

A post on [incident.io](https://swe.quest/sources/incident-io.md), published 2023-09-26, 10 min read, Incident. Original: [https://incident.io/blog/clouds-caches-and-connection-conundrums](https://incident.io/blog/clouds-caches-and-connection-conundrums)

## Summary

After migrating to Google Cloud, sporadic Postgres and memcached connection timeouts on GKE turned out to be node-wide, not process-local. Bursts of rapidly opened TCP connections, from concurrent cache sets, GCS URL generation and a runaway query fanning out external calls, spiked CPU in the Dataplane V2 anetd agent and caused dropped packets. Partial mitigations helped: static Postgres pools with a longer connection lifespan cut new connections from ~200/s to ~1/s, and raising memcache MaxIdleConns from 2 to 20 also reduced timeouts. The lasting fix is connection reuse plus limits on outbound network concurrency rather than disabling Dataplane V2. Network timeouts should be investigated at the node level, not just per pod.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Kubernetes](https://swe.quest/tags/kubernetes.md) (Infrastructure)
- [Networking](https://swe.quest/tags/networking.md) (Infrastructure)
- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)
- [Debugging](https://swe.quest/tags/debugging.md) (Engineering practices)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)

## Prerequisites

- Kubernetes nodes and pods ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))
- TCP connection pooling ([easy posts on Networking](https://swe.quest/tags/networking.md?difficulty=easy))
- Go concurrency basics ([easy posts on Go](https://swe.quest/tags/go.md?difficulty=easy))

## Keywords

GKE, Dataplane V2, anetd, memcached, Google Cloud, PostgreSQL

## Related posts

- [Incident Report: April 23rd, 2025](https://swe.quest/articles/incident-report-april-23rd-2025-f0e6e4113e1badba.md): Railway · 2025-04-23 · Medium · 4 min read · Incidents & postmortems, Resilience, PostgreSQL, Networking, Caching
  A Google Cloud SQL maintenance window took Railway's networking control plane Postgres read replica offline for about 10 minutes, destabilizing edge, private networking and TCP proxy traffic across all regions, worst in Asia.
- [2023-03-08 incident: A deep dive into the platform-level recovery](https://swe.quest/articles/2023-03-08-incident-a-deep-dive-into-the-platform-level-recovery-ad2b07fa89f3cad4.md): Datadog Engineering · 2023-06-16 · Hard · 21 min read · Incidents & postmortems, Kubernetes, Cloud platforms, Capacity planning, Networking
  Recovering from Datadog's March 8, 2023 multi-region outage, triggered by a systemd-networkd patch on Ubuntu 22.04 that cut network connectivity for nodes running Cilium, required restoring Kubernetes clusters in a strict order: parent control planes, then child control planes hosted on parent nodes, then application nodes.
- [Using Neon’s Scale to Zero with Long-Running Applications](https://swe.quest/articles/using-neon-s-scale-to-zero-with-long-running-applications-bbe64dd8466d86d8.md): Neon · 2024-01-24 · Medium · 7 min read · PostgreSQL, Serverless, Resilience, JavaScript, Performance engineering
  Neon's scale to zero suspends a Postgres compute after an idle window (only when no WAL senders are active and autovacuum isn't running), which severs connections held by long-running servers.
- [It’s always DNS . . . except when it’s not: A deep dive through gRPC, Kubernetes, and AWS networking](https://swe.quest/articles/it-s-always-dns-except-when-it-s-not-a-deep-dive-through-grpc-kubernetes-and-44627d906e7c0646.md): Datadog Engineering · 2022-04-13 · Hard · 18 min read · Networking, Kubernetes, DNS, Linux, Incidents & postmortems
  Errors during rollouts of Datadog's metrics query service looked like DNS failures, but the root cause was VPC connection tracking saturation on AWS ENIs.
- [Postmortem: Delayed Start Compute Operations](https://swe.quest/articles/postmortem-delayed-start-compute-operations-703bb5a68f31485c.md): Neon · 2025-05-21 · Medium · 4 min read · Incidents & postmortems, Kubernetes, Networking, Cloud platforms, Scaling
  A query plan change overloaded Neon's control plane database in AWS us-east-1, which stopped it from suspending idle databases.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
