[CentOS] kswapd taking 100% cpu with no swap on system

Thu May 12 17:26:50 UTC 2011
Simon Matter <simon.matter at invoca.ch>

> I Spoke too early its not fixed.Any one have other options
> On 05/09/2011 11:37 PM, Ali Ahsan wrote:
>> Things i have done to solve this issue is
>> set swappiness to 0 and i have changed scheduler to anticipatory for
>> better performance .I don't see kswpad process taking 100% CPU now.

We had a number of issues on a bigger box which was running 32bit PAE
kernel for historical reason. The box has then been migrated to 64bit and
then transferred to new hardware (HP DL585G7, 48 AMD cores and 64G ram).
The config which now works very well for us is:

- stock CentOS 5.x config
- 16G swap configured (but 0 used in 99.9% if time)
- following additional settings in /etc/sysctl.conf
# Controls how aggressive the kernel will swap memory pages
vm.swappiness = 10

# Controls the tendency to reclaim the memory which is used for caching
vm.vfs_cache_pressure = 1

Just in case to want to try something.