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
I took the bus to work a few days ago. Based on m...
First of all, I don't know why I can't lo...
Preface I believe everyone knows that indexes are...
1. Introduction In the past, if you wanted to emp...
This article shares the specific code of Vue recu...
Table of contents Discover: Application of displa...
Preface: To store multiple elements, arrays are t...
Table of contents 1. Single database backup 2. Co...
Preface I recently encountered this requirement a...
The one I wrote before is too complicated, let’s ...
First check the kernel version you are using lin@...
Preface If you are going to interview for a Linux...
Table of contents Overview Static type checking C...
Table of contents 1. Regular expression creation ...
The results are different in Windows and Linux en...