转载:innodb_log_file_size设多大…
2015-01-18 20:17
429 查看
转自: http://blog.163.com/hui_san/blog/static/5710286720117293230580/
INNODB_LOG_FILE 过于小,会直接触发CHECKPOINT,导致频繁IO请求; 多大是合适的?
========================================
: (none) 16:13:13> pager
grep sequence
PAGER set to 'grep
sequence'
: (none) 16:13:14>
: (none)
16:13:15> SHOW engine innodb
STATUS\G SELECT sleep(60); SHOW engine innodb
STATUS\G
Log sequence number 1450
485101299
1 row in set (0.09 sec)
1 row in set (1 min 0.01
sec)
Log sequence number 1450
505024667
1 row in set (0.00 sec)
: (none) 16:14:37>
nopager
PAGER set to stdout
: (none) 16:14:43> select
(505024667-485101299)/1024/1024;
+---------------------------------+
|
(505024667-485101299)/1024/1024 |
+---------------------------------+
|
19.00040436
|
+---------------------------------+
1 row in set (0.00 sec)
========================================
Notice the log sequence
number. That's the total number of bytes written to the transaction
log.
我们在高峰期间采样可以得到,1分钟产生19M的日志;
我觉得这个INNODB LOG大小设成 19M*60=1140M 已经足够了;
60分钟是一个经验值, 你也可以适当调大,比如
500M,3个文件 ;这相对来说是安全的;
当然你也可以用以下命令来查看日志产生的大小:
show status like
'Innodb_os_log_written'; select sleep(60); show status like
'Innodb_os_log_written';
INNODB_LOG_FILE 过于小,会直接触发CHECKPOINT,导致频繁IO请求; 多大是合适的?
========================================
: (none) 16:13:13> pager
grep sequence
PAGER set to 'grep
sequence'
: (none) 16:13:14>
: (none)
16:13:15> SHOW engine innodb
STATUS\G SELECT sleep(60); SHOW engine innodb
STATUS\G
Log sequence number 1450
485101299
1 row in set (0.09 sec)
1 row in set (1 min 0.01
sec)
Log sequence number 1450
505024667
1 row in set (0.00 sec)
: (none) 16:14:37>
nopager
PAGER set to stdout
: (none) 16:14:43> select
(505024667-485101299)/1024/1024;
+---------------------------------+
|
(505024667-485101299)/1024/1024 |
+---------------------------------+
|
19.00040436
|
+---------------------------------+
1 row in set (0.00 sec)
========================================
Notice the log sequence
number. That's the total number of bytes written to the transaction
log.
我们在高峰期间采样可以得到,1分钟产生19M的日志;
我觉得这个INNODB LOG大小设成 19M*60=1140M 已经足够了;
60分钟是一个经验值, 你也可以适当调大,比如
500M,3个文件 ;这相对来说是安全的;
当然你也可以用以下命令来查看日志产生的大小:
show status like
'Innodb_os_log_written'; select sleep(60); show status like
'Innodb_os_log_written';
相关文章推荐
- InnoDB: Error: log file /home/mysqldata/ib_logfile0 is of different size
- innodb_log_file_size
- How to calculate a good InnoDB log file size
- 如何计算合适的InnoDB log file size
- 合理设置 innodb_log_file_size 大小
- Choosing proper innodb_log_file_size
- 如何计算合适的InnoDB log file size
- 如何计算合适的InnoDB的(innodb_log_file_size)日志文件大小
- <innoDB 手记《二》> innodb_log_file_size
- innodb_log_file_size
- InnoDB log file 设置多大合适?
- 关于改变innodb_log_file_size后无法启动mysql的问题
- 关于改变innodb_log_file_size后无法启动mysql的问题
- 优化innodb_log_file_size参数
- 选择合适的innodb_log_file_size
- 改变innodb_log_file_size后无法启动mysql---unknow table engine InnoDB
- 修改innodb_log_file_size后无法启动mysql的问题
- [Mysql数据库] innodb_log_file_size设置
- linux mysql修改my.cnf的innodb_log_file_size ,提示:Unknown/unsupported storage engine: InnoDB
- 修改MYSQL的innodb_log_file_size导致的MYSQL崩溃