(1) back_log: number of connections available to MySQL. When important MySQL threads get a lot of connection requests in a very short period of time, this works, and then the main thread takes some time (although very short) to check the connection and start a new thread. Back_l
(1) back_log:
The number of connections allowed by MySQL. When important MySQL threads get a lot of connection requests in a very short period of time, this works, and then the main thread takes some time (although very short) to check the connection and start a new thread.
The back_log value indicates the number of requests that can be stored in the stack within a short period of time before MySQL temporarily ends its reply to the new request. Only if there are many connections in a short period of time, you need to increase it. In other words, this value is the size of the listener queue for the incoming TCP/IP connection. Your control system has its own limit on the queue size. Trying to set the back_log to be higher than your control system limit will be invalid.
When you observe your host process list, you have created a large number of 264084 | unauthenticated user | ***. ***. ***. * ** | NULL | Connect | NULL | login | when the connection process is NULL, increase the value of back_log. The default value is 50. I will change it to 500.
(2) interactive_timeout:
The number of seconds the server waits for a behavior on an interactive connection before it is closed. An interactive customer is defined as a customer who applies the CLIENT_INTERACTIVE option to mysql_real_connect. The default value is 28800. I will change it to 7200.
(3), key_buffer_size:
The index block is buffered and shared by all threads. Key_buffer_size is the buffer size used to index the block. increasing the size of the block will give you an index with more benefits (for all reads and writes), so you can afford to do that much. If you make it too large, the system will begin to change pages and it will really slow down. The default value is 8388600 (8 M). my MySQL host has 2 GB of memory, so I changed it to 402649088 (400 MB ).
(4) max_connections:
Number of customers simultaneously agreed. Add this value to increase the number of file descriptors in the mysqld request. This number should be added. Otherwise, you will often see the Too connector connections error. The default value is 100. I will change it to 1024.
(5), record_buffer:
Each thread that performs an ordered scan allocates a buffer of this size to each table it scans. If you perform many sequential scans, you may want to increase the value. The default value is 131072 (128 K). I changed it to 16773120 (16 M)
(6) sort_buffer:
Each thread that needs to be sorted allocates a buffer of this size. Increase this value to accelerate order by or group by control. The default value is 2097144 (2 M). I changed it to 16777208 (16 M ).
(7), table_cache:
Number of tables opened for all threads. Adding this value can increase the number of file descriptors in the mysqld request. MySQL requires two file descriptors for each unique Open Table. The default value is 64. I changed it to 512.
(, Thread_cache_size:
The number of threads that can be reused. If yes, the new thread gets from the cache, and if there is space when the connection is disconnected, the customer's thread is placed in the cache. If there are many new threads, this variable value can be used to improve performance. By comparing variables in the Connections and Threads_created states, you can see the role of this variable. I set it to 80.
(10), wait_timeout:
The number of seconds the server waits for action on a connection before it is closed. The default value is 28800. I will change it to 7200.