Показать сообщение отдельно
Старый 04.05.2010, 08:30   #1
lina
Новичок
 
Аватар для lina
 
Регистрация: 29.04.2010
Сообщений: 11
Сказал(а) спасибо: 18
Поблагодарили 4 раз(а) в 2 сообщениях
lina На верном пути
По умолчанию Оптимизация Mysql {my.cnf}

Помню на прошлом форума тема была очень популярная, сегодня тоже столкнулся с этим) в принципе взял гугл в руки кое что нашёл для себя, но мне показалось визуально что innodb стало еще больше тормозить чем по дефолту где её выделялось всего 20 мб про все.

Цитата:
[mysqld]
#
# * Basic Settings
#

#
# * IMPORTANT
# If you make changes to these settings and your system uses apparmor, you may
# also need to also adjust /etc/apparmor.d/usr.sbin.mysqld.
#

user = mysql
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 100M
max_allowed_packet = 160M
thread_stack = 256K
thread_cache_size = 16
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
max_connections = 500
table_cache = 312
sort_buffer_size = 1M
read_buffer_size = 512K
read_rnd_buffer_size = 1M
thread_concurrency = 6
#
# * Query Cache Configuration
#
query_cache_limit = 3M
query_cache_size = 80M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1

log_error = /var/log/mysql/error.log

# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

innodb-data-file-path = ibdata1:150M:autoextend:max:300M
innodb_buffer_pool_size = 256M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_log_buffer_size = 8M
innodb_log_file_size = 45M
innodb_thread_concurrency = 6
# innodb_file_per_table
innodb_additional_mem_pool_size = 12M

# innodb_buffer_pool_size = 256M
# innodb_additional_mem_pool_size = 20M
# innodb_log_file_size = 40M
# innodb_log_buffer_size = 10M
# innodb_flush_log_at_trx_commit = 1

[mysqldump]
quick
quote-names
max_allowed_packet = 150M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 70M
sort_buffer_size = 64M
read_buffer = 1M
write_buffer = 1M
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Конфиг - Core 2 quad, 6GB, для меня важно что бы mysql не хавал гигабайт от памяти, ведь кроме него есть еще и сервер)

где можно поправить ?(уменьшить, увеличить значение) для более высокой производительности.

lina вне форума   Ответить с цитированием