Several issues encountered in the business database are resolved:
1.ibdata too big problem, ibdata30g around, do backup when storage write speed is very slow
Adding innodb_file_per_table=1 can modify InnoDB as a stand-alone tablespace pattern, and each table in each database generates a data space. Avoid the problem of ibdata growing too much
2.mysql queries too large, disk IO bottlenecks, causing the server to load too high to drag the server, resulting in business cannot access the database outage.
innodb_buffer_pool_size=25g adjust the cache size, 64G memory to 25G, because the server also to host other services, if the standalone server can allocate more memory to MySQL.
3. The current end of the data on the 50W data table traversal query, MySQL will use the/tmp directory, because the server independent partition TMP generally only 5G. Query production file full TMP will not be able to execute
So modify the MySQL tmp directory a relatively large directory, here with Tmpdir=/home/tmp
My.cnf
[Client]
#password = Your_password
Port = 3308
Socket =/home/richmail/var/mysql/mysql.sock
Default-character-set=utf8
# The MySQL server
[mysqld]
server-id = 1
log-bin = Mysql-bin
log-bin-trust-function-creators = 1
port = 3308
socket =/home/richmail/var/mysql/mysql.sock
datadir =/hwdata/mysql/
tmpdir=/home/tmp
#key_buffer = 256M
Max_allowed_packet = 5M
Table_cache =
Sort_buffer_size = 1M
Read_buffer_size = 1M
Myisam_sort_ Buffer_size = 64M
#thread_cache = 8
#query_cache_size = 16M
#thread_concurrency = 8
Basedir =/home/richmail /mysql
user = Richmail
# # #max_connections =5120
max_connections=1024
max_connect_errors=10240
# # # # #2016 -04-01###
#wait_timeout =100
# # #2015 -12-11 add####
Skip-name-resolve
#20160406
innodb_buffer_pool_size=25g #
Innodb_file_per_table=1
Innodb_log_file_size = 500M
Innodb_log_files_in_group = 4
Innodb_flush_log_at_trx_commit = 0
Sync_binlog=0
Query_cache_size = 0
Query_cache_type = 0
Transaction_isolation = read-committed
Binlog_format=mixed
max_binlog_size=512m
Max_binlog_cache_size = 1G
Thread_concurrency=32
Thread_cache_size = 64
Table_open_cache = 4096
Max_heap_table_size = 96M
Tmp_table_size = 96M
Key_buffer = 1G
Slow_query_log = 1
[Mysqldump]
Quick
Max_allowed_packet = 16M
[MySQL]
No-auto-rehash
[Isamchk]
Key_buffer = 128M
Sort_buffer_size = 128M
Read_buffer = 2M
Write_buffer = 2M
[Myisamchk]
Key_buffer = 128M
Sort_buffer_size = 128M
Read_buffer = 2M
Write_buffer = 2M
[Mysqlhotcopy]
Interactive-timeout
This article is from "Journal Diary Life" blog, please make sure to keep this source http://daijh.blog.51cto.com/762214/1768495
Configuration optimization for MySQL production system (7W user mailserver)