how to change the maximum number of fork process by user in linux
If you would like to change the limit only for that shell, you could run:
sudo ulimit -u 1000
If you want to make a more permanent change, you need to edit either /etc/limits.conf
or /etc/security/limits.conf
(depending on your linux distro) and add the following lines:
username hard nproc 1000
Substitute username
with the actual user name
Instead of username a groupname can also be used if you prefix it with an @
. If you use *
it would be the default for all users
Examples:
myuser hard nproc 1000
@mygroup hard nproc 3000
* hard nproc 500
This can be changed in /etc/security/limits.conf
. Look for lines of the form:
username hard nproc 25
@groupname hard nproc 100
These lines limit username
user to 25 processes and users in group groupname
to 100 processes. You will need root permissions on the machine though.
As others already mentioned look at limits.conf
. When you login into Gnome, KDE or any other GUI, you have likely more than 35 processes running already.
Logout from the GUI and switch to a VT with Ctl Alt F1, for example, and login without a GUI.
Now you should be able to look into /etc/security/limits.conf
. If it is empty or all commented out, you can look, if there's something in the directory /etc/security/limits.d
, which has reduced the ulimit
.
On the console, you should also be able to start additional processes for editing or adjusting limits.conf
or files in limits.d
.