InnoDBの場合とMyISAMの場合でのMySQLのメモリ設定をメモ。
メモリ8Gバイト搭載のCentOS6.xをデータベース専用で利用することを前提としたmy.cnfの設定値。
[mysqld] innodb_buffer_pool_size = 6G join_buffer_size = 4M sort_buffer_size = 4M read_rnd_buffer_size = 4M max_allowed_packet = 8M query_cache_size = 512M query_cache_type = 1 thread_cache_size = 512 max_connections = 100 wait_timeout = 1200 sql_mode = NO_ENGINE_SUBSTITUTION default_password_lifetime = 0 character-set-server = utf8 collation-server = utf8_general_ci datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock symbolic-links = 0 log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
[mysqld] key_buffer_size = 2G join_buffer_size = 4M sort_buffer_size = 4M read_rnd_buffer_size = 4M max_allowed_packet = 8M query_cache_size = 512M query_cache_type = 1 thread_cache_size = 512 max_connections = 100 wait_timeout = 1200 sql_mode = NO_ENGINE_SUBSTITUTION default_password_lifetime = 0 character-set-server = utf8 collation-server = utf8_general_ci datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock symbolic-links = 0 log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
Copyright(C) systemexpress.co.jp All Rights Reserved. Author Takayuki Yukawa