Process ID is a unique identification number which is used to identify a particular process in Linux. PID has 16 bit number’s that are sequentially assigned to different processes on after the other.
After process execution, the process id number released from the process table for reuse.
PID stands for process identifier. It is an identification number that is automatically assigned to each process when it is create on Linux System. It is unique to each and every processes running on the Linux System. PID number start from 1. Process id 1 is always reserved for init process.
Why INIT gets the same PID number each and every time?
Answer is init is the first program that’s run on Linux System. That’s why PID number 1 is given to it and process id always starting from 1 in Linux. As we know INIT is the first process that get’s started and it is also the parent of all other processes in Linux.
On Linux System there is a limit to the maximum number of processes to run. This was started from kernel version 2.5. You can find the maximum number of PID of a Linux system using below command.
# cat /proc/sys/kernel/pid_max 32768
Above you can see that the maximum number of process id’s are 32768. It means only 32768 number of process can be run simultaneously at a time on Linux system.
If you see higher PID number 25000 on the system it does not means 25000 processes are running on Linux system. A process ID number 5000 does not means that it was started before the PID 25000. Because process id number always reused once process released.
You can increase the total number of PID if you have large amount of RAM is available on system. It is good to increase the number of processes that a server can handle.
Follow the below command to increase the maximum number of process ID on Linux system using below command.
Increase PID Number on Linux System
You will need to update sysctl.conf file to increase the max PID in Linux.
# vim /etc/sysctl.conf kernel.pid_max=<maximum value>
64 Bit Linux system can have only 4194303 is the maximum number of PID. So you will need to modify pid_max with higher value such as 4194303 by modifying Linux “/etc/sysctl.conf” file.
I hope this article will help to understand the Process ID or PID in Linux. If you have any queries and problem please comment in comment section.