Idle Process Exhausting CPU


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Idle Process Exhausting CPU
# 1  
Old 11-04-2014
Idle Process Exhausting CPU

I noticed when having some trouble with code I was testing that the CPU was becoming exhausted and I would have to reboot. After rebooting a couple times I decided to check for other problems before trying my code again. That's when I noticed that the CPU with the idle process was through the roof:

Code:
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                       
   11 root     120   0     0   64    0 R 800.0  0.0   4185:44 idle

I wanted to use lsof on the process, but apparently that is not an option with kFreeBSD. I tried using sockstat, but it seemed that no parameters I tried worked. I tried searching online, but all the documentation seemed to be for FreeBSD and not kFreeBSD. The man page didn't seem to be much help either.

Any suggestions?
# 2  
Old 11-04-2014
I believe that kFreeBSd supports the /proc filesystem - you can use that to get what you want.

Code:
cd /proc/11
ls -l   # list the component "files" and "directories"

There should be some thing like fd or path that will do the job of identifying open files.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 11-05-2014
You are correct. /proc/11 exists, but I can't cat it. It appears to be soft-linked to nowhere:

Code:
# ls -l /proc/11
total 0
-r--r--r-- 1 root root 0 Nov  5 17:49 cmdline
lr--r--r-- 1 root root 0 Nov  5 17:49 cwd -> unknown
-r--r--r-- 1 root root 0 Nov  5 17:49 environ
lr--r--r-- 1 root root 0 Nov  5 17:49 fd -> unknown
-r--r--r-- 1 root root 0 Nov  5 17:49 maps
lr--r--r-- 1 root root 0 Nov  5 17:49 root -> unknown
-r--r--r-- 1 root root 0 Nov  5 17:49 stat
-r--r--r-- 1 root root 0 Nov  5 17:49 statm
-r--r--r-- 1 root root 0 Nov  5 17:49 status

Do you know how I would view this or what its linked to?

Last edited by Azrael; 11-05-2014 at 07:59 PM..
# 4  
Old 11-05-2014
I do not know kFreeBSD at all well. I do know the /proc filesystem is called procfs. So, there should be some C include file (header file) that has the structure of all of the procfs files. These are used in all of the commands like ps, top, etc.

Try this:
Code:
find /usr/include -type f -name '*proc*'

This User Gave Thanks to jim mcnamara For This Post:
# 5  
Old 11-05-2014
This:
https://wiki.debian.org/Debian_GNU/k...le_CPU_time.3F

says basically that the idle process is like kernel processes under VMS (swapper) and other OSes. It is not consuming cpu. It runs when absolutely nothing else wants the cpu.
You can view the source as well.

Your problems are coming from some other source.
This User Gave Thanks to jim mcnamara For This Post:
# 6  
Old 11-06-2014
Thank you for the incite. I confirmed what you pointed at in the wiki was correct. After I generated a little activity the idle process dropped off to nothing. I'll go back to debugging my code now. Thanks again!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

idle% cpu and run queue

Hi Everybody, Can anybody explain how CPU idle% is about 50%, but runq-sz more than 1? sar from Solaris 10: 00:00:05 %usr %sys %wio %idle 17:00:08 27 12 0 61 17:20:05 40 15 0 45 17:40:05 27 12 0 61 18:00:05 23... (2 Replies)
Discussion started by: sant
2 Replies

2. Solaris

Why CPU idle 0 process nohub lose

Hello Solaris 8 when CPU idle 0 . why nohub process lose ? Thank (1 Reply)
Discussion started by: ppmanja
1 Replies

3. Shell Programming and Scripting

Help on shell script conditional execution when CPU Idle > 60%

I need a shell script that will monitor a few conditions and not execute until the these conditions are met. The problem I'm having is that I can not perform a database snapshot (backup) of a sybaseIQ database unless the CPU Status Idle % is above 60% or the snapshot (backup) fails. If... (2 Replies)
Discussion started by: pancona99
2 Replies

4. Solaris

top is showing 0% cpu Idle

What should we do if we show a 0% cpu idl on top? (5 Replies)
Discussion started by: Pouchie1
5 Replies

5. Shell Programming and Scripting

How to get the information about cpu idle from top command?

I am using Ubuntu 9.04. I want to write a shell script to get the information about cpu idle from top command at the real time when i call it, compare cpu idle with 20 (20%), if cpu idle > 20 exit 1, vice versa exit 0. Anybody can help me to resolve it ? Thanks alot. (7 Replies)
Discussion started by: huyquocnguyen
7 Replies

6. UNIX for Dummies Questions & Answers

CPU 0% idle - how do I find what was running?

Hi, I checking yesterday's SAR logs for one of our servers and it was showing that utilisation was down to 0% for 10 minutes at 2am. We're unaware of any jobs running at this time so need to find out which process caused this spike. Is there anything built into SAR (or does anything else exist)... (11 Replies)
Discussion started by: dlam
11 Replies

7. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

8. HP-UX

vmstat displays cpu idle time at 100%

Since yesterday the vmstat command is displaying the cpu idle time at 100%At each time interval. It never changes. Not sure what it means other than it Quit calculating that stat. And I'm curious why. Using sar I can display a correctCpu idle percent, but vmstat does not. Any ideas why or... (2 Replies)
Discussion started by: tfrye
2 Replies

9. HP-UX

sar output gives 98% idle CPU

Dear All, Our HPUX 8 GB 8CPU database server is behaving abnormally for the last 4+ weeks. I have generated a sar output and it is here- 11:46:52 %usr %sys %wio %idle 11:46:53 1 1 6 92 11:46:54 0 1 0 99 11:46:55 0 1 0... (3 Replies)
Discussion started by: Ashrunil
3 Replies

10. Solaris

CPU idle

hi when should we consider that CPU is loaded? When it is 100% idle or 0%idle?? tx (4 Replies)
Discussion started by: melanie_pfefer
4 Replies
Login or Register to Ask a Question