Hi there,
I have these Innodb settings:
Innodb
innodb_file_per_table
innodb_data_home_dir = /data/mysql
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /data/mysql
#innodb_buffer_pool_size = 1024M
innodb_buffer_pool_size = 2560M
innodb_additional_mem_pool_size = 16M
innodb_log_buffer_size = 8M
innodb_log_file_size = 64M
innodb_log_files_in_group = 2
#innodb_flush_log_at_trx_commit = 0
innodb_flush_log_at_trx_commit = 2
sync_binlog=1
innodb_lock_wait_timeout = 50
transaction_isolation=read-committed
innodb_thread_concurrency=6
innodb_table_locks=0
innodb_status_file=1
This is the version:
mysql> select version();
±-------------------+
| version() |
±-------------------+
| 5.0.17-pro-gpl-log |
±-------------------+
1 row in set (0.00 sec)
This is the memory:
[linux@db117 ~]$ free -m
total used free shared buffers cached
Mem: 7972 7951 21 0 52 4724
-/+ buffers/cache: 3174 4798
Swap: 2047 11 2035
These is the CPU info:
[linux@db117 ~]$ cat /proc/cpuinfo | egrep “processor|vendor_id|model name|cpu MHz|cpu cores”
processor : 0
vendor_id : GenuineIntel
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
cpu MHz : 2992.540
cpu cores : 2
processor : 1
vendor_id : GenuineIntel
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
cpu MHz : 2992.540
cpu cores : 2
processor : 2
vendor_id : GenuineIntel
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
cpu MHz : 2992.540
cpu cores : 2
processor : 3
vendor_id : GenuineIntel
model name : Intel(R) Xeon(R) CPU 5160 @ 3.00GHz
cpu MHz : 2992.540
cpu cores : 2
The plot:
By default, MySQL was running with innodb_flush_log_at_trx_commit = 1 which led to performance problems for even simple DML statements(i.e. delete from table where id = …, id being a primary or having an index)
I set innodb_flush_log_at_trx_commit = 0, which really helped , being able to sustain the load, but now mysql is prone to lose data in case it crashes (and I’ve been told it’s not acceptable that we could lose transactions). The so called happy compromise it the I’ve set it to innodb_flush_log_at_trx_commit = 2, which in theory, mysql should be able not to lose any transactions as long as a transaction made it to log_file. If it crashes, MySQL will roll-back or commit whatever it finds in the log_file.
The questions:
-
How reliable is this process? Should I risk and go with innodb_flush_log_at_trx_commit = 2 and count on the fact MySQL/innodb will be reliable enough to commit those changes found in the log_file or just use the …trx_commit=1 and pray I will not face bigger loads?
-
In case I have to go with innodb_flush_log_at_trx_commit = 1, what workarounds do I have to further optimize Innodb and make it speedier? Increasing the allocated memory for the innodb_buffer_pool_size is not an option. The developers are using some g.d. triggers that have the habit of leaking memory and this eventually leads to a MySQL instance crash. The current value of 2560M seems to lead to a fairly stable instance. Taking out the triggers is also not option (a coliding course with developers’ ego/insufficient human resources(?!)).
Waiting for suggestions,
Thanks