Mysql

這是 my.cnf 的範例,後面有 Percona-only 的參數:(給 64GB 機器用的)

#
# http://www.mysqlperformanceblog.com/2006/09/29/what-to-tune-in-mysql-server-after-installation/
# http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/
#
[mysqld]
back_log = 65535
bulk_insert_buffer_size = 64M
expire_logs_days = 3
join_buffer_size = 8M
key_buffer_size = 32M
log_long_format
log_slow_queries
long_query_time = 2
max_allowed_packet = 8M
max_connect_errors = 4294967295
max_connections = 4096
myisam_max_extra_sort_file_size = 10G
myisam_max_sort_file_size = 10G
myisam_recover
myisam_repair_threads = 1
myisam_sort_buffer_size = 64M
query_cache_limit = 1M
query_cache_size = 256M
read_buffer_size = 2M
read_rnd_buffer_size = 16M
skip-federated
skip-locking
skip-name-resolve
socket = /tmp/mysql.sock
sort_buffer_size = 8M
table_cache = 1024
thread_cache_size = 16384
thread_concurrency = 8
thread_stack = 128K
tmp_table_size = 64M
#
innodb_additional_mem_pool_size = 8M
innodb_buffer_pool_size = 60G
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_per_table
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_lock_wait_timeout = 120
innodb_log_buffer_size = 4M
innodb_log_file_size = 64M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_thread_concurrency = 8
transaction_isolation = REPEATABLE-READ
#
# Percona version only: http://www.percona.com/docs/wiki/patches:innodb_io_patches
innodb_adaptive_checkpoint = 1
innodb_io_capacity = 200
innodb_read_io_threads = 8
innodb_write_io_threads = 8