作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2025, Vol. 51 ›› Issue (12): 337-345. doi: 10.19678/j.issn.1000-3428.0069437

• 开发研究与工程应用 • 上一篇    下一篇

基于Kubernetes的异构任务调度方法

朱亚州1, 杜平川1, 柴志雷1,2,*()   

  1. 1. 江南大学人工智能与计算机学院, 江苏 无锡 214122
    2. 江苏省模式识别与计算机智能工程实验室, 江苏 无锡 214122
  • 收稿日期:2024-02-28 修回日期:2024-05-05 出版日期:2025-12-15 发布日期:2024-09-11
  • 通讯作者: 柴志雷
  • 基金资助:
    国家自然科学基金(61972180); 江苏省模式识别与计算智能工程实验室项目

Heterogeneous Task Scheduling Method Based on Kubernetes

ZHU Yazhou1, DU Pingchuan1, CHAI Zhilei1,2,*()   

  1. 1. School of Artificial Intelligence and Computer Science, Jiangnan University, Wuxi 214122, Jiangsu, China
    2. Jiangsu Provincial Engineering Laboratory of Pattern Recognition and Computational Intelligence, Wuxi 214122, Jiangsu, China
  • Received:2024-02-28 Revised:2024-05-05 Online:2025-12-15 Published:2024-09-11
  • Contact: CHAI Zhilei

摘要:

Kubernetes作为容器编排的主流工具, 可支持自动部署、服务发现以及负载均衡, 且具有高可用性、高效能的特点。然而, Kubernetes采用的最佳适应算法或最小负载法等调度策略忽略了节点的异构性和性能的差异性。此外, Kubernetes工具仅考虑CPU资源和内存资源且预先设置统一权重机制, 容易导致负载不均衡、性能下降以及无法满足精细化调度等问题。针对这些问题, 提出了一种基于多维度资源的异构任务调度(A-KCSS)算法, 该算法基于集群的异构计算资源, 增加磁盘输入/输出(I/O)、网络I/O负载以及GPU资源作为评价指标进行过滤和筛选, 更全面地考虑了node的异构性。此外, 引入一种基于多维度资源因素的权重计算模型, 依据待调度任务的资源需求, 计算待调度任务各维度资源因素的权重值, 结合集群node的实时资源利用率计算出每一个node的评分, 依据评分进行优先级排序, 并选择优先级最高的node进行调度。通过实验在Kubernetes集群上测试了A-KCSS算法的性能, 该算法与Kubernetes默认的调度算法以及Kubernetes容器调度(KCSS)算法相比, 平均响应时间分别减少10%和4%, 吞吐量分别提高30%和15%, 可用性分别提高40%和30%, 负载均衡性分别提高23%和18%, 集群的整体性能得到提高。

关键词: 异构任务, 任务调度, Kubernetes, 负载均衡, 多维度资源, 逼近理想解法

Abstract:

As a mainstream tool for container orchestration, Kubernetes can support automatic deployment, service discovery, and load balancing. It is known for its high availability and performance. However, scheduling strategies such as the best adaptation algorithm or the minimum negative cut method ignore the heterogeneity and energy differences of nodes. In addition, Kubernetes tools only consider CPU and memory resources and set a unified weight mechanism in advance, which can easily lead to problems such as load imbalance, performance degradation, and the inability to satisfy refined scheduling. To address these existing problems, this study proposes a heterogeneous task scheduling algorithm based on multi-dimensional resources, namely A-KCSS. The A-KCSS algorithm is based on the heterogeneous computing resources of a cluster. It adds disk Input/Output (I/O), network I/O load, and GPU resources as evaluation indicators for filtering and screening, and it more comprehensively considers the heterogeneity of nodes. This study also introduces a weight calculation model based on multi-dimensional resource factors. Based on the resource requirements of the task to be scheduled, the weight value of each dimension of the resource factor of the task to be scheduled is calculated, and the score of each node is calculated based on the real-time resource utilization of the cluster. Nodes are prioritized according to the score, and the node with the highest priority is selected for scheduling. The performance of the A-KCSS algorithm is experimentally verified on the Kubernetes cluster. Compared with the default scheduling algorithm and the KCSS algorithm, the average response time is reduced by 10% and 4%, the throughput is increased by 30% and 15%, the availability is improved by 40% and 30%, and the load balancing performance is increased by 23% and 18%, respectively, thereby improving the overall cluster performance.

Key words: heterogeneous tasks, task scheduling, Kubernetes, load balancing, multi-dimensional resources, approximation to the ideal solution