mysql tuning
Posted: Sun Feb 10, 2013 6:11 pm
Что желательно сменить в настройке mysql (подтармаживает)?
Xeon E3 1230 3.2Ghzб 16гб Рам.
на сервере около 45 сайтов на смартсж с мылым траффом или без.
Вот конфиг:
# The MySQL server
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 1M
net_buffer_length = 2K
thread_stack = 128K
tmp_table_size = 1024M
max_heap_table_size =2048M
max_connections = 500
key_buffer_size = 512M
query_cache_size = 2048M
join_buffer_size = 256K
thread_cache_size = 32
table_cache = 8192
query_cache_limit = 4096M
wait_timeout=20
interactive_timeout=40
thread_concurrency=10
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id = 1
# Uncomment the following if you want to log updates
#log-bin=mysql-bin
# Disable Federated by default
skip-federated
# Uncomment the following if you are NOT using BDB tables
#skip-bdb
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
innodb_flush_log_at_trx_commit=2
innodb_buffer_pool_size=1024M
innodb_flush_method=O_DIRECT
innodb_log_file_size=128M
innodb_log_buffer_size=8M
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 8M
sort_buffer_size = 8M
[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Xeon E3 1230 3.2Ghzб 16гб Рам.
на сервере около 45 сайтов на смартсж с мылым траффом или без.
Вот конфиг:
# The MySQL server
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 1M
net_buffer_length = 2K
thread_stack = 128K
tmp_table_size = 1024M
max_heap_table_size =2048M
max_connections = 500
key_buffer_size = 512M
query_cache_size = 2048M
join_buffer_size = 256K
thread_cache_size = 32
table_cache = 8192
query_cache_limit = 4096M
wait_timeout=20
interactive_timeout=40
thread_concurrency=10
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
server-id = 1
# Uncomment the following if you want to log updates
#log-bin=mysql-bin
# Disable Federated by default
skip-federated
# Uncomment the following if you are NOT using BDB tables
#skip-bdb
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50
innodb_flush_log_at_trx_commit=2
innodb_buffer_pool_size=1024M
innodb_flush_method=O_DIRECT
innodb_log_file_size=128M
innodb_log_buffer_size=8M
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
[isamchk]
key_buffer = 8M
sort_buffer_size = 8M
[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid