In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about how to set the size of redo log in MySQL. Many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.
1. View the current redo log size
Mysql > show variables like 'innodb_log%' +-- +-+ | Variable_name | Value | +-+-+ | innodb_log_buffer_size | 16777216 | | innodb_log_checksums | ON | | innodb_log_compressed_pages | ON | | innodb_log_file_size | 50331648 | | innodb_log_files_in_group | 2 | innodb_log_group_home_dir |. / | | innodb_log_write_ahead_size | 8192 | +-+-+ |
The current size is 50331648, 1024/1024=48MB
2. Calculate the amount of redo log per minute
Mysql > pager grep-I "Log sequence number"; PAGER set to'grep-I "Log sequence number" 'mysql > show engine innodb status\ G select sleep (60); show engine innodb status\ GLog sequence number 49516471 row in set (0.01 sec) 1 row in set (1 min 0.00 sec) Log sequence number 50461501 row in set (0.00 sec)
During this 60s, our business system is in a normal running state. This time, for the experimental environment, I have done a simple business simulation operation.
Lsn increased from 4951647 to 5046150
Quantity of redo log per minute: round ((5046150-4951647) / 1024) = 92KB
Quantity of redo log per hour: 92K x 60=5520KB
Normally, the database switches redo log every 10 minutes, so for this database, a single redo log size 5520KB / 6=920KB
Because this database is a test platform and the volume of business is small, normally the single redo log size of the production database is between 200M-2G.
3. Edit the my.cnf file and restart the database to take effect
Innodb_log_file_size=200M after reading the above, do you have any further understanding of how to set the size of redo log in MySQL? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.