大量新連接時減少線程創建開銷。
生產級配置模板(Dell R710、16G、日 IP 100-200W)
[mysqld]
back_log = 512
max_connections = 3000
table_open_cache = 4096
max_allowed_packet = 32M
read_buffer_size = 8M
read_rnd_buffer_size = 64M
sort_buffer_size = 16M
join_buffer_size = 16M
thread_cache_size = 16
thread_concurrency = 8
query_cache_size = 128M
query_cache_limit = 4M
key_buffer_size = 128M
bulk_insert_buffer_size = 256M
myisam_sort_buffer_size = 256M
myisam_max_sort_file_size = 10G
innodb_buffer_pool_size = 6G
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 2
innodb_thread_concurrency = 16
open_files_limit = 10240
常用狀態檢查命令
SHOW STATUS;
SHOW VARIABLES;
SHOW ENGINES;
SHOW ENGINE INNODB STATUS;
- 上一篇文章: Linux MySQL 簡易教程(一):安裝、啟動、建庫建表、切換庫
- 下一篇文章: MySQL Binlog 報錯「Unsafe statement」原因與解決:多唯一鍵表配合 INSERT ON DUPLICATE KEY UPDATE
Copyright © 程式碼之家 All Rights Reserved
|