thread_limits

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: Large numbers of threads in MySQL
From: Chris Sears <cbsears@ix.netcom.com>
Date: Wed, 19 Jan 2000 17:54:29 -0800




At the BALUG meeting last night, *someone with dreadlocks*
asked about large numbers of threads being created by MySQL.

Threads in glibc are native threads which are mapped one to one
onto processes.

The first limit, in tasks.h is NR_TASKS which default to 512.
There is also a per user limit.

But for x86 there is another limit that you should be aware of
and that is about 4096.  Each task has two entries in the GDT,
global descriptor table, one for its LDT and one for its TSS,
task state segment.  The x86 GDT has a limit of 8096 entries,
so 4096 processes.

This is covered in the Linux Core Kernel Commentary on page 502.

This was true pre 2.4.  It changes in 2.4 and tasks.h goes away.
Now there will be max_threads.  It is settable via via /proc or sysctl.
Look in fork.c in 2.39.

You might want to look at these articles as well.

http://www-4.ibm.com/software/developer/library/java2/index.html
http://www.citi.umich.edu/projects/linux-scalability/index.html

Hope this helps.  Hope it gets to the right guy.

===


the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu