3

I'm trying to figure out the max number of threads on a system.

Doing a man ulimit says:

For the shell command ulimit(), see bash(1).

Doing a man bash says:

-T The maximum number of threads

But then doing a ulimit -T gives me:

bash: ulimit: -T: invalid option
ulimit: usage: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]

What gives?!

Snowcrash
  • 80,579
  • 89
  • 266
  • 376

1 Answers1

2

As described in this answer:

https://stackoverflow.com/a/31878124/11741770

it looks like this option is among a few other ulimit options that aren't implemented on Linux, which it looks like you are using based on question tags. It might be available on other *nix platforms. The builtin help page on ulimit gives a disclaimer:

Not all options are available on all platforms.

As far as I can tell, it looks like the reason that this option isn't implemented is because the limit on Linux is derived from other attributes of the system. As described in this answer:

https://serverfault.com/a/418424

the current limit on a Linux system is found in /proc/sys/kernel/threads-max

The maximum number of threads seems to be able to be changed by editing /proc/sys/kernel/threads-max (which won't survive a reboot) or by adjusting the parameters that are used to derive this number.

tlake29
  • 121
  • 2
  • 5