Tricks to running many threads: * On 32-bit platforms, by default you are limited to 32K PIDs. To increase, modify PID_MAX_LIMIT in $KERNEL/include/linux.threads.h I set mine to 1M (1024 * 1024). On 64-bit platforms, it defaults to 4M, so this should be safe. * With this limit removed, increase the runtime PID limit: # echo 100000 >/proc/sys/kernel/pid_max # cat /proc/sys/kernel/pid_max 100000 * And the thread limit: # echo 100000 >/proc/sys/kernel/threads-max # cat /proc/sys/kernel/threads-max 100000 * And the map limit: # echo 200000 >/proc/sys/vm/max_map_count # cat /proc/sys/vm/max_map_count 200000