Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

Memory configuration parameters

sort_buffer_size

The session memory parameter allocates a memory size for each connection, and the size cache is allocated once the statements sent by the session need to be sorted

join_buffer_size

Multiple table join queries are common in applications. MYSQL uses JOIN_buffer to assist in join operations to reduce the number of join table reads and improve performance when performing joins

read_buffer_size

MYSQL allocates a read cache size to a table when sequential scanning is performed

read_rnd_buffer_size

MYSQL random cache size. When a random read is performed, a cache is allocated

innodb_buffer_size

InnoDB uses this parameter to specify the size of memory to buffer data and indexes

key_buffer_size

Determines the speed of myISAM index processing, only for myISAM index buffering

IO configuration parameters

innodb_log_file_size

This value sets the size of the redo log file

innodb_log_files_in_group

This value sets the number of redo log files

innodb_log_buffer_size

Redo log Cache pool size

innodb_flush_log_trx_commit

This parameter sets how the mysql redo log is flushed to log files. This parameter has the following three values:

0: Every second mysql flusher the redo log buffer to the operating system cache and to disk, but the transaction commit does not cause any action. At least 1 second of data will be lost.

1: Log is written to cache and data is flushed to disk on each transaction commit. (Default Settings)

2: Data will be flushed to the cache of the operating system during transaction submission but will not be flushed to disks. As a result, data may be lost for 1s in the event of a system crash.

Security-related Configuration

expire_logs_days

Specifies the number of days for reserving binary logs

skip_name_reslve

Disabling DNS Lookup

read_only

Set the database to read-only mode

skip_slave_start

Primary/secondary replication is not enabled after mysql is started

Other Configuration Parameters

back_log

The back_log value indicates how many requests can be placed on the stack in a short time before MySQL temporarily stops answering new requests. That is, if MySql connection data reaches max_connections, new requests will be placed on the stack waiting for a connection to release resources. The stack number is called back_log. If the number of connections waiting exceeds back_log, no connection resources will be granted

wait_timeout

Maximum idle time of the MYSQL client database connection

If the MYSQL connection is idle for more than a certain period of time, it will be forcibly closed

max_connection

Maximum number of mysql connections

max_user_connections

Maximum connections per database user