2

I'm running an Ubuntu 17.10 server on the VDS. I'm running a 3proxy on it.
The problem is that VDS somehow does not allow running more than 5000 threads per process, as I think. I think so because the 3proxy process never exceed 5000 threads.

EDIT: the error I see in the logs is:

pthread_create():_Resource_temporarily_unavailable

So I want to check if I am right about it by checking the real thread-per-process limit. My idea is to create a script, which will start as many threads as system will allow, and check the result of how many will it be.

And my problem is that I don't know how to create such a script

1 Answers1

2

There is no threads per process limit!

But there is a limit on the total number of processes on the system (threads are essentially just processes with a shared address space on Linux)

cat /proc/sys/kernel/threads-max

The default is the number of memory pages divided by 4. You can increase this like:

echo 100000 > /proc/sys/kernel/threads-max

There is also a limit of processes (threads) that a single user may create, see ulimit for this, but this should be unlimited on Ubuntu.

Robert Riedl
  • 4,351