Comments (4)
当内存不够用了,要将脏页写到磁盘,会有一个数据页淘汰机制(最久不使用),假设淘汰的是脏页,则此时脏页所对应的redo log的位置是随机的,当有多个不同的脏页需要刷,则对应的redo log可能在不同的位置,这样就需要把redo log的多个不同位置刷掉,这样对于redo log的处理不是就会很麻烦吗?
其实由于淘汰的时候,刷脏页过程不用动redo log文件的。这个有个额外的保证,是redo log在“重放”的时候,如果一个数据页已经是刷过的,会识别出来并跳过。
from git-zjx.github.io.
redo log是怎么记录对应脏页是否已经flush了?如果断电了重启导致内存丢失,前面几章说通过redo log进行数据恢复那redo log又怎么去释放空间?
不用记,重启了就从checkpoint 的位置往后扫。 如果已经之前刷过盘的, 不会重复应用redo log
from git-zjx.github.io.
innodb是如何知道一个页是不是脏页的?
每个数据页头部有LSN,8字节,每次修改都会变大。对比这个LSN跟checkpoint 的LSN,比checkpoint小的一定是干净页
from git-zjx.github.io.
一个内存配置为 128GB、innodb_io_capacity 设置为 20000 的大规格实例,正常会建议你将 redo log 设置成 4 个 1GB 的文件。但如果你在配置的时候不慎将 redo log 设置成了 1 个 100M 的文件,会发生什么情况呢?又为什么会出现这样的情况呢?
每次事务提交都要写 redo log,如果设置太小,很快就会被写满,这个“环”将很快被写满,write pos 一直追着 CP,这时候系统不得不停止所有更新,去推进 checkpoint,看到的现象就是磁盘压力很小,但是数据库出现间歇性的性能下跌
from git-zjx.github.io.
Related Issues (20)
- 搭建Git服务器
- 36 | 为什么临时表可以重名? HOT 2
- 37 | 什么时候会使用内部临时表?
- 38 | 都说InnoDB好,那还要不要使用Memory引擎?
- 39 | 自增主键为什么不是连续的? HOT 1
- 40 | insert语句的锁为什么这么多?
- 41 | 怎么最快地复制一张表?
- 42 | grant之后要跟着flush privileges吗?
- 43 | 要不要使用分区表?
- 44 | 答疑文章(三):说一说这些好问题
- 45 | 自增id用完怎么办?
- Homestead 在 Windows 下软链接报错的解决办法
- 安装 php_mongodb.dll 出现无法定位序数 4694 的问题
- Building Web Server with Go
- Practical Go: Real world advice for writing maintainable Go programs
- GO 值传递 HOT 1
- Go 下划线的不同用法
- 深度解密Go语言之context
- Go fmt.Print 格式化参数
- 感觉质量不错的一个文档合集
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-zjx.github.io.