3

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?

6

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.