<div class="gmail_quote">On Sat, Apr 11, 2009 at 5:48 PM, Artur Bergman <span dir="ltr"><<a href="mailto:sky@crucially.net">sky@crucially.net</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div style="WORD-WRAP: break-word">I've never seen it do worker threads not created.
<div><br></div>
<div>Are there any limits on number of threads? </div></div></blockquote>
<div> </div>
<div>Apparently there are; thanks for pointing me in the right direction. I found a C program that attempts to spawn threads and lets you know at what point it hits an error - <a href="http://people.redhat.com/alikins/tuning_utils/thread-limit.c">http://people.redhat.com/alikins/tuning_utils/thread-limit.c</a> - it reports that I can't open more than 383 threads. The question is why. Here's what I've done thus far:</div>
<div> </div>
<div>1) Recompiled glibc per <a href="http://people.redhat.com/alikins/system_tuning.html#threads">http://people.redhat.com/alikins/system_tuning.html#threads</a> - the definition of PTHREAD_THREADS_MAX is tied to the value in /usr/include/linux/limits.h so I adjusted that value, installed the source RPM, rebuilt all glibc RPMs and installed using 'rpm -Uvh --force' to overcome pre/post installation errors within the RPM (hopefully that did what it was supposed to).</div>
<div> </div>
<div>2) Set /proc/sys/kernel/threads-max to 65535 (was 3000ish before), no change</div>
<div> </div>
<div>3) Set /etc/security/limits.conf to "* soft nofile 1024" and "* hard nofile 10240" and added "session required /lib/security/pam_limits.so" to /etc/pam.d/login with no change, per the advice at <a href="http://www.mail-archive.com/java-linux@java.blackdown.org/msg15247.html">http://www.mail-archive.com/java-linux@java.blackdown.org/msg15247.html</a> where the poster indicates he did not have to recompile glibc to do this</div>
<div> </div>
<div>I've tried the same C program above on a few other Linux boxes and they all seem to be somewhere between 200 and 383 allowed threads. The first obvious solution would be to dump Linux and use FBSD - a direction i'll look into in the future. But for now we're stuck on Linux. Any ideas?</div>
<div> </div>
<div>-Ray</div>
<div> </div>
<div> </div>
<div> </div></div><br>