首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

Innodb配备,将数据与日志放在不同磁盘可以加快性能

2012-12-26 
Innodb配置,将数据与日志放在不同磁盘可以加快性能An advanced my.cnf example. Suppose that you have a

Innodb配置,将数据与日志放在不同磁盘可以加快性能

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.

[mysqld]# You can write your other MySQL server options here# ...innodb_data_home_dir =## Data files must be able to hold your data and indexesinnodb_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 < 2GBinnodb_buffer_pool_size=1Ginnodb_additional_mem_pool_size=20Minnodb_log_group_home_dir = /dr3/iblogs#innodb_log_files_in_group = 2## Set the log file size to about 25% of the buffer pool sizeinnodb_log_file_size=250Minnodb_log_buffer_size=8M#innodb_flush_log_at_trx_commit=1innodb_lock_wait_timeout=50## Uncomment the next lines if you want to use them#innodb_thread_concurrency=5

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.

热点排行