我发现基于主从概念的MySQL复制的可能性。
但是我没有找到有关线程如何真正工作的任何详细信息
(即使在此网站上:http://dev.mysql.com/doc/refman/5.0/en/replication-implementation-details.html)
我知道有3个线程:
我也知道他们正在遵循这个过程:
没关系,但是在之后I/O线程的行为如何?
它仍然连接在Master上(),但是如果在Master数据库上执行了新的写入请求,会发生什么情况?真正的过程是什么?
我发现了不同的可能性,但我不确定它们是否是好的选择:
Slaves that are up to date will mostly be reading events that are still cached in OS cache on the master, so there is not going to be any physical disk reads on the master in order to feed binary log events to slave(s)
因此,I/O线程始终在高速缓存中寻找新请求吗? ...
When a new request is written into the binary log file, the Master thread sends it to every I/O threads that are connected.
如果在主数据库中同时有少量写入请求,此解决方案是否会导致有关过载的问题?
这是我关于StackOverflow的第一篇文章,希望我的问题是可以理解的。
先感谢您 ! :)
最佳答案
我认为您需要mysql源代码才能真正了解该过程是如何工作的。
据我所知,奴隶等待主人发送事件。
关于过载,我无法给您100%的答复。但是我从来没有遇到过用插入,更新和删除分配复制数据库的任何问题。
关于mysql - MySQL复制实际上如何工作? (关于线程),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16839506/