[kwlug-disc] fun: 10k to a million threads and more?

Chris Frey cdfrey at foursquare.net
Tue May 30 04:36:51 EDT 2023


Just out of curiosity, I'm trying to tweak my system to allow for the
creation of a million idle threads.

So far I can't even crack 10k. :-)

I've attached a simple C++ program I'm using to test with.

So far my tweaks have looked like this:

	echo 200000 > /proc/sys/kernel/threads-max
	echo 200000 > /proc/sys/kernel/pid_max
	echo 600000 > /proc/sys/vm/max_map_count
	ulimit -s 256
	ulimit -i 200000
	ulimit -n 1048576

When I run maxthreads 9300 or so, lsof shows about 400k open files.
Without maxthreads running, lsof shows about 30k.

Any clues for more tweaks?

Thanks,
- Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: maxthreads.cc
Type: text/x-c++src
Size: 847 bytes
Desc: not available
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20230530/975c6349/attachment.bin>


More information about the kwlug-disc mailing list