3

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

2 Answers 2

7

The ulimit -u setting may be at work here.

2
  • $ ulimit -u 2000 -ksh: ulimit: nproc: is read only
    – Tim Swast
    Feb 22, 2013 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, 2013 at 23:44
5

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.

You must log in to answer this question.

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