arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2608.00454cs.DC

Kubernetes控制器的缓存一致性动态负载均衡

Cache-Consistent Dynamic Load Balancing for Kubernetes Controllers

Shoma Ansai, Yasuo Okabe, Daisuke Kotani

AI总结:

针对Kubernetes控制器水平扩展的负载分配问题,提出结合两级哈希与一致性哈希的缓存同步负载均衡方法,实现吞吐量随实例提升且重分配时间可控。

AI中文摘要:

随着Kubernetes集群规模扩大,控制器的可扩展性可能成为系统性能的瓶颈。然而,在多个控制器实例间动态分配负载会引发两个问题,因此目前控制器只能以单实例运行。第一个问题是重新分配的成本:控制器基于对象附加的标签检索对象,若采用将分配实例记录在每个对象标签上的朴素设计,每当实例增减时,需按对象总数比例重写标签。第二个问题是缓存一致性:控制器读取对象时仅查询自身缓存,从不访问实际数据,因此重新分配时必须显式更新缓存;此外,控制器会为每种对象独立管理缓存,需跨对象种类同步缓存更新。我们提出一种结合轻量负载均衡与缓存同步的Kubernetes控制器水平扩展方法:两级哈希将对象映射到虚拟节点,在标签中记录其标识符,并通过一致性哈希将虚拟节点分配给实例,因此实例增减时只需更新对象检索时指定的标签值,无需重写对象上的标签;重新分配完成前会锁定缓存,防止引用过时缓存,同时使用数据存储的版本标识符同步各对象种类。我们在Kubernetes上实现该方法并评估:处理吞吐量随实例数量增加而提升,重新分配所需时间保持在可接受范围内。

英文摘要:

As Kubernetes clusters grow, the scalability of controllers can become a bottleneck for the performance of the system. Distributing the load dynamically across multiple controller instances, however, raises the following two problems, and a controller can therefore be run only as a single instance today. The first problem is the cost of reassignment. A controller retrieves objects on the basis of the Labels attached to them, so in a naive design in which the assigned instance is recorded in a Label on every object, the Labels must be rewritten in proportion to the total number of objects whenever instances are added or removed. The second problem is cache consistency. A controller consults only its own cache when it reads an object and never refers to the actual data, so the cache has to be updated explicitly at the time of a reassignment. Furthermore, a controller manages a cache independently for each kind of object, so cache updates have to be synchronized across the kinds of objects. We propose a method for scaling Kubernetes controllers horizontally that combines lightweight load balancing with cache synchronization. A two-level Hash maps objects to Virtual Nodes, records their identifiers in Labels, and assigns Virtual Nodes to instances by Consistent Hashing. Whenever instances are added or removed, it therefore suffices to update the Label value specified when objects are retrieved, and no Label on an object has to be rewritten. The cache is also locked until the reassignment has completed, which prevents any reference to a stale cache. The version identifier of the data store is used to synchronize the kinds of objects with one another. We implemented the proposed method on Kubernetes and evaluated it: the processing throughput rises with the number of instances, and the time required for reassignment remains within an acceptable range.

↑