Prioritizing Microservice Requests via Retries

Other AI Other AI Fields
2026年10月14日
云服务正迅速转向由各微服务独立管理的架构。这种独立性可能导致微服务在短期内协调失当,进而引发系统过载及对高价值事务的拒绝响应。这一缺陷还可能被攻击者利用,发起过载攻击,从而造成性能下降与成本增加等损害。 重试机制是应对偶发性拒绝响应的关键手段。然而,在系统过载期间,现有重试机制却存在两大问题:(a)无法有效保护高价值事务免遭拒绝;(b)反而会触发大规模、严重拖累系统性能的“重试风暴”。 为此,我们提出对重试机制进行若干简单修改,将其从单纯的容错手段转化为一种拒绝响应的优先级调度机制——即“差分重试”(DiffTry, Differential Retries)。该机制基于一种简洁、轻量、分布式且无状态的设计,既无需感知系统是否过载,也无需微服务之间进行任何协调。 我们首先构建了一个解析模型,精确刻画两个串行服务在采用 DiffTry 后的处理效能;继而将该模型推广至任意规模的服务网络。这一理论框架使实践者能够针对给定的服务网络,定量评估 DiffTry 所实现的事务优先级调度效果与各类事务的拒绝率,并从形式化层面严格证明:DiffTry 能显著缓解由偶然因素引发的过载,以及由攻击者精心编排的恶意过载所造成的负面影响。我们通过仿真实验及在真实 Kubernetes 集群上的部署验证了上述理论预测:DiffTry 仅需作为一款即插即用的服务网格插件即可启用,无需修改任何应用代码;实测所得的拒绝率与理论分析结果高度吻合。
Cloud services rapidly shift towards independently-managed microservices architectures. This independence may lead to temporary microservices miscoordination, resulting in overloads and rejections of valuable transactions. This weakness may further be exploited by attackers to launch overload attacks inflicting performance and cost damages. Retry operations are a key machinery aiming at overcoming seldom rejections. However, during overload periods they: a) Fail protecting valuable transactions from rejections, and b) Trigger large-scale performance-degrading retry storms. We propose simple modifications in retry operations, overcoming these deficiencies by transforming retries into a rejection prioritization mechanism, DiffTry (Differential Retries). It is based on a simple, lightweight, distributed and stateless design and requires neither overload sensing nor microservices coordination. We develop an analytical model capturing DiffTry's effectiveness for two services in tandem, then generalize it to networks of services. Our theoretical framework lets practitioners quantify, for a given network, the resulting prioritization and rejection rates, and yields formal guarantees that DiffTry substantially reduces the impact of both incidental and adversarial orchestrated overloads. We validate these predictions in simulation and on a live Kubernetes deployment, where DiffTry is a simple drop-in service-mesh plugin requiring no application changes; the measured rejection closely matches the analysis.
许愿