Where the open-source database community meets: Secure your spot at PerconaLive.com
Back to all talks

Swap or Stop? How a Little Swap Can Keep PostgreSQL Running

Event: PGConf Europe 2026

Location: Valencia

Dates: 20 October 2026 – 23 October 2026

Presentation: 20 October 2026 , 01:00

Link: On event website

Speaker: Chetan Shivashankar

For years, the advice for Kubernetes was straightforward: disable swap. But with swap support becoming generally available in Kubernetes 1.34, it’s worth asking whether that guidance still makes sense for PostgreSQL workloads.

In this talk, we’ll follow the journey of swap from the Linux kernel all the way to the dashboards . We’ll look at how swap space is configured, how memory and swap are accounted with cgroups, and how Kubernetes exposes those metrics through tools such as cAdvisor and Prometheus.

More importantly, we’ll explore what actually happens when PostgreSQL encounters sudden memory pressure. Does the kernel immediately kill the pod? Can swap absorb short-lived memory spikes and give PostgreSQL enough breathing room to stay available? We’ll examine real-world scenarios where swap can prevent OOM kills and keep critical database services online. Unfortunately, there are no magic wands in life, and swap is no exception. We’ll discuss the trade-offs of using swap space so that you can evaluate if swap is suitable for your workloads.

Event

Speaker card

Swap or Stop? How a Little Swap Can Keep PostgreSQL Running

Speakers