MySQL can be connected not only through the network, but also through named pipes. Regardless of which method is used to connect to MySQL, all client requests are managed by threads in MySQL. Each client connection will have a corresponding connection thread. A Thread Cache pool is implemented in MySQL to store idle connection threads instead of destroying them after completing the request. In this way, when there is a new connection request, MySQL will first check whether there is an idle connection thread in the Thread Cache. If so, it will be taken out and used directly. If there is no idle connection thread, a new connection thread will be created. Specific parameters: mysql> show variables like 'thread%'; As shown in the figure, the system sets the Thread Cache pool to cache up to 25 connection threads. When each connection thread is created, the system allocates 192KB of memory stack to it. mysql> show status like 'connections'; mysql> show status like '%thread%'; Since the system was started, it has received 620 client connections and created 7 connection threads. Currently, 1 connection thread is connected to the client, and only one of the 3 connection threads is in the active state, that is, only one is processing the request submitted by the client. A total of 3 connection threads are cached in the Thread Cache pool. Practical Application: For 16G/32G machines, 512K is generally set Of course, if you encounter the following error message, you should consider increasing this value. mysql-debug: Thread stack overrun Bug info Error message: Official corresponding information: The default (192KB) is large enough for normal operation. If the thread stack size is too small, it limits the complexity of the SQL statements that the server can handle, the recursion depth of stored procedures, and other memory-consuming actions Can be used Query the default thread stack size of the current database. Generally, it can be used normally. However, when the query statement or stored procedure is complex, a Thread stack overrun error will be reported. In this case, just modify the default configuration. solve Windows: Modify the my-small.ini or my.ini file in the MySQL installation directory to 256k or larger, then restart the service. [mysqld] [mysqld] You may also be interested in:
|
<<: HTML5 and jQuery to implement preview code examples before uploading local pictures
>>: How to Rename Multiple Files at Once in Linux
This article shares the specific code of node+exp...
Today, when I was configuring Tomcat to access th...
The content of the written Dockerfile is: FROM py...
Event loop in js Because JavaScript is single-thr...
Running environment, Idea2020 version, Tomcat10, ...
This example uses jQuery to implement a mouse dra...
Hardware View Commands system # uname -a # View k...
1. Page requirements 1) Use standard headers and ...
In MySQL, you can specify multiple indexes for a ...
Preface This experiment prepares two virtual mach...
This article shares the specific code of JavaScri...
docker attach command docker attach [options] 容器w...
Connecting to MySQL Here I use navicat to connect...
I recently encountered a problem. The emoticons o...
The filter attribute defines the visual effect of...