This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

High CPU usage (99%) kswapd0 on ASG/UTM 9.305-4

Hi all,

I'm running ASG/UTM 9.305-4.

Every few days, I see a spike in CPU usage caused by kswapd0:

top - 09:35:30 up 6 days, 12:29,  1 user,  load average: 1.06, 1.03, 1.05
Tasks: 163 total,   2 running, 159 sleeping,   0 stopped,   2 zombie
Cpu(s):  0.0%us, 25.4%sy,  0.0%ni, 74.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3792464k total,  3519572k used,   272892k free,   364348k buffers
Swap:  4190204k total,    27428k used,  4162776k free,  1637560k cached

  PID USER      PR  NI  VIRT  RES  SHR S   %CPU %MEM    TIME+  COMMAND         
  338 root      20   0     0    0    0 R     99  0.0   3587:29 kswapd0          
 1152 root      20   0     0    0    0 S      1  0.0   3:55.21 scsi_eh_1        
13461 postgres  20   0  563m 9616 7936 S      1  0.3   0:00.46 postgres         
16318 root      20   0     0    0    0 S      1  0.0   0:00.31 kworker/0:2      
30871 postgres  20   0  562m 5888 4608 S      1  0.2   0:13.97 postgres         
    1 root      20   0  1916  572  516 S      0  0.0   0:02.47 init             
    2 root      20   0     0    0    0 S      0  0.0   0:00.02 kthreadd         
    3 root      20   0     0    0    0 S      0  0.0   0:11.24 ksoftirqd/0      
    5 root       0 -20     0    0    0 S      0  0.0   0:00.00 kworker/0:0H     
    7 root      RT   0     0    0    0 S      0  0.0   0:00.27 migration/0      
    8 root      20   0     0    0    0 S      0  0.0   0:01.98 rcu_bh           
    9 root      20   0     0    0    0 S      0  0.0   1:31.84 rcu_sched        
   10 root      RT   0     0    0    0 S      0  0.0   0:00.39 migration/1      
   11 root      20   0     0    0    0 S      0  0.0   0:02.81 ksoftirqd/1      
   13 root       0 -20     0    0    0 S      0  0.0   0:00.00 kworker/1:0H     
   14 root      RT   0     0    0    0 S      0  0.0   0:00.30 migration/2      
   15 root      20   0     0    0    0 S      0  0.0   0:01.62 ksoftirqd/2      


The CPU remains at this level until I restart the system. Has anyone else encountered this problem?

I've found that I can reduce the problem temporarily by using the following command to drop the kernel caches on the UTM:

echo 1 > /proc/sys/vm/drop_caches

which drops the CPU usage from kswapd0 down to zero for a while. Today, I noticed it was back. So I've put the command above in a cron job to run every hour for now, but I was wondering if there is another solution?

If it's of any help, the ASG/UTM runs on a Hypervisor (XenServer 6.5 build 90239c) with 4 CPUs and 4Gb of memory assigned to it.

Thanks,
Paulo


This thread was automatically locked due to age.
Parents
  • I will try giving it 8Gb of RAM first and see how it goes; I'll try 2 CPUs if that doesn't work.

    I'm not running massive amounts of services. I'm running it at home, fronting a 80Mb DSL line. 
    Services wise, it's Firewall, Intrusion Prevention, Web Filtering, Remote Access and Antivirus/Spam etc..  There's only a few users and about 10 devices or so. Both the Hypervisor and the UTM VM are running on an SSD...

    I'll let you know how it goes.

    I got the idea for dropping the kernel caches from here:

    IBM High CPU usage of kswapd process causes system to become unresponsive - United States

    that actually suggests providing less memory, not more. There's a whole bunch of other discussions on the Internet regarding kswapd0 and kernel (Google search 'kswapd0 high cpu') which seems to indicate a bug in some version of more recent Linux kernels.

    Will let you know how it goes. Thanks for the help.
Reply
  • I will try giving it 8Gb of RAM first and see how it goes; I'll try 2 CPUs if that doesn't work.

    I'm not running massive amounts of services. I'm running it at home, fronting a 80Mb DSL line. 
    Services wise, it's Firewall, Intrusion Prevention, Web Filtering, Remote Access and Antivirus/Spam etc..  There's only a few users and about 10 devices or so. Both the Hypervisor and the UTM VM are running on an SSD...

    I'll let you know how it goes.

    I got the idea for dropping the kernel caches from here:

    IBM High CPU usage of kswapd process causes system to become unresponsive - United States

    that actually suggests providing less memory, not more. There's a whole bunch of other discussions on the Internet regarding kswapd0 and kernel (Google search 'kswapd0 high cpu') which seems to indicate a bug in some version of more recent Linux kernels.

    Will let you know how it goes. Thanks for the help.
Children
No Data