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
|
||||
@@ -0,0 +1,46 @@
|
||||
# Redis configuration file
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
timeout 300
|
||||
tcp-keepalive 300
|
||||
daemonize no
|
||||
pidfile /var/run/redis.pid
|
||||
loglevel notice
|
||||
logfile stdout
|
||||
databases 16
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
stop-writes-on-bgsave-error yes
|
||||
rdbcompression yes
|
||||
rdbchecksum yes
|
||||
dbfilename dump.rdb
|
||||
dir /data
|
||||
requirepass FireSkins@99999
|
||||
masterauth FireSkins@99999
|
||||
rename-command FLUSHDB ""
|
||||
rename-command FLUSHALL ""
|
||||
maxclients 10000
|
||||
maxmemory 1gb
|
||||
maxmemory-policy volatile-lru
|
||||
appendonly no
|
||||
appendfilename "appendonly.aof"
|
||||
appendfsync everysec
|
||||
no-appendfsync-on-rewrite no
|
||||
auto-aof-rewrite-percentage 100
|
||||
auto-aof-rewrite-min-size 64mb
|
||||
lua-time-limit 5000
|
||||
slowlog-log-slower-than 10000
|
||||
slowlog-max-len 128
|
||||
hash-max-listpack-entries 512
|
||||
hash-max-listpack-value 64
|
||||
list-max-listpack-size -2
|
||||
set-max-intset-entries 512
|
||||
set-max-listpack-entries 128
|
||||
set-max-listpack-value 64
|
||||
zset-max-listpack-entries 128
|
||||
zset-max-listpack-value 64
|
||||
client-output-buffer-limit normal 0 0 0
|
||||
client-output-buffer-limit slave 256mb 64mb 60
|
||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
hz 10
|
||||
@@ -0,0 +1,46 @@
|
||||
# Redis configuration file
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
timeout 300
|
||||
tcp-keepalive 300
|
||||
daemonize no
|
||||
pidfile /var/run/redis.pid
|
||||
loglevel notice
|
||||
logfile stdout
|
||||
databases 16
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
stop-writes-on-bgsave-error yes
|
||||
rdbcompression yes
|
||||
rdbchecksum yes
|
||||
dbfilename dump.rdb
|
||||
dir /data
|
||||
requirepass FireSkins@99999
|
||||
masterauth FireSkins@99999
|
||||
rename-command FLUSHDB ""
|
||||
rename-command FLUSHALL ""
|
||||
maxclients 10000
|
||||
maxmemory 2gb
|
||||
maxmemory-policy volatile-lru
|
||||
appendonly no
|
||||
appendfilename "appendonly.aof"
|
||||
appendfsync everysec
|
||||
no-appendfsync-on-rewrite no
|
||||
auto-aof-rewrite-percentage 100
|
||||
auto-aof-rewrite-min-size 64mb
|
||||
lua-time-limit 5000
|
||||
slowlog-log-slower-than 10000
|
||||
slowlog-max-len 128
|
||||
hash-max-listpack-entries 512
|
||||
hash-max-listpack-value 64
|
||||
list-max-listpack-size -2
|
||||
set-max-intset-entries 512
|
||||
set-max-listpack-entries 128
|
||||
set-max-listpack-value 64
|
||||
zset-max-listpack-entries 128
|
||||
zset-max-listpack-value 64
|
||||
client-output-buffer-limit normal 0 0 0
|
||||
client-output-buffer-limit slave 256mb 64mb 60
|
||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
hz 10
|
||||
@@ -0,0 +1,46 @@
|
||||
# Redis configuration file
|
||||
bind 0.0.0.0
|
||||
port 6379
|
||||
timeout 300
|
||||
tcp-keepalive 300
|
||||
daemonize no
|
||||
pidfile /var/run/redis.pid
|
||||
loglevel notice
|
||||
logfile stdout
|
||||
databases 16
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
stop-writes-on-bgsave-error yes
|
||||
rdbcompression yes
|
||||
rdbchecksum yes
|
||||
dbfilename dump.rdb
|
||||
dir /data
|
||||
requirepass FireSkins@99999
|
||||
masterauth FireSkins@99999
|
||||
rename-command FLUSHDB ""
|
||||
rename-command FLUSHALL ""
|
||||
maxclients 10000
|
||||
maxmemory 128mb
|
||||
maxmemory-policy volatile-lru
|
||||
appendonly no
|
||||
appendfilename "appendonly.aof"
|
||||
appendfsync everysec
|
||||
no-appendfsync-on-rewrite no
|
||||
auto-aof-rewrite-percentage 100
|
||||
auto-aof-rewrite-min-size 64mb
|
||||
lua-time-limit 5000
|
||||
slowlog-log-slower-than 10000
|
||||
slowlog-max-len 128
|
||||
hash-max-listpack-entries 512
|
||||
hash-max-listpack-value 64
|
||||
list-max-listpack-size -2
|
||||
set-max-intset-entries 512
|
||||
set-max-listpack-entries 128
|
||||
set-max-listpack-value 64
|
||||
zset-max-listpack-entries 128
|
||||
zset-max-listpack-value 64
|
||||
client-output-buffer-limit normal 0 0 0
|
||||
client-output-buffer-limit slave 256mb 64mb 60
|
||||
client-output-buffer-limit pubsub 32mb 8mb 60
|
||||
hz 10
|
||||
Reference in New Issue
Block a user