Malintha
Malintha

Reputation: 4766

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

Upvotes: 5

Views: 54868

Answers (2)

rogerdpack
rogerdpack

Reputation: 66741

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.

Upvotes: 5

omegahost
omegahost

Reputation: 9

Editing the file requires a server reboot, you can use a simpler way:

chuser nofiles=10000 malintha

disconnect from you console and reconnect again using the username malintha. Use ulimit -n and the output should now be 10000.

Upvotes: 0

Related Questions