воскресенье, 1 декабря 2013 г.

Оптимизация сервера #2 MySql

Оптимизируем работу Mysql


Открываем файл настроек

/etc/mysql/my.cnf
И меняем/добавляем параметры,

[client]
default-character-set = utf8

[mysqld]
#
# * Basic Settings
#
# skip-character-set-client-handshake
# init-connect = 'SET NAMES utf8'
default-character-set = utf8
character-set-server = utf8
collation-server = utf8_unicode_ci
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket        = /var/run/mysqld/mysqld.sock
port        = 3306
basedir        = /usr
datadir        = /var/lib/mysql
tmpdir        = /tmp
lc-messages-dir    = /usr/share/mysql
skip-external-locking

#
# * Fine Tuning
#
key_buffer        = 16M
max_allowed_packet    = 16M
net_buffer_length    = 16K
thread_stack        = 512K
thread_cache_size       = 128
tmp_table_size        = 128M
max_heap_table_size    = 128M

# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
max_connections        = 500
table_open_cache    = 2048
table_definition_cache    = 1024
thread_concurrency    = 8
innodb_buffer_pool_size    = 128M
innodb_flush_method    = O_DIRECT
innodb_flush_log_at_trx_commit = 0
innodb_file_per_table    = 1
sort_buffer        = 4M
read_buffer_size    = 2M
read_rnd_buffer_size    = 1M
join_buffer_size    = 2M
interactive_timeout    = 600

#
# * Query Cache Configuration
#
query_cache_limit    = 64M
query_cache_size        = 512M
query_cache_wlock_invalidate


expire_logs_days    = 1
max_binlog_size         = 10M

[mysql]
#no-auto-rehash    # faster start of mysql but no tab completition
default-character-set = utf8

Комментариев нет:

Отправить комментарий