Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change default number of max process per user in linux

I have faced a problem with the changing the default number of processes for user in linux. I have tried to edit /etc/security/limits.conf file with adding the following line.

malintha hard nproc 10000

After I saving it I tried following command on terminal

ulimit -u

and it give the previous value (1024) , But not the updated value. How can I fix this permanently ?

this is my limits.conf file

like image 857
Malintha Avatar asked Oct 03 '22 15:10

Malintha


1 Answers

The problem here is that you specify "hard" in

malintha hard nproc 10000

hard is the "max" limit, and soft is the default. So you can leave it as hard and then use ulimit -u 1000 and processes after that point, for that bash shell, will have the increased limit, or use soft, then it will be the default for all processes started by your user [remember to logout and re-login with each change].

For those looking to try and figure out why they are limited to [for instance] 1024 max theads for a given user, also note that it reads the /etc/security/limits.conf file and other /etc/security/limits.d/* files.

like image 64
rogerdpack Avatar answered Oct 07 '22 19:10

rogerdpack