Comments on: MySQL terminology: processes, threads & connections https://shlomi-noach.github.io/blog/mysql/mysql-terminology-processes-threads-connections Blog by Shlomi Noach Wed, 25 Jan 2017 20:54:00 +0000 hourly 1 https://wordpress.org/?v=5.3.3 By: SacTiw https://shlomi-noach.github.io/blog/mysql/mysql-terminology-processes-threads-connections/comment-page-1#comment-382369 Wed, 25 Jan 2017 20:54:00 +0000 https://shlomi-noach.github.io/blog/?p=2465#comment-382369 >>> But then, there is a thread pool, which means there can be threads which are not associated with any connection. So, the number of threads is greater than or equal to the number of connections.

Actually that’s quite opposite to philosophy of having thread pool, idea with thread pool is to have minimum no. of threads running for serving ‘n’ no. of connections. Basically all the connections are spread across thread groups and scheduler initializes each thread group with single thread called ‘listener’ thread, it listens for incoming statement request and tries to execute it immediately if it can else it puts it in a queue to be executed later. Statement waits in queue for specific time and then a new thread is spawned to execute the statement.

In other words, with thread pool enabled, max_threads = max_connections + no. of thread groups (in worst case scenario)

]]>
By: Ovais Tariq https://shlomi-noach.github.io/blog/mysql/mysql-terminology-processes-threads-connections/comment-page-1#comment-20236 Thu, 04 Nov 2010 05:59:15 +0000 https://shlomi-noach.github.io/blog/?p=2465#comment-20236 This explanation will really help out a lot of guys and I hope SHOW PROCESSLIST gets changed to SHOW THREADLIST 🙂

]]>
By: LenZ https://shlomi-noach.github.io/blog/mysql/mysql-terminology-processes-threads-connections/comment-page-1#comment-20175 Wed, 03 Nov 2010 09:50:06 +0000 https://shlomi-noach.github.io/blog/?p=2465#comment-20175 Very well explained. Thanks for the writeup!

]]>