LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-20-2011, 05:35 AM   #1
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215
Blog Entries: 1

Rep: Reputation: 21
how to find how long a process is sleeping?


Hi Gurus

My servers are showing that quite large number of processes are in sleeping mode. But couldnt find how long the processess are in sleep mode. Can someone tell me how to find this?

OS: RHEL server release 5.4
HW: X86_64

Quote:

top - 17:05:08 up 38 days, 18:04, 227 users, load average: 0.90, 0.66, 0.62
Tasks: 1668 total, 1 running, 1555 sleeping, 107 stopped, 5 zombie
Cpu(s): 0.8%us, 0.7%sy, 0.0%ni, 98.2%id, 0.1%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 16432968k total, 16319456k used, 113512k free, 34732k buffers
Swap: 18481144k total, 140k used, 18481004k free, 8250264k cached
 
Old 12-21-2011, 04:26 AM   #2
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 50
If you do 'ps -aux', it will show starting time of all processes and there you can identify which process is running long time.
 
Old 01-05-2012, 02:29 AM   #3
kingston
Member
 
Registered: Mar 2008
Location: Bengaluru, India
Distribution: RHEL 5.5, Solaris 5.10
Posts: 215

Original Poster
Blog Entries: 1

Rep: Reputation: 21
hi

thanks for the reply. But when i do "ps -aux" now, it shows "2011" as the process start time, instead of giving exact "date & time". And also i couldnt understand the status like "Ss" "SN" "S<" "S+" "S<s""SsL""S<sl""S<Ls""Ss+". My intention is to kill the process which is sleeping for so long time and it shouldnt affect the Operating systems operations too..

Please find the attachment.
Attached Thumbnails
Click image for larger version

Name:	process.jpg
Views:	435
Size:	25.2 KB
ID:	8753  
 
Old 01-05-2012, 02:52 AM   #4
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Use :

# ps -eo pid,cmd,etime

will output all processes, with formatters to get PID, command run, and elapsed time.
 
Old 01-05-2012, 05:22 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by kingston View Post
Hi Gurus

My servers are showing that quite large number of processes are in sleeping mode. But couldnt find how long the processess are in sleep mode. Can someone tell me how to find this?

OS: RHEL server release 5.4
HW: X86_64
First of all have a look of all the processes which are running in background or stopped

Code:
#jobs
#ps -u | grep T  <---will look for stopped process and show you the time as well
#ps -u | grep Z  <--will lookout for zombie process
for example
Code:
#ps -u | grep T
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root      2210  0.1  0.0   4244   756 pts/1    T    22:23   0:00 cp -i /yum/
then to kill the jobs
Code:
#kill -9 pid no.

Last edited by deep27ak; 01-05-2012 at 05:25 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error while saving memory pages of a process- Sleeping in memory from invalid context Deep Narayan Dubey Linux - Kernel 1 04-05-2012 02:58 PM
How to find which process started a daemon process in autostart? indiajoe Linux - Desktop 4 10-25-2011 02:19 AM
Load average, run queue, sleeping process confusion rimtrim Linux - Server 4 09-11-2007 09:43 PM
Process Sleeping? crazenoela Linux - Newbie 1 12-23-2006 08:33 PM
sleeping process ku2006 Linux - General 1 05-07-2006 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration