Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the differences between the maximum number of connections and the maximum number of concurrent threads in mysql

Shulou Source: shulou.com Published: 2022-05-31 15:55:34 10月03日 Update

This article will explain in detail what is the difference between the maximum number of connections and the maximum number of concurrent threads in mysql. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Show variables like 'max_connections'

Max_connections: maximum number of concurrent connections supported

The maximum permitted number of simultaneous client connections

Show variables like 'innodb_thread_concurrency'

Innodb_thread_concurrency: the maximum number of threads supported for concurrent execution

InnoDB tries to keep the number of operating system threads concurrently inside InnoDB less than or equal to the limit given by this variable (InnoDB uses operating system threads to process user transactions). Once the number of threads reaches this limit, additional threads are placed into a wait state within a "First In, First Out" (FIFO) queue for execution. Threads waiting for locks are not counted in the number of concurrently executing threads.

Thread_concurrency: the maximum number of threads supported for concurrent execution

This variable is specific to Solaris 8 and earlier systems and allows the application to prompt the thread system for the number of threads that should run at the same time. This variable was deleted in MySQL 5.7.2.

This variable is specific to Solaris 8 and earlier systems, for which mysqld invokes the thr_setconcurrency () function with the variable value. This function enables applications to give the threads system a hint about the desired number of threads that should be run at the same time. Current Solaris versions document this as having no effect.This variable was removed in MySQL 5.7.2.

Check the number of connections to the server

Show status like 'Connections'

Check the maximum number of connections ever made

Show status like 'Max_used_connections'

View the number of threads currently connected

Show status like 'Threads_connected'

View the number of threads currently running

Show status like 'threads_running'

View the number of threads in the thread cache

Show status like 'threads_cached'

This is the end of the article on "what is the difference between the maximum number of connections and the maximum number of concurrent threads in mysql". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Thread maximum article support variable more system run good practical content at the same time application quantity article server times current knowledge program Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Huawei MariaDB Docker Shulou Information