System Administration

How to find blocked process id

Go to solution
Occasional Contributor

How to find blocked process id


How to find the blocked process's id , glance is not installed on the server

Your help is really appreciated.

# vmstat 1 5

         procs           memory                   page                              faults       cpu

    r     b     w      avm    free   re   at    pi   po    fr   de    sr     in     sy    cs  us sy id

    1     2     0   832414   19668  272   28   136   32    30    0   254    702  12472  1118  43  4 53

    1     2     0   832414   19597  195   15   110   33    48    0   844    746   5427   874   0  4 96

    1     2     0   832414   19593  176   15    93   26    38    0   675    739   4822   872   2  2 96

    1     2     0   832414   19593  160   15    79   20    30    0   797    716   4367   835   1  2 97

    1     2     0   832414   19592  148   15    68   16    24    0   637    701   3958   808   0  2 98



Bill Hassell
Honored Contributor

Re: How to find blocked process id

You probably misunderstand what a blocked process means. A process that is getting information from another process will be blocked until the data is ready...which is what is desired. A blocked process is irrelevant to performance questions. You need to understand how processes depend on each other and fix the source process that may be too slow. Or a process can be blocked by priority which means there aren't enough CPUs to handle the load so lower priority processes will be blocked. And a process can be blocked because it has been deactivated and paged out to make room for other processes.

In your example, vmstat shows that you are severely short of RAM. The indicator is the "po" column. It should be zero or no more than 5-10 intermittantly. po is the page out rate and indicates that swapping is taking place because there is not enough RAM for all the processes. Swapping (or paging) is catastrophic to performance. There are only three ways to fix this:

1. Stop running so many processes at the same time,
2. Reduce the amount of RAM used by the processes with configuration changes,
3. Buy more RAM (a lot, probably 100% more)

You can confirm memory and swap usage with this command:

swapinfo -tam


Bill Hassell, sysadmin
Occasional Contributor

Re: How to find blocked process id

Thanks for the reply , this helped me to understand how processes are getting locked.

Is there any commands like in Linux to list process in D state

Bill Hassell
Honored Contributor

Re: How to find blocked process id

The ps command is fairly unique to every flavor of Unix. Indeed, the Linux man page lists more than 2 dozen personalities of ps. So for HP-UX, the man page does not list the 'D' state found in Linux (uninterruptible sleep). From the Linux man page:

Here are the different values that the s, stat and state output specifiers
(header "STAT" or "S") will display to describe the state of a process.
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct ("zombie") process, terminated but not reaped by its parent.

And from the HP-UX man page:

state The state of the process:

0 Nonexistent
S Sleeping
W Waiting
R Running
I Intermediate
Z Terminated
T Stopped
X Growing

The default heading for this column is S.

To see the 'S' column, use the -el options. Perhaps you can explain what it is you are looking for.
If you want to see disk I/O, use sar -d 2 2
For CPU usage, top will sort by descending CPU usage.

Bill Hassell, sysadmin