Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the performance test of innodb_flush_log_at_trx_commit parameters?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

It is believed that many inexperienced people have no idea about what the innodb_flush_log_at_trx_commit parameter performance testing is like. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Mysql > create table test_load (an int,b char (80)) engine=innodb

Query OK, 0 rows affected (0.19 sec)

Mysql > delimiter / /

Mysql > create procedure p_load (count int unsigned)

-> begin

-> declare s int unsigned default 1

-> declare c char (80) default repeat ('astatine 80)

-> while s insert into test_load select null,c

-> commit

-> set s = s + 1

-> end while

-> end

-> / /

Mysql > delimiter

Mysql > call p_load (50000)

Query OK, 0 rows affected (3.02 sec)

Mysql > show variables like'% flush_log%'

+-+ +

| | Variable_name | Value |

+-+ +

| | innodb_flush_log_at_timeout | 1 | |

| | innodb_flush_log_at_trx_commit | 0 | |

+-+ +

Mysql > call p_load (500000)

Query OK, 0 rows affected, 3 warnings (28.43 sec)

Mysql > select * from test_load limit 5

+-+

| | a | b | |

+-+

| | NULL | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |

| | NULL | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |

| | NULL | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |

| | NULL | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |

| | NULL | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |

+-+

5 rows in set (0.12 sec)

Mysql > set global innodb_flush_log_at_trx_commit=1

Query OK, 0 rows affected (0.00 sec)

Mysql > call p_load (500000)

Query OK, 0 rows affected (27.54 sec)

Mysql > show variables like'% flush_log%'

+-+ +

| | Variable_name | Value |

+-+ +

| | innodb_flush_log_at_timeout | 1 | |

| | innodb_flush_log_at_trx_commit | 1 | |

+-+ +

2 rows in set (0.09 sec)

Mysql > truncate table test_load

Query OK, 0 rows affected (0.23 sec)

Mysql > call p_load (500000)

Query OK, 0 rows affected (24.63 sec)

Mysql > set global innodb_flush_log_at_trx_commit=2

Query OK, 0 rows affected (0.30 sec)

Mysql > truncate table test_load

Query OK, 0 rows affected (1.06 sec)

Mysql > call p_load (500000)

Query OK, 0 rows affected (27.69 sec)

After reading the above, have you mastered the method of innodb_flush_log_at_trx_commit parameter performance testing? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report