
Like INTERRUPTABLE_SLEEP, UNINTERRUPTABLE_SLEEP is a state where the process is waiting on something. It would be a waste of CPU to cycle through CPU time unnecessarily. Going into this process state while waiting for input allows the process to take a back seat and give other processes CPU time. In this state, a process can easily be terminated without issue. While it waits for this, a well coded application goes into the INTERRUPTABLE_SLEEP state. In other cases the process may be a web server and it is idling, waiting for a query. This may be in the form of input from the terminal such as asking the user for input.

INTERRRUPTABLE_SLEEP Process Stateĭuring the course of a process running, it will get to a point where it is waiting on data. This can happen in the physical world too when there are just too many processes scheduled to run and not enough CPU time available.

In a virtual machine environment this is more common as physical CPUs are over-provisioned so virtual CPUs may have a little more latency or CPU ready. The distinction between running and runnable is that a runnable process is ready and lined up to be run, but for whatever reason, the CPU is not ready for it to be scheduled.

This will affect CPU utilization metrics in terms of real-time usage. As the name implies, running is actively running and allocated to a CPU/CPU core or thread. Most of the time that distinction does not matter because it indicates the process is either queued up to run or in the process of running. While running and runnable are usually lumped together, there are minor differences between them. The common one is "ps aux"Īs always, refer to the man page for your distribution and specific command but the most common mappings of character to state are as follows. It accepts a few different flags depending on the information you want to look at. This will list processes based on the criteria you pass it with flags. The state is usually reflected as one character in the "S" column. This command lists the top processes running - and a few columns by default. The most simple way to find the process state is to use the top command.
UNIX PROCESSES STATES HOW TO
That understanding is even more important when we need to understand how to terminate or kill the processes as depending on the process state, it may require a different technique. Understanding these states can be very helpful when troubleshooting issues like resource exhaustion or out of control process generation. Each of these process states exist for a very well defined reason. They are as follows: running & runnable, interruptable_sleep, uninterruptable_sleep, stopped, and zombie. For this reason there are various states, some consume CPU, while others do not or if they do, very minimally. A process that is running consumes CPU so if all of the processes were always running, CPU usage would be very high and it would be difficult to run many processes at the same time. When introduced to the concept of processes, it is expected that these processes would be running 100% of the time. When you log out, all of those child processes get cleaned up as part of that log out. We won't go into too much detail about parent processes, but when you run new applications or processes, the parent process of those is your shell process. An example of this is when you login, your shell is a process. For that reason, there is a hierarchy of processes.

Often, those processes create other processes. Any application that needs to be run invokes a process. These can include ssh processes, sshd, and cron jobs. On every Linux operating system instance, there are processes that run.
