MySQL HowTo: Set thread_cache_size variable
The easiest way to calculate the size is watching the increments of Threads_created status variable using this command:
mysqladmin -u root -p0c@Lxf3sMySqL -r -i 1 ext | grep Threads_created
The cache size should be large enough to reduce the increments to zero. It’s important to watch the results of the previous command during peak hours before choosing any value.