contatti

unix : posix thread

mysql : qualsiasi versione

Mysql utilizza i posix thread per le sessioni.
Per configurare un database mysql e' opportuno sapere il numero massimo di thread che si
possono utilizzare dato che a ciascuna sessione e' associato un thread.

In teoria il numero massimo di thread in un server linux e' scritto nel file
/proc/sys/kernel/threads-max
In pratica il numero massimo di thread che si possono usare e' piu' basso
perche' dipende da fattori come la memoria del server e la versione della libreria glibc.
Per avere una stima del numero di thread , si manda in esecuzione pthread-count da linea comando.
Per costruire pthread-count , si compila il programma sorgente pthread-count.c :
gcc pthread-count.c -o pthread-count -lpthread
La compilazione in ambiente HP-UX da' un warning che si puo' trascurare :
cc pthread-count.c -o pthread-count -lpthread

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