Skip to content

Commit b464d69

Browse files
committed
2017-02-01增加mysql在8G内存下的一个配置版本1
1 parent 3083cd0 commit b464d69

1 file changed

Lines changed: 31 additions & 28 deletions

File tree

  • favorite-file/MySQL-Settings/MySQL-5.6/8G-Memory-Machine

favorite-file/MySQL-Settings/MySQL-5.6/8G-Memory-Machine/my.cnf

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ default-character-set = utf8
66
[mysqld]
77
user = mysql
88
port = 3306
9+
server-id = 100866
910
default-storage-engine = InnoDB
1011
socket = /usr/program/mysql/data/mysql.sock
1112
pid-file = /usr/program/mysql/data/mysql.pid
@@ -15,33 +16,34 @@ character-set-server = utf8
1516
basedir = /usr/program/mysql
1617
datadir = /usr/program/mysql/data
1718
log-error = /usr/program/mysql/data/mysql-error.log
18-
server-id = 1
19+
1920
back_log = 512
2021
max_connections = 1000
21-
max_allowed_packet = 16M
22+
max_allowed_packet = 120M
2223
max_connect_errors = 1000000
2324
skip-name-resolve
2425
open_files_limit = 65535
2526
table_open_cache = 2048
26-
binlog_cache_size = 1M
27-
max_heap_table_size = 32M
28-
tmp_table_size = 32M
29-
read_buffer_size = 2M
30-
read_rnd_buffer_size = 8M
31-
sort_buffer_size = 2M
32-
join_buffer_size = 4M
33-
key_buffer_size = 64M
34-
thread_cache_size = 8
35-
thread_stack = 256k
27+
binlog_cache_size = 20M
28+
max_heap_table_size = 40M
29+
tmp_table_size = 40M
30+
read_buffer_size = 20M
31+
read_rnd_buffer_size = 20M
32+
sort_buffer_size = 20M
33+
join_buffer_size = 20M
34+
key_buffer_size = 40M
35+
thread_cache_size = 100
36+
thread_stack = 10M
3637
query_cache_type = 1
37-
query_cache_size = 8M
38-
query_cache_limit = 2M
38+
query_cache_size = 40M
39+
query_cache_limit = 10M
3940
ft_min_word_len = 4
4041
log-bin = /usr/program/mysql/data/mysql-bin
4142
binlog-format = mixed
42-
expire_logs_days = 30
43+
expire_logs_days = 14
4344
sync_binlog = 0
44-
slow_query_log = 1
45+
log-queries-not-using-indexes = 1
46+
slow_query_log = 0
4547
long_query_time = 3
4648
slow_query_log_file = /usr/program/mysql/data/mysql-slow.log
4749
performance_schema = 0
@@ -51,33 +53,34 @@ skip_external_locking
5153
table_definition_cache = 1024
5254
thread_concurrency = 2
5355
innodb = FORCE
56+
innodb_flush_method = O_DIRECT
5457
innodb_file_per_table = 1
5558
innodb_open_files = 500
56-
innodb_buffer_pool_size = 592M
59+
innodb_buffer_pool_size = 3G
5760
innodb_write_io_threads = 4
5861
innodb_read_io_threads = 4
5962
innodb_thread_concurrency = 0
6063
innodb_purge_threads = 1
6164
innodb_flush_log_at_trx_commit = 1
62-
innodb_log_buffer_size = 2M
63-
innodb_log_file_size = 64M
64-
innodb_log_files_in_group = 3
65+
innodb_log_buffer_size = 10M
66+
innodb_log_file_size = 256M
67+
innodb_log_files_in_group = 2
6568
innodb_max_dirty_pages_pct = 90
6669
innodb_lock_wait_timeout = 120
67-
innodb_additional_mem_pool_size = 2M
68-
bulk_insert_buffer_size = 8M
69-
myisam_sort_buffer_size = 8M
70+
innodb_additional_mem_pool_size = 10M
71+
bulk_insert_buffer_size = 64M
72+
myisam_sort_buffer_size = 64M
7073
myisam_max_sort_file_size = 100G
7174
myisam_repair_threads = 1
7275
interactive_timeout = 28800
7376
wait_timeout = 3600
7477

7578
[mysqldump]
7679
quick
77-
max_allowed_packet = 16M
80+
max_allowed_packet = 120M
7881

7982
[myisamchk]
80-
key_buffer_size = 8M
81-
sort_buffer_size = 8M
82-
read_buffer = 4M
83-
write_buffer = 4M
83+
key_buffer_size = 20M
84+
sort_buffer_size = 20M
85+
read_buffer = 20M
86+
write_buffer = 20M

0 commit comments

Comments
 (0)