I am attempting to spin up 1000x Docker containers via:
nohup docker run --rm --name n-$1-$2 n-v2 bash -c "/root/sw/run.sh $1 $2" 2> ~/logs/log-$1-$2.log &
But after about 500x containers I start getting the following error:
fork: retry: No child processes
The server I am running this on has 48x cores and 192 GB of ram ... I should be able to spin up several thousand of these containers with no problem ... is there a way to increase this limit?
After doing some googling I found that I can check the number of max forks via ulimit -u
... is there a way to change this?
Soren A
's answer seems legit, however it doesnt seem like this solved the issue. I can get to ~12287 threads (checed via cat /sys/fs/cgroup/pids/user.slice/user-1000.slice/pids.current
) before I start hitting the same issue ... both my hard and soft limits in /etc/security/limits.conf
are set to 99999999
yet I am still being capped at around 12287
/sys/fs/cgroup/pids/user.slice/user-1000.slice/pids.max
as explained in the answer I pointed you to. I just had 118205 simultaneous processes running on my computer, although it took some doing. – Doug Smythies Feb 18 '17 at 00:41