Cannot create more than 32K threads?
Feng Zhou <[email protected]>
| Newsgroups | gmane.comp.lib.phil |
|---|---|
| Message-ID | <[email protected]> |
Hi, I was using the 'thread-limit' program from http://people.redhat.com/alikins/tuning_utils/thread-limit.c to test the number of threads it could create. It seems that it was always hitting some limit at 32K threads (cannot create thread 32762, to be exact). The error is ENOMEM. Here's the kernel/ulimit settings, /proc/sys/kernel/pid_max 300000 /proc/sys/kernel/threads-max 100000 ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 100000 pipe size (512 bytes, -p) 8 stack size (kbytes, -s) 32 cpu time (seconds, -t) unlimited max user processes (-u) 100000 virtual memory (kbytes, -v) unlimited It gave the same result on both a Debian 3 box with NPTL 0.56 compiled with gcc 3.4 CVS and GlibC CVS, kernel 2.5.70, and vanilla Redhat 9. I know I must be missing something because 100K threads with NPTL was reported. Thanks. -- Feng Zhou Graduate Student, CS Division, U.C. Berkeley http://www.cs.berkeley.edu/~zf/