...
You now can raise it temporarily with the following command with root permission:
echo "<value>" > /proc/sys/kernel/threads-max
If you found a thread limit that is enough for your system you can add this permanently by adding the following entry to the file /etc/sysctl.conf
User can change the system threads permanently through the following entry:
sudo sysctl -w kernel.threads-max=<value> >> /etc/sysctl.conf
Example:
sudo sysctl -w kernel.threads-max=1030055 >> /etc/sysctl.conf
...