Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to launch more than 1000 processes, but it hangs at 999.

e.g.

#!/usr/bin/env zsh
for i in {1..$1} ; do
  sleep 300 &
done

Then running it,

$ ./launchsleep.sh 3000                                                                         
./launchsleep.sh:4: job table full
share|improve this question
add comment

2 Answers

The ulimit -u setting may be at work here.

share|improve this answer
    
$ ulimit -u 2000 -ksh: ulimit: nproc: is read only –  Tim Swast Feb 22 '13 at 23:10
    
Also, I have already edited the /etc/project file to increase the number for process.max-processes to 4096. –  Tim Swast Feb 22 '13 at 23:44
add comment
up vote 5 down vote accepted

It turns out that zsh (and most other shells) have a job table with a maximum size. This table keeps track of the background processes, and when it fills up, you can't launch any more background processes.

My workaround was to change my script to launch daemon processes rather than a bunch of background processes.

e.g.

launch.sh:
#!/usr/bin/env zsh
for i in {1..$1} ; do
  ./dosleep.sh
done

dosleep.sh:
#!/usr/bin/env zsh
nohup sleep 300 &

Also, as @Iain has mentioned, Solaris has a limit on the number of processes a user can launch (ulimit -u). In Solaris 11, to increase this limit edit /etc/project and increase project.max-processes.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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