MySQL backlog

今天正巧看到了,先总结在这里

back_log

Command-Line Format --back-log=#
System Variable back_log
Scope Global
Dynamic No
SET_VAR Hint Applies No
Type Integer
Default Value -1 (signifies autosizing; do not assign this literal value)
Minimum Value 1

The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time. It then takes some time (although very little) for the main thread to check the connection and start a new thread. The back_log value indicates how many requests can be stacked during this short time before MySQL momentarily stops answering new requests. You need to increase this only if you expect a large number of connections in a short period of time.

In other words, this value is the size of the listen queue for incoming TCP/IP connections. Your operating system has its own limit on the size of this queue. The manual page for the Unix listen() system call should have more details. Check your OS documentation for the maximum value for this variable. back_log cannot be set higher than your operating system limit.

The default value is the value of max_connections, which enables the permitted backlog to adjust to the maximum permitted number of connections.

max_connections

Command-Line Format --max-connections=#
System Variable max_connections
Scope Global
Dynamic Yes
SET_VAR Hint Applies No
Type Integer
Default Value 151

The maximum permitted number of simultaneous client connections. The maximum effective value is the lesser of the effective value of open_files_limit - 810, and the value actually set for max_connections.

For more information, see Section 5.1.12.1, “Connection Interfaces”.

https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html
详解linux中的backlog

Subscribe to 隅

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe