4

I tried ulimit -u 2000 and ulimit -Su 2000 to modify the 'Max processes', and started up my program, but failed. I found file '/proc/pid/limit' is still:

Max processes             1024                 2000                 processes

How could I change the soft limit?

1 Answer 1

8

What does ulimit -a show?

You're likely at the global max limit or are encountering a permissions issue. I tried your experiment and it worked just fine for me.

Example

The output of a /proc/pid/limits looks like the following:

$ cat /proc/22666/limits | grep processes
Max processes             1024                 62265                processes 

$ ulimit -a | grep processes
max user processes              (-u) 1024

Setting the soft limit to 2000:

$ ulimit -Su 2000

$ ulimit -a | grep processes
max user processes              (-u) 2000

$ cat /proc/22666/limits | grep processes
Max processes             2000                 62265                processes 

What else?

I'd take a look at your /etc/security/limits.conf file and see if there is a limit coming from that file that's keeping regular users from changing this limit

I'd also look in the directory, /etc/security/limit.d/. There are additional files often times there which include more limits. For example on my Fedora system I have this file:

$ cat /etc/security/limits.d/90-nproc.conf 
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     1024

References

1
  • Actually the /proc/pid/limit output he shows indicates the hard limit is at 2000 and the soft limit still at 1024.
    – phemmer
    Nov 7, 2013 at 13:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .