The present invention discloses a low delay distributed computing consensus algorithm, which mainly solves the problem of increasing the response delay of the system when the command conflict rate increases between the concurrent clients. The algorithm combines the EPaxos algorithm with the Multi Paxos algorithm which is not affected by the conflict of concurrent client commands. According to the client load situation, the conflict situation of concurrent client commands and the real time situation of the network, the average delay of the EPaxos algorithm and the Multi Paxos algorithm system is carried out every other time. According to the calculation results, the algorithm is intelligently converted to the algorithm mode with smaller average delay. The algorithm has better adaptability, better delay performance and higher comprehensive efficiency. It can achieve a lower system response delay than the EPaxos algorithm in the case of large command conflict between concurrent clients. When the client load is not balanced, it can be more adaptable to a variety of customers than the Multi Paxos algorithm. Household environment. One
【技术实现步骤摘要】
一种低延迟的分布式计算共识算法
本专利技术属于分布式计算领域,涉及非拜占庭故障的异步分布式系统环境下解决共识问题的算法。具体地说是一种低延迟的分布式计算共识算法,可用于分布式存储系统,分布式应用程序协调服务等领域。
技术介绍
分布式计算是一个古老而宽泛的话题,而近几年因为“大数据”概念的兴起,又焕发出了新的青春与活力。共识问题是分布式计算中最重要的问题之一,是许多商业分布式系统的核心,它刻画了不同处理器之间的协调问题,即如何从互相冲突的输入值产生一致的输出值。现如今的许多基于分布式系统的软件,如Hadoop,HBase,Spanner,Dynamo等,都需要解决共识问题。在非拜占庭故障的异步分布式系统环境下解决共识问题,更加接近共识问题的现实环境,提出的解决方法也更具有普适性。对非拜占庭故障的异步分布式系统环境下的共识问题进行研究,对于分布式计算、大数据的研究,有着重要的推动意义。FLP不可能定理指出:在存在故障(即使只有一个进程故障)的异步系统中,不存在用于解决共识问题的确定性算法。这说明,解决共识问题的算法必须在安全性(safety)和灵活性(liveness)之间取舍。LeslieLamport提出的Multi-Paxos算法是确保安全性的共识算法中的经典。为了防止在并发情况下陷入活锁,Multi-Paxos算法需要选举一个领导者和并发客户端进行交流,接受并发客户端传递的命令。但是领导者的设置使得在广域网环境下的分布式系统中,客户端和分布式系统交互需要更大的延迟(和领导者不在同一局域网的客户端需要花费更多的时间和领导者进行通信)。当领导者所在局域网的 ...
【技术保护点】
1.一种低延迟的分布式计算共识算法,包括:
【技术特征摘要】
1.一种低延迟的分布式计算共识算法,包括:(1)执行EPaxos算法模式;(2)根据算法运行过程中客户端的负载情况、并发客户端的命令冲突情况以及网络的实时情况,每隔时间段ts(ts可取15秒)计算EPaxos算法模式下系统的平均延迟Lat1(EPaxos)以及估计Multi-Paxos算法模式下系统的平均延迟Lat1(Multi-Paxos):(2.1)计算Lat1(EPaxos):统计副本Ri(Ri表示第i个副本,其中i∈[1,N],N表示副本总数)处理的客户端提交的命令总数Ti,执行slow-path的命令数Ci,从客户端到副本Ri所需的时间tci,从副本Ri到所有副本所花时间中第k少的时间min_k{i}(k表示fastpath中的法定人数),从副本Ri到所有副本所花时间中第p少的时间min_p{i}(p表示slowpath中的法定人数,也为Multi-Paxos算法模式下的法定人数),则EPaxos算法模式下系统的平均延迟为:(2.2)估计Lat1(Multi-Paxos):分别估计各个副本Rr(r∈[1,N])为领导者时,Multi-Paxos算法模式下系统的平均延迟(tir表示从副本Ri到副本Rr所需的时间):取最小的Lat1(Multi-Paxos)r作为Multi-Paxos算法模式下系统的平均延迟Lat1(Multi-Paxos),令领导者Rl为此时的Rr;(3)比较Lat1(EPaxos)和Lat1(Multi-Paxos)的大小,若Lat1(Multi-Paxos)<Lat1(EPaxos),从EPaxos算法模式转换至Multi-Paxos算法模式,转至步骤(4),否则,转至步骤(1);(4)执行Multi-Paxos算法模式(在Multi-Paxos算法模式下客户端将命令提交给最近的副本,副本再将命令传递给领导者);(5)根据算法运行过程中客户端的负载情况、并发客户端的命令冲突情况以及网络的实时情况,每隔时间段ts(ts可取15秒)计算Multi-Paxos算法模式下系统的平均延迟Lat2(Multi-Paxos)以及估计EPaxos算法模式下系统的平均延迟Lat2(EPaxos):(5.1)计算Lat2(Multi-Paxos):统计副本Ri(i∈[1,N])传递的客户端提交的命令总数Ti,从客户端到副本Ri所需的时间tci,从副本Ri到领导者Rl所需的时间til,从领导者Rl到所有副本所花时间中第p少的时间min_p{l},则Multi-Paxos算法模式下系统的平均延迟为:(5.2)估计Lat2(EPaxos):统计从副本Ri(i∈[1,N])到所有副本所花时间中第k少的时间min_k{i},到所有副本所花时间中第p少的时间min_p{i},传递的命令中对各个关键字Km(m∈[1,M],M表示关键字总数)操作的命令数CKim,则在EPaxos算法模式下,含有最大CKim的副本Ri传递的关于关键字Km的命令中执行slowpath的命令数Sim可近似为min{CKim,∑r∈[1,N]...
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。