| For technology-based enterprises,it is important to reduce costs and increase efficiency by improving the utilization of data center server resources.With the advent of micro services and the promotion of containerization technology,Google start to implement the container orchestration engine Kubernetes in 2014.Now Kubernetes has been widely used by enterprises in the field of cloud computing.However,Kubernetes has the following problems: First,when scheduling resources,Kubernetes does not take the actual resource usage of containers and the differences in resource requirements of containers corresponding to different services into account,so it leads to a large number of resource fragments and serious unbalanced resource allocation;Second,for stateful services,the actual usage of container resources is often much lower than the original application,hence it leaves a large number of reservation resources in idle.In conclusion,the resource utilization of existing server clusters is not high and needs to be improved.This paper focuses on how to improve the resource utilization of cloud server cluster based on Kubernetes,and makes the following key innovative adjustments:(1)To solve the problem of resource fragmentation and unbalanced resource allocation caused by the unreasonable resource scheduling strategy,a Bucket-based scoring algorithm and a Least scoring algorithm are proposed respectively.Specifically,by taking the balance of node remaining resources into the measurement range in the scoring stage of resource scheduling,the distribution of server remaining resources after scheduling is more reasonable;by taking the actual resource usage of the container into the measurement category in the scoring stage of resource scheduling,the resource allocation is more reasonable and balanced.Further,when the two algorithms are fused,a resource scheduling scheme based on B-L(Bucket-Least)algorithm is proposed,and a B-L scheduler is developed by using the Scheduling Framework.The measured results in Kubernetes cluster show that the B-L scheduler can reduce the resource fragments by 4%,and the cluster server resource utilization is more balanced.(2)To avoid resource idle caused by the mismatch between resource application and actual usage,an RO(resource oversell)algorithm is applied.To be specific,when the server resources are oversold according to the current resource utilization rate of the server,meaning the resource utilization rate is lower than the preset threshold,we designed the RO curve mapping function to help the resources expand and be sold,then the server resources can achieve a virtual increase logically,It further reduces the deviation between the actual resource usage of the server and the available resources,hence the idle resources can be used effectively.We further developed the resource dynamic oversold component kwai-resource-controller by using admission webhook,and deployed to the actual kubernetes cluster.The test results show that kwai-resourcecontroller can reduce the idle CPU of servers in the cluster by nearly 10% and the idle memory by nearly 20%.With the use of B-L algorithm-based resource scheduling scheme and the RO algorithm-based resource oversold scheme,a method to improve the resource utilization of large-scale server cluster is developed.This method has been deployed and applied to multiple Kubernetes online clusters in a large technology-based company,two patent applications have been filed.The actual operation results show that the server CPU utilization in the cluster has increased by more than 20% and the memory utilization has increased by more than 30%.It provides important technical support for the company’s server cluster resource utilization and user computing service efficiency. |