简体   繁体   English

Galera 集群高 Ping

[英]Galera Cluster High Ping

I have 3 gameservers connected at the same database.我在同一个数据库中连接了 3 个游戏服务器。 I started using galera cluster to sync, because mysql remote connection gets a delay because of hosts distance, BR, US and FR, and my gameserver use only one main thread for important queries.我开始使用 galera 集群进行同步,因为 mysql 远程连接由于主机距离、BR、US 和 FR 的原因而延迟,并且我的游戏服务器仅使用一个主线程进行重要查询。

This delay (lag) happen because principal thread need receive callback (confirmation) before continue running the aplication.发生这种延迟(滞后)是因为主线程在继续运行应用程序之前需要接收回调(确认)。

I thought thatwithn galera cluster, using local database with ping 0 the problem doesnt will happen anymore, but I don't know why, everytime that I get INSERTS and DELET on database the same lag happens.我认为在 galera 集群中,使用 ping 0 的本地数据库不会再发生问题,但我不知道为什么,每次我在数据库上获得 INSERTS 和 DELET 时都会发生相同的延迟。 On my application debug, I see that queries are sent local with 0 MS but it still lagging.在我的应用程序调试中,我看到查询以 0 MS 发送到本地,但仍然滞后。

My question is, does galera mysql-wsrep needs confirmation of other clusters?我的问题是,galera mysql-wsrep 是否需要确认其他集群?

Galera checks with all the other nodes during the COMMIT command. Galera 在COMMIT命令期间检查所有其他节点。 This is when the lag occurs.这是发生滞后的时候。 Of course, COMMIT is explicitly or implicitly (autocommit) part of any transaction, so every transaction has that lag.当然, COMMIT是任何事务的显式或隐式(自动提交)的一部分,因此每个事务都有延迟。

This implies that the optimal use of a geographically-dispersed Galera Cluster is to put many actions in a single transaction.这意味着地理上分散的 Galera 集群的最佳使用是将许多操作放在单个事务中。 (On the other hand, too many things in a single transaction can lead to undoing too much if there is any failure/deadlock/etc.) (另一方面,如果有任何失败/死锁/等,单个事务中的太多事情可能会导致撤消太多。)

The lag between US and Europe is on the order of 100ms;美国和欧洲之间的延迟在100ms左右; is that what you are seeing?这就是你所看到的吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM