# This config is for: 64G, 2 * 6 physical cores with 24 threads
[client]
port = 3306
socket = /dev/shm/mysql.sock 
default-character-set = utf8

[mysqld_safe]
basedir = /usr
open-files-limit = 32000
user = mysql

[mysqld]
port = 3306
socket = /dev/shm/mysql.sock
basedir = /usr
datadir = /usr/local/mysql/data
pid-file = /usr/local/mysql/data/mysqld.pid
user = mysql
validate_password_policy = LOW

# Common
sql_mode = STRICT_ALL_TABLES,NO_ENGINE_SUBSTITUTION
lower_case_table_names = 1
skip-external-locking
skip-name-resolve
transaction-isolation = READ-COMMITTED
default-storage-engine = InnoDB
character-set-server = utf8
collation-server = utf8_general_ci
slow-query-log = 1
long_query_time = 5
ssl = off

# MyISAM
key_buffer_size = 64M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 64M

# Connection
wait_timeout = 3600
max_allowed_packet = 32M
max_connections = 5000
max_connect_errors = 10000
table_open_cache = 32000
thread_cache_size = 768
open-files-limit = 32000

# Buffer and cache
join_buffer_size = 64M
sort_buffer_size = 64M
read_buffer_size = 64M
read_rnd_buffer_size = 64M
tmp_table_size = 64M
max_heap_table_size = 256M
query_cache_size = 0
query_cache_type = 0

# InnoDB
innodb_doublewrite = 0
innodb_status_file = 1
innodb_file_per_table = 1
innodb_open_files = 32000
innodb_buffer_pool_size = 40G
innodb_buffer_pool_instances = 16
innodb_flush_method = O_DIRECT
innodb_log_group_home_dir = /usr/local/mysql/data
innodb_log_file_size = 1G
innodb_log_files_in_group = 2
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 0
sync_binlog = 0
innodb_data_file_path = ibdata1:1G:autoextend
innodb_io_capacity = 3000
innodb_lock_wait_timeout = 60
innodb_read_io_threads = 24
innodb_write_io_threads = 24 
innodb_thread_concurrency = 48
innodb_purge_threads = 1
innodb_flush_neighbors = 0
innodb_file_format = Barracuda

# Binlog
log-bin = mysql-bin
expire-logs-days = 31
binlog_cache_size = 4M
max_binlog_cache_size = 4G
binlog_format = ROW
server-id = 6464

# Master and slave
#replicate-do-db = test        #需要做复制的数据库名;这里不设置只配置备份的数据库
binlog-ignore-db = mysql       #不备份的数据库
binlog-ignore-db = information_schema
binlog-ignore-db = performation_schema
binlog-ignore-db = sys
#binlog-do-db = test #需要做复制的数据库名

[mysqldump]
quick
max_allowed_packet = 32M

[mysql]
no-auto-rehash
default-character-set = utf8

[isamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 16M
write_buffer = 16M

[myisamchk]
key_buffer = 64M
sort_buffer_size = 64M
read_buffer = 16M
write_buffer = 16M

[mysqlhotcopy]
interactive-timeout
# This config is for: 128G, 2 * 6 physical cores with 24 threads 

[client]
port = 3306
socket = /tmp/mysql.sock

[mysqld_safe]
basedir = /usr/local/mysql
user = mysql

[mysqld]
port = 3306
socket = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
user = mysql

log-error= /usr/local/mysql/data/mysqld.log
pid-file= /usr/local/mysql/data/mysqld.pid

# Common
server-id = 7493
sql_mode=STRICT_ALL_TABLES,NO_ENGINE_SUBSTITUTION
skip-external-locking
skip-name-resolve
transaction-isolation = READ-COMMITTED
default-storage-engine = InnoDB
character-set-server = utf8
collation-server = utf8_general_ci
slow-query-log
long_query_time = 10
performance_schema = ON
performance-schema-instrument='memory/%=COUNTED'

# MyISAM
key_buffer_size = 16M
bulk_insert_buffer_size = 16M
myisam_sort_buffer_size = 16M

# Connection
wait_timeout = 600
max_allowed_packet = 128M
max_connections = 2000
max_connect_errors = 10000
#table-open-cache = 16000
table-open-cache = 400
thread_cache_size = 256
open-files-limit = 65535

# Buffer and cache
join_buffer_size = 16M
sort_buffer_size = 16M
read_buffer_size = 16M
read_rnd_buffer_size = 16M
tmp_table_size = 16M
max_heap_table_size = 16M
query_cache_size = 0
query_cache_type = 0

# InnoDB
innodb_doublewrite = 0
innodb_status_file = 1
innodb_file_per_table = 1
innodb_open_files = 65535
innodb_buffer_pool_size = 80G
#innodb_buffer_pool_instances = 24
#modified by hezanyu
innodb_buffer_pool_instances = 8
innodb_flush_method = O_DIRECT
innodb_log_group_home_dir = /usr/local/mysql/data
innodb_log_file_size = 6G
innodb_log_files_in_group = 3
innodb_log_buffer_size = 64M
innodb_flush_log_at_trx_commit = 0
innodb_data_file_path = ibdata1:1G:autoextend
innodb_io_capacity = 5000
innodb_lock_wait_timeout = 20
innodb_read_io_threads = 24
innodb_write_io_threads = 24
innodb_thread_concurrency = 48
innodb_purge_threads = 1 
innodb_flush_neighbors = 0
#innodb_old_blocks_time = 0

# Thread
# Deprecated since 5.6
#thread_concurrency = 24

# Binlog 
#log-bin
#log-bin = /usr/local/mysql/log/mysql-bin
#log-bin-index = /usr/local/mysql/log/mysql-bin.index
#expire-logs-days = 3
#log-slave-updates = 1
#binlog_cache_size = 32M
#binlog_format = ROW

#relay-log = /usr/local/mysql/log/relay-bin
#relay-log-index = /usr/local/mysql/log/relay-bin.index
#relay_log_purge = 1
#master-host = 10.1.6.26
#master-user = slave
#master-password = 123456
#master-port = 3306
#master-connect-retry = 10
#replicate-wild-ignore-table = test.%
#replicate-wild-ignore-table = xmp.%
#replicate-wild-ignore-table = xlvideo_tv_live.%
#replicate-wild-ignore-table = media_info.%
#replicate-wild-ignore-table = percona.%
#skip-slave-start=1
#slave-skip-errors = 1062,1032,1146,1051
#slave-skip-errors = 1062,1032
#slave-skip-errors = 1062

[mysqldump]
quick
max_allowed_packet = 128M

[mysql]
no-auto-rehash

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 16M
write_buffer = 16M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 16M
write_buffer = 16M

[mysqlhotcopy]
interactive-timeout