akamming
Posts: 3
Joined: Mon Oct 01, 2018 10:06 am

kernel process suddenly taking a lot of cpu usage

Fri Jun 14, 2019 6:18 pm

Hi,

as of yesterday , i suddenly have a high average CPU Usage on my raspberry pi 3B+:

This is the pattern i see
High CPU.png
High CPU.png (77.75 KiB) Viewed 205 times

When i run top i see the kernel is taking almost 200% (2 cores i would guess)::

Code: Select all

Tasks: 130 total,   1 running,  80 sleeping,   0 stopped,   1 zombie
%Cpu(s): 23,2 us, 25,2 sy,  0,0 ni, 51,3 id,  0,0 wa,  0,0 hi,  0,4 si,  0,0 st
KiB Mem :   999036 total,   120564 free,   379876 used,   498596 buff/cache
KiB Swap:   102396 total,    90620 free,    11776 used.   511052 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
  478 root      20   0  221596 104772  12408 S 195,0 10,5   1707:52 Main
14431 pi        20   0    8232   3276   2712 R   1,0  0,3   0:00.09 top
  366 avahi     20   0    6524   2508   2108 S   0,3  0,3   0:14.65 avahi-daemon
 1123 medusa    20   0  353584 147632   8964 S   0,3 14,8  10:17.09 python2.7
13379 root      20   0       0      0      0 I   0,3  0,0   0:00.14 kworker/0:1-eve
13424 pi        20   0   11660   3568   2848 S   0,3  0,4   0:00.16 sshd
19246 domoticz  20   0  344540  75488  21276 S   0,3  7,6  38:49.45 domoticz
    1 root      20   0   28292   5384   4032 S   0,0  0,5   0:34.24 systemd
    2 root      20   0       0      0      0 S   0,0  0,0   0:00.14 kthreadd
    3 root       0 -20       0      0      0 I   0,0  0,0   0:00.00 rcu_gp

it is a production system (home automation for my own home), and i did not do any changes, and i checked the history. The behaviour seems to be new. Normally the cpu is around 5% all day.

How can i find out why the "Main" process (is this the kernel?) is so busy?

KR Arnold

epoch1970
Posts: 3538
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: kernel process suddenly taking a lot of cpu usage

Fri Jun 14, 2019 6:50 pm

This guy looks greedy:

Code: Select all

478 root      20   0  221596 104772  12408 S 195,0 10,5   1707:52 Main
it is not the kernel, it is an executable called "Main" (?) that was launched rather early, PID number is a smallish one (478).
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

akamming
Posts: 3
Joined: Mon Oct 01, 2018 10:06 am

Re: kernel process suddenly taking a lot of cpu usage

Fri Jun 14, 2019 7:04 pm

epoch1970 wrote:
Fri Jun 14, 2019 6:50 pm

it is not the kernel, it is an executable called "Main" (?) that was launched rather early, PID number is a smallish one (478).
aha thanks. That was the info i needed. When i ran "ps -edalf | grep Main" i could not find the process. And since it was called Main, i assumed it to be the kernel. But you're right. When i did a grep on the process number the process came up: "radarr".

i did a restart of the service and the behaviour is gone...

tx!

Return to “Raspbian”