[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-links=0 # To enable the InnoDB Plugin, uncomment the 2 next lines ignore-builtin-innodb plugin-load=innodb=ha_innodb_plugin.so # Added from wiki.fourkitchens.com # https://wiki.fourkitchens.com/display/PF/MySQL+configuration+and+tuning query_cache_size=128Mquery_cache_limit=1M # Limit the basic (limited) query cache from using up too many resources. innodb_buffer_pool_size=1024M # Most important performance setting. Should use the vast majority of memory on the system, but not so much that the OS starts swapping mysql out of memory to do other operations. default_storage_engine=innodb default_character_set=utf8 collation_server=utf8_general_ci character_set_server=utf8 max_allowed_packet=128M # If behind a firewall, can make this as large as possible. Small to prevent DOS by sending huge packets. sync_binlog=1 # Controls when the log is written to disk. Not safe if the raid doesn't have battery-backup. innodb_log_file_size=1G # Up to 4G, but start with 1G. To resize: # Cleanly shut-down mysql (flushes the bin-log to the data file) # Delete the ib_logfile files # Change the size in the my.cnf # Start the server again. innodb_flush_log_at_trx_commit=0 # Breaks ACID compliance, flushes on a time-based interval. May loose data if the server goes down between flu shes. Performance increase innodb_flush_method=O_DIRECT # Tells the FS cache not to flush in certain situations. Linux Only. innodb_file_per_table=1 # Allows "Optimize" to reclaim disk space. table_cache=150 # tune to be larger than your number of tables in the entire database. Look at logs to see how many times tables are opened. key_buffer_size=20M # Temporary tables on disk are MyISAM, this allows a key-buffer for them. sort_buffer_size=2M read_buffer_size=200K # Most important. At 256k, MySQL will switch to from malloc to mmmap, which requires context switch and additional memory requests.r join_buffer_size=1M # If you have aquery that will max this out, there are other problems. bulk_insert_buffer_size=8M max_connections=100 # Should be slightly greater than Apache's max clients # To enable InnoDB-related INFORMATION_SCHEMA tables # Join the following options to above directive ;innodb_trx=ha_innodb_plugin.so ;innodb_locks=ha_innodb_plugin.so ;innodb_cmp=ha_innodb_plugin.so ;innodb_cmp_reset=ha_innodb_plugin.so ;innodb_cmpmem=ha_innodb_plugin.so ;innodb_cmpmem_reset=ha_innodb_plugin.so [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid