first commit
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
ARG MYSQL_BASE_IMAGE=mysql:8.0.24
|
||||
FROM ${MYSQL_BASE_IMAGE}
|
||||
|
||||
ARG MYSQL_CONF=my.cnf.16c32g
|
||||
COPY ${MYSQL_CONF} /etc/mysql/conf.d/my.cnf
|
||||
@@ -0,0 +1,32 @@
|
||||
[mysqld]
|
||||
# ===== 网络 =====
|
||||
skip-host-cache
|
||||
skip-name-resolve
|
||||
|
||||
# ===== InnoDB 核心性能(16C/32G 服务器 / SSD) =====
|
||||
innodb_buffer_pool_size = 5G
|
||||
innodb_flush_method = O_DIRECT
|
||||
innodb_flush_log_at_trx_commit = 2
|
||||
innodb_log_file_size = 512M
|
||||
innodb_log_files_in_group = 2
|
||||
innodb_log_buffer_size = 32M
|
||||
innodb_io_capacity = 1000
|
||||
innodb_io_capacity_max = 4000
|
||||
innodb_read_io_threads = 4
|
||||
innodb_write_io_threads = 4
|
||||
|
||||
# ===== 禁用 binlog(无需主从复制) =====
|
||||
skip-log-bin
|
||||
|
||||
# ===== 连接数 =====
|
||||
max_connections = 200
|
||||
max_user_connections = 180
|
||||
|
||||
# ===== 临时表 =====
|
||||
tmp_table_size = 32M
|
||||
max_heap_table_size = 32M
|
||||
|
||||
# ===== 慢查询日志 =====
|
||||
slow_query_log = ON
|
||||
slow_query_log_file = /var/lib/mysql/slow.log
|
||||
long_query_time = 1
|
||||
@@ -0,0 +1,32 @@
|
||||
[mysqld]
|
||||
# ===== 网络 =====
|
||||
skip-host-cache
|
||||
skip-name-resolve
|
||||
|
||||
# ===== InnoDB 核心性能(32C/64G 服务器 / SSD) =====
|
||||
innodb_buffer_pool_size = 8G
|
||||
innodb_flush_method = O_DIRECT
|
||||
innodb_flush_log_at_trx_commit = 2
|
||||
innodb_log_file_size = 1G
|
||||
innodb_log_files_in_group = 2
|
||||
innodb_log_buffer_size = 64M
|
||||
innodb_io_capacity = 1000
|
||||
innodb_io_capacity_max = 4000
|
||||
innodb_read_io_threads = 8
|
||||
innodb_write_io_threads = 8
|
||||
|
||||
# ===== 禁用 binlog(无需主从复制) =====
|
||||
skip-log-bin
|
||||
|
||||
# ===== 连接数 =====
|
||||
max_connections = 300
|
||||
max_user_connections = 280
|
||||
|
||||
# ===== 临时表 =====
|
||||
tmp_table_size = 64M
|
||||
max_heap_table_size = 64M
|
||||
|
||||
# ===== 慢查询日志 =====
|
||||
slow_query_log = ON
|
||||
slow_query_log_file = /var/lib/mysql/slow.log
|
||||
long_query_time = 1
|
||||
@@ -0,0 +1,31 @@
|
||||
[mysqld]
|
||||
# ===== 网络 =====
|
||||
skip-host-cache
|
||||
skip-name-resolve
|
||||
|
||||
# ===== InnoDB 核心性能(开发环境) =====
|
||||
innodb_buffer_pool_size = 256M
|
||||
innodb_flush_log_at_trx_commit = 2
|
||||
innodb_log_file_size = 128M
|
||||
innodb_log_files_in_group = 2
|
||||
innodb_log_buffer_size = 8M
|
||||
innodb_io_capacity = 1000
|
||||
innodb_io_capacity_max = 2000
|
||||
innodb_read_io_threads = 4
|
||||
innodb_write_io_threads = 4
|
||||
|
||||
# ===== 禁用 binlog =====
|
||||
skip-log-bin
|
||||
|
||||
# ===== 连接数 =====
|
||||
max_connections = 30
|
||||
max_user_connections = 25
|
||||
|
||||
# ===== 临时表 =====
|
||||
tmp_table_size = 32M
|
||||
max_heap_table_size = 32M
|
||||
|
||||
# ===== 慢查询日志 =====
|
||||
slow_query_log = ON
|
||||
slow_query_log_file = /var/lib/mysql/slow.log
|
||||
long_query_time = 1
|
||||
Reference in New Issue
Block a user