Swap Smart, Save Big - Jing Yan & Antti Kervinen, Intel
Channel: CNCF [Cloud Native Computing Foundation]
Date: 2024-03-23

Don't miss out! Join us at our next Flagship Conference: KubeCon + CloudNativeCon North America in Salt Lake City from November 12 - 15, 2024. Connect with our current graduated, incubating, and sandbox projects as the community gathers to further the education and advancement of cloud native computing. Learn more at https://kubecon.io

Swap Smart, Save Big - Jing Yan & Antti Kervinen, Intel

A container requests and uses gigabytes of memory, but it has never accessed more than half of that in the past hour. You could run two of these containers with the same amount of RAM without a performance penalty! Just halve the container's memory request and enable swap. But how to know how large a portion of containers’ memory is inactive? And how to configure swapping? In this talk, we demonstrate monitoring containers’ memory usage in detail and discuss various swapping options. System-wide swapping has reached beta in Kubernetes 1.28. It takes action when a node's memory is running low. Container-specific swapping options allow, for instance, using memory only up to a certain limit and swapping out the rest regardless of the system memory situation. Or more flexibly, using a lot of memory for some time, but swapping out data once stopped accessing it. These measures help keep overall system performance steady by keeping more RAM free.