High `kswapd0` CPU under memory pressure on aws-k8s-1.35+
Author: SparksssjCreated Aug 27, 2026Updated Aug 27, 2026
Labelstype/bugtype/enhancementstatus/needs-triage
Summary of the issue
The issue mostly happens on small instances, and can present as:
kswapd0becomes the largest CPU consumer. It reached 91.7% CPU in our reproduction.- The node shows high system CPU and I/O wait. Our reproduction showed 59.2% system CPU and 21.5% I/O wait.
- Kubernetes becomes stuck launching pods, with pods remaining in
ContainerCreating. - Pods fail to start or respond promptly, including readiness probe failures.
- The node becomes
NotReady.
Workaround
For node groups where Bottlerocket user data can be configured, zram can be disabled during boot with a bootstrap container:
[settings.bootstrap-containers.configure-noswap]
mode = "always"
essential = true
user-data = "IyEvYmluL2Jhc2gKc2V0IC1ldXgKZXhlYyAxPiYyCgpST09URlM9Ii8uYm90dGxlcm9ja2V0L3Jvb3RmcyIKWlJBTUNUTD0iL3Vzci9zYmluL3pyYW1jdGwiCgojIERvbmF0ZSBvdXIgY29weSBvZiB6cmFtY3RsIGlmIHRoZSBob3N0IGRvZXNuJ3QgaGF2ZSBpdHMgb3duLgppZiBbICEgLXMgIiR7Uk9PVEZTfS8ke1pSQU1DVEx9IiBdIDsgdGhlbgogIGNwIC91c3Ivc2Jpbi96cmFtY3RsICIke1JPT1RGU30iL2xvY2FsCiAgWlJBTUNUTD0iL2xvY2FsL3pyYW1jdGwiCmZpCgpjaHJvb3QgIiR7Uk9PVEZTfSIgc3dhcG9mZiAvZGV2L3pyYW0wCmNocm9vdCAiJHtST09URlN9IiAiJHtaUkFNQ1RMfSIgLXIgL2Rldi96cmFtMApjaHJvb3QgIiR7Uk9PVEZTfSIgbW9kcHJvYmUgLXIgenJhbQo="This runs the following script:
#!/bin/bash
set -eux
exec 1>&2
ROOTFS="/.bottlerocket/rootfs"
ZRAMCTL="/usr/sbin/zramctl"
if [ ! -s "${ROOTFS}/${ZRAMCTL}" ]; then
cp /usr/sbin/zramctl "${ROOTFS}"/local
ZRAMCTL="/local/zramctl"
fi
chroot "${ROOTFS}" swapoff /dev/zram0
chroot "${ROOTFS}" "${ZRAMCTL}" -r /dev/zram0
chroot "${ROOTFS}" modprobe -r zramIn the reproduction above, removing the zram device returned CPU usage to normal while memory usage remained high.
Related issues
Source: bottlerocket-os/bottlerocket