One of my servers has a process running called klogd which is running at 99.9% CPU according to top (output from top below)

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                               
 3932 klog      25   0  5932 2220   16 R 99.7  0.1 162333:28 klogd                                                                                                                                  
    1 root      15   0  4100  584  300 S  0.0  0.0   6:10.66 init                                                                                                                                   
    2 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0                                                                                                                            
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.33 ksoftirqd/0                                                                                                                            
    4 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0                                                                                                                             
    5 root      10  -5     0    0    0 S  0.0  0.0   0:03.63 events/0                                                                                                                               
    6 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper                                                                                                                                
    7 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kthread                                                                                                                                
   29 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kblockd/0                                                                                                                              
   30 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid                                                                                                                                 
   31 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kacpi_notify

Iv had a Google and this seems to be a standard process for handling logging. None of the log files seem to be really big and there's not too much else happening on the server.

The operating system is Ubuntu 9.04

link|improve this question
feedback

1 Answer

up vote 0 down vote accepted

What does strace -ppidof klogd`` show you?

link|improve this answer
I get the line read(0, ""..., 4095) = 0 repeatedly in a loop – mattfawcett Jul 30 '10 at 10:05
And what does sudo ls -l /proc/pidof klogd/fd/ show you? – Janne Pikkarainen Jul 30 '10 at 10:27
So, read() from the kmsg socket is indicating End Of File, which probably means nothing is connected to the other end. On my Ubuntu 8.04 servers there's a dd bs=1 if=/proc/kmsg of=/var/run/klogd/kmsg process running as root that writes to this socket. I guess dd was somehow killed on your server. I would reboot. – Marius Gedminas Jul 30 '10 at 11:42
Marius: Instead of rebooting straight away, I would first try to restart that dd (and klogd) and see if the cpu usage goes away. That just to check if the reason for klogd's strange behaviour was actually due the missing dd. – Janne Pikkarainen Jul 30 '10 at 11:47
Hi, Iv restarted klogd and it seems to be running at normal CPU. Its restart dd as well now which wasn't running before the restart. Thank you both for your help. – mattfawcett Jul 30 '10 at 13:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.