当前位置:网站首页>How to reduce the shutdown time of InnoDB database?
How to reduce the shutdown time of InnoDB database?
2022-07-06 12:48:00 【wx5caecf2ed0645】
We are using innodb When it comes to databases , You will find such a phenomenon , When we need to shut down or restart mysql In service , It will take quite a long time , If the database process shuts down abnormally , Opening the database will take a long time to recover .
At first, I thought the database was too large , Later I saw an article about “innodb_max_dirty_pages_pct Relationship with checkpoints ” , To understand the truth . The usual reason is from buffer pool Dirty page data exchange ,mysql Will inform OS, Exchange some dirty pages , The exchange is to modify in memory , Not on the hard disk .
If you need to shut down quickly innodb database , Then there is a way , as follows :
1, Set global variables , Set up innodb_max_dirty_pages_pct The value of the parameter .
mysql> set global innodb_max_dirty_pages_pct = 0;
2, Execute the following command , View the modified data page .
/usr/local/mysql/bin/mysqladmin -uroot -p ext -i10 | grep dirty
Enter password:
| Innodb_buffer_pool_pages_dirty | 4530 |
| Innodb_buffer_pool_pages_dirty | 4576 |
| Innodb_buffer_pool_pages_dirty | 4475 |
| Innodb_buffer_pool_pages_dirty | 4496 |
| Innodb_buffer_pool_pages_dirty | 4411 |
When this parameter becomes 0, Or close to 0( If your server is using , It won't become 0 Of ).
here , When this value is quite low , You can restart your database service , This is the time , You will find that the speed is quite fast .
Be careful :
This is the sum of innodb buffer It has a lot to do with it , It is generally not recommended to change this value , Unless it's yours innodb buffer It's big . I have 3 Database servers , One set 3G Of innodb buffer Dirty page data in 1000 about , The other is 1G Of innodb buffer Dirty page in 4000 about ,, It seems that innodb buffer The bigger the better !
Maybe you will say you can pass innodb_fast_shutdown This option adjusts the closing speed , The system defaults to 1, But if you change the value of this item to 0 perhaps 2,, In this way mysql It's dangerous .
The official description is as follows :
The InnoDB shutdown mode. By default, the value is 1, which causes a “fast” shutdown (the normal type of shutdown).
If the value is 0, InnoDB does a full purge and an insert buffer merge before a shutdown. These operations can take minutes, or even hours in extreme cases.
If the value is 1, InnoDB skips these operations at shutdown.
If the value is 2, InnoDB will just flush its logs and then shut down cold, as if MySQL had crashed; no committed transaction will be lost, but crash recovery will be done at the next startup. A value of 2 cannot be used on NetWare.
边栏推荐
- FairyGUI循環列錶
- Mixed use of fairygui button dynamics
- FairyGUI人物状态弹窗
- 2021.11.10 compilation examination
- Prove the time complexity of heap sorting
- 记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
- (core focus of software engineering review) Chapter V detailed design exercises
- [Offer29] 排序的循环链表
- Containers and Devops: container based Devops delivery pipeline
- Fairygui gain buff value change display
猜你喜欢

Mysql database index
![Intermediate use tutorial of postman [environment variables, test scripts, assertions, interface documents, etc.]](/img/b0/176bf6dea2201afc892d6750c5974b.png)
Intermediate use tutorial of postman [environment variables, test scripts, assertions, interface documents, etc.]

In 2020, the average salary of IT industry exceeded 170000, ranking first

Classification, understanding and application of common methods of JS array

Mysql database reports an error: row size too large (> 8126) Changing some columns to TEXT or BLOB or using ROW_ FORMAT=DY

Design and implementation of general interface open platform - (39) simple and crude implementation of API services

FairyGUI人物状态弹窗

FairyGUI按钮动效的混用

Unity3D基础入门之粒子系统(属性介绍+火焰粒子系统案例制作)

地球围绕太阳转
随机推荐
Theoretical derivation of support vector machine
Derivation of logistic regression theory
[Clickhouse kernel principle graphic explanation] about the collaborative work of partitioning, indexing, marking and compressed data
Fairygui gain buff value change display
FairyGUI摇杆
[899]有序队列
[Leetcode15]三数之和
JS Title: input array, exchange the largest with the first element, exchange the smallest with the last element, and output array.
Fairygui joystick
Get the position of the nth occurrence of the string
Vulnhub target: hacknos_ PLAYER V1.1
GPS高程拟合抗差中误差的求取代码实现
SVN更新后不出现红色感叹号
InnoDB dirty page refresh mechanism checkpoint in MySQL
Idea problem record
(四)R语言的数据可视化——矩阵图、柱状图、饼图、散点图与线性回归、带状图
ORA-02030: can only select from fixed tables/views
Office提示您的许可证不是正版弹框解决
[leetcode19]删除链表中倒数第n个结点
Unity3D,阿里云服务器,平台配置