contatti

unix : posix thread


Mysql uses posix threads for client sessions.
To configure a mysql database , I want to know the max number of threads
because each client session is handled by separate thread.

In theory the max number of threads in a linux server is written in /proc/sys/kernel/threads-max
Actually the max number of threads that an application can use is smaller
because it depends on server ram and library glibc version
To know the max number of threads , you can execute pthread-count from command line
To build pthread-count , you compile the source program pthread-count.c :
gcc pthread-count.c -o pthread-count -lpthread
The below command gives a warning in HP-UX enviroment that you can ignore :
cc pthread-count.c -o pthread-count -lpthread

simplesix