An advanced my.cnf example. Suppose that you have a Linux computer with 2GB RAM and  three 60GB hard disks at directory paths /, /dr2 and /dr3. The following  example shows possible configuration parameters in my.cnf for InnoDB.

# You can write your other MySQL server options here
# ...
innodb_data_home_dir =
# Data files must be able to hold your data and indexes
innodb_data_file_path = /ibdata/ibdata1:2000M;/dr2/ibdata/ibdata2:2000M:autoextend
# Set buffer pool size to 50-80% of your computer's memory,
# but make sure on Linux x86 total memory usage is < 2GB
innodb_log_group_home_dir = /dr3/iblogs
innodb_log_files_in_group = 2
# Set the log file size to about 25% of the buffer pool size
# Uncomment the next lines if you want to use them

In some cases, database performance improves the if all data is not placed on  the same physical disk. Putting log files on a different disk from data is very  often beneficial for performance. The example illustrates how to do this. It  places the two data files on different disks and places the log files on the  third disk. InnoDB fills the tablespace beginning  with the first data file. You can also use raw disk partitions (raw devices) as  InnoDB data files, which may speed up I/O.


創作者 shadow 的頭像


shadow 發表在 痞客邦 留言(0) 人氣()