I am currently building a stress testing tool, and as such I need a pretty massive number of threads. I already went through all settings to raise the limit, but there is one last setting, the upper system-wide limit in /proc/sys/kernel/threads-max
, that I can't seem to be able to change.
I tried
sysctl -w kernel.threads-max=200000
Editing manually with nano
or echo
echo 200000 > /proc/sys/kernel/threads-max
Editing /etc/sysctl.conf
and running
sysctl -f
If I run those as sudo
, I have no error displayed (the new value is even displayed), but when checking again, the value hasn't changed either. When trying to edit the value with gedit
, it spat an
invalid argument"
whatever the value I try, even the original one. I had no problem changing the pid_max
value.
I really have no clue why it refuses my edits, and I haven't been able to find anybody with a similar problem, so I would be very grateful if someone could explain what is happening.
Best Answer
The repsonse lies in
man proc(5)
, here is the interesting part:I assume your kernel version is > 4.1, so since 200000 (the number you try) is less than 0x3fffffff, the problem looks like the available RAM in not sufficient.