// stats_collection logs from controller nodes
root@avi-controller:~# cat /var/lib/avi/log/stats_collection.log
INFO [stat_collector.pprint_ntuple:216] host swap memory: Total : 12.0G, Used : 12.0G, Free : 3.4M, Percent : 100.0%...
INFO [stat_collector.pprint_ntuple:216] host memory: Total : 31.4G, Available : 7.3G, Percent : 76.6%, Used : 17.8G...
The high swap memory utilization is normal and expected behavior for Linux-based systems, including the Avi Controller, especially when configured with low swappiness.
Linux Memory Management: The Linux kernel moves memory pages that are very seldom used or considered "unlikely to be needed soon" to the swap space, even if ample physical RAM is available. This is a mechanism to free up physical RAM for more active data and disk buffers/cache, optimizing overall system performance.
Avi Swappiness Setting: Avi Controllers are configured with a low swappiness value of 1 (cat /proc/sys/vm/swappiness returns 1). This is the minimum possible value, meaning the kernel is very reluctant to swap, but it will still proactively move inactive memory pages to swap.
Non-Concerning Usage: Since the overall controller physical memory usage is only around 72%–76% (well below critical thresholds ~85%), the system is simply utilizing swap space efficiently to manage inactive data pages, which poses no impact to the customer or system performance.
Swap space usage only becomes a concern when:
RAM is fully consumed (approaching 85% or more consistently).
The kernel is forced to continuously swap pages between RAM and disk ("thrashing"), which would result in high disk I/O activity.
root@avi-controller:~#smem -tka
root@avi-controller:~#smem -w -p
root@avi-controller:~#smem -t -p
root@avi-controller:~#smem -u -p
root@avi-controller:~#free && sync && echo 3 > /proc/sys/vm/drop_caches && free
root@avi-controller:~#top -b -o +%MEM | head -n 30
root@avi-controller:~#ps aux --sort=-%mem | head -n 30
Workaround: