my.cnf 配置
2015-09-24
### AUTHOR: Leo ### DATE: 2015/09/24 ### REV: 1.0 [client] port = 3306 socket = /tmp/mysql.sock [mysql] auto-rehash default-character-set = utf8 [mysqld] server_id = 47 port = 3306 socket = /tmp/mysql.sock datadir = /data/mysql/3306 character-set-server = utf8 default-storage-engine = INNODB skip-external-locking skip-name-resolve wait_timeout = 100 interactive_timeout = 100 back_log = 500 myisam_recover event_scheduler = ON sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES ################### bin log ###################### log_bin = /data/mysql/3306/mysql-bin binlog_format = row max_binlog_size =28M binlog_cache_size = 2M expire-logs-days = 5 ################### slow log ###################### slow_query_log = 1 slow_query_log_file = /data/mysql/3306/mysql.slow long_query_time = 2 ################### error log #################### log-error = /data/mysql/3306/error.log ################### replication #################### #slave-net-timeout = 10 #rpl_semi_sync_master_enabled = 1 #rpl_semi_sync_master_wait_no_slave = 1 #rpl_semi_sync_master_timeout = 1000 #rpl_semi_sync_slave_enabled = 1 #skip-slave-start #log_slave_updates = 1 #relay_log_recovery = 1 ############### per_thread_buffers ################# max_connections = 1024 max_user_connections = 1000 max_connect_errors = 10000 key_buffer_size = 64M max_allowed_packet = 128M #table_cache = 3096 table_open_cache = 6144 table_definition_cache = 4096 sort_buffer_size = 512K read_buffer_size = 512K read_rnd_buffer_size = 512K join_buffer_size = 512K tmp_table_size = 64M max_heap_table_size = 64M query_cache_type = 0 query_cache_size = 0 bulk_insert_buffer_size = 32M thread_cache_size = 64 #thread_concurrency = 8 thread_stack = 256K ############## InnoDB ######################## innodb_data_home_dir = /data/mysql/3306 innodb_log_group_home_dir = /data/mysql/3306 innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend innodb_buffer_pool_size = 6144M innodb_buffer_pool_instances = 8 innodb_additional_mem_pool_size = 16M innodb_log_file_size = 1024M innodb_log_buffer_size = 64M innodb_log_files_in_group = 3 innodb_flush_log_at_trx_commit = 2 innodb_lock_wait_timeout = 10 innodb_sync_spin_loops = 40 innodb_max_dirty_pages_pct = 90 innodb_support_xa = 1 innodb_thread_concurrency = 0 innodb_thread_sleep_delay = 500 innodb_file_io_threads = 4 log_bin_trust_function_creators = 1 innodb_flush_method = O_DIRECT innodb_file_per_table innodb_read_io_threads = 4 innodb_write_io_threads = 4 innodb_io_capacity = 2000 innodb_file_format = Barracuda innodb_purge_threads = 1 innodb_purge_batch_size = 32 innodb_old_blocks_pct = 75 innodb_change_buffering = all transaction_isolation = READ-COMMITTED [mysqldump] quick max_allowed_packet = 128M myisam_max_sort_file_size = 10G [myisamchk] key_buffer_size = 64M sort_buffer_size = 256K read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout [mysqld_safe] open-files-limit = 28192
参考:
1.http://www.linuxyw.com/a/shujuku/20130506/216.html
2.https://blog.linuxeye.com/379.html
3.http://leeyin.iteye.com/blog/1459274