[go: up one dir, main page]

CN104902001B - Web request load-balancing method based on operating system virtualization - Google Patents

Web request load-balancing method based on operating system virtualization Download PDF

Info

Publication number
CN104902001B
CN104902001B CN201510160526.0A CN201510160526A CN104902001B CN 104902001 B CN104902001 B CN 104902001B CN 201510160526 A CN201510160526 A CN 201510160526A CN 104902001 B CN104902001 B CN 104902001B
Authority
CN
China
Prior art keywords
server
service
cpu
mrow
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201510160526.0A
Other languages
Chinese (zh)
Other versions
CN104902001A (en
Inventor
黄彬彬
张雪鹏
俞东进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN201510160526.0A priority Critical patent/CN104902001B/en
Publication of CN104902001A publication Critical patent/CN104902001A/en
Application granted granted Critical
Publication of CN104902001B publication Critical patent/CN104902001B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multi Processors (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a kind of Web request load-balancing method based on operating system virtualization.The present invention carries out server resource information and normalization first;Secondly server and Service Instance Dynamic Information Gathering;Then the multidate information arrived according to server resource information and periodic harvest calculates the final weights of the Service Instance copy of all services;Distribute finally by WRR and ask.The present invention is it is possible to prevente effectively from different Service Instance copies on same server, the phenomenon of server overload where a large amount of Web requests cause is received simultaneously because place server load is relatively low, realize the load balancing between Service Instance copy and server, the concurrent capability of Web group systems is improved, reduces the average response time of request.

Description

基于操作系统虚拟化的Web请求负载均衡方法Web request load balancing method based on operating system virtualization

技术领域technical field

本发明属于Web集群负载均衡技术领域,具体涉及到一种基于操作系统虚拟化的Web请求负载均衡方法。The invention belongs to the technical field of Web cluster load balancing, and in particular relates to a method for balancing Web request loads based on operating system virtualization.

背景技术Background technique

随着社交网络、电子商务等互联网应用的迅猛发展,网络服务器面临着以下两方面的问题:(1)访问数量成指数倍增加;(2)事务处理更加复杂。为了应对以上问题,为用户提供一个高性能的网络服务环境,分布式的Web服务器系统(Web集群)应运而生,并用以代替具有高性能的单台Web服务器。在Web集群中,每类服务包含多个服务实例副本,同一服务的多个服务实例副本由多个不同的服务器承载。为了将用户请求合理地、均衡地分配到不同的服务实例副本,确保各服务器及服务实例副本间的负载平衡,提高Web集群系统的并发能力和系统资源的利用率,高效的负载均衡策略是问题的关键所在。With the rapid development of Internet applications such as social networks and e-commerce, network servers are faced with the following two problems: (1) the number of visits increases exponentially; (2) transaction processing becomes more complicated. In order to deal with the above problems and provide users with a high-performance network service environment, a distributed Web server system (Web cluster) emerges as the times require, and is used to replace a single Web server with high performance. In a web cluster, each type of service contains multiple service instance copies, and multiple service instance copies of the same service are hosted by multiple different servers. In order to distribute user requests to different service instance copies in a reasonable and balanced manner, ensure load balance between servers and service instance copies, and improve the concurrency capability of the Web cluster system and the utilization of system resources, an efficient load balancing strategy is a problem the key to.

传统Web集群是以物理机或虚拟机为单位承载服务实例副本,并根据负载均衡策略将用户请求合理地分发给承载不同服务实例副本的物理机或虚拟机。然而,随着云计算技术的发展,基于操作系统虚拟化的Docker容器作为一种新的承载服务实例的基本单位出现了。由于Docker使用了基于操作系统的虚拟化技术,因此,与传统的基于完全虚拟化的虚拟机相比,Docker能够实现运行时系统的资源弹性分配功能(即当Docker容器中无任务执行时,Docker容器不占用CPU资源;有任务执行时Docker容器按照其CPU权重大小占用所需的CPU资源),提高服务器资源的利用率。Docker的这一新特性,使得传统Web集群上的负载均衡策略不再适用,因此,需要构建一种合理的、均衡的基于操作系统虚拟化的Web请求负载均衡方法。Traditional web clusters host copies of service instances in units of physical machines or virtual machines, and reasonably distribute user requests to physical machines or virtual machines that host copies of different service instances according to load balancing policies. However, with the development of cloud computing technology, the Docker container based on operating system virtualization has emerged as a new basic unit for carrying service instances. Because Docker uses the virtualization technology based on the operating system, compared with the traditional virtual machine based on full virtualization, Docker can realize the resource elastic allocation function of the runtime system (that is, when there is no task execution in the Docker container, Docker The container does not occupy CPU resources; when a task is executed, the Docker container occupies the required CPU resources according to its CPU weight), which improves the utilization of server resources. This new feature of Docker makes the load balancing strategy on the traditional Web cluster no longer applicable. Therefore, it is necessary to build a reasonable and balanced method of Web request load balancing based on operating system virtualization.

发明内容Contents of the invention

本发明针对现有技术的不足,提供了一种基于操作系统虚拟化的Web请求负载均衡方法。Aiming at the deficiencies of the prior art, the present invention provides a web request load balancing method based on operating system virtualization.

本发明方法的具体步骤是:The concrete steps of the inventive method are:

步骤(1)建立服务器资源状态信息列表。Web集群中服务器集合S表示为:Step (1) Establish a server resource status information list. The server set S in the Web cluster is expressed as:

S={s1,s2,s3,...,sj,...,sn}S={s 1 ,s 2 ,s 3 ,...,s j ,...,s n }

其中sj(1≤j≤n)表示Web集群中的某一服务器,n表示Web集群包含的服务器总数。服务器sj总的资源Pj表示为:Among them, s j (1≤j≤n) represents a certain server in the Web cluster, and n represents the total number of servers contained in the Web cluster. The total resource P j of server s j is expressed as:

Pj=(Pj_cpu,Pj_memory,Pj_io,Pj_network)P j =(P j_cpu ,P j_memory ,P j_io ,P j_network )

其中Pj_cpu表示服务器sj的CPU的计算能力,Pj_memory表示服务器sj的内存处理能力,Pj_io表示服务器sj的硬盘I/O能力,Pj_network表示服务器sj的网络吞吐率。为了消除服务器异构性及不同种类资源的差异性所带来的影响,采用Max-Min方法对服务器sj总的资源Pj值进行归一化,服务器sj总的资源归一化值POj表示为:Among them, P j_cpu represents the computing power of the CPU of server s j , P j_memory represents the memory processing capacity of server s j , P j_io represents the hard disk I/O capacity of server s j , and P j_network represents the network throughput of server s j . In order to eliminate the impact of server heterogeneity and the difference of different types of resources, the Max-Min method is used to normalize the total resource P j value of server s j , and the total resource normalized value PO of server s j j is expressed as:

POj=(POj_cpu,POj_memory,POj_io,POj_network)PO j =(PO j_cpu ,P Oj_memory ,P Oj_io ,P Oj_network )

步骤(2)建立服务实例资源状态信息列表。设Web集群对外提供的服务集合F表示为:Step (2) Establish a list of service instance resource state information. Let the service set F provided by the Web cluster be expressed as:

F={f1,f2,f3,...,fi,...fm}F={f 1 ,f 2 ,f 3 ,...,f i ,...f m }

其中fi(1≤i≤m)表示集群对外提供的第i种服务,m表示集群提供的服务种类总数。服务fi包含多个不同的服务实例副本集合Fi表示为:Among them, f i (1≤i≤m) represents the i-th service provided by the cluster, and m represents the total number of service types provided by the cluster. The service f i contains multiple different service instance replica sets F i expressed as:

Fi={fi1,fi2,fi3,…,fik,…,fil}F i ={f i1 ,f i2 ,f i3 ,…,f ik ,…,f il }

其中fik(1≤k≤l)表示服务fi的实例副本,l表示服务fi的实例副本个数。服务实例fik的资源状态信息STik表示为:Among them, f ik (1≤k≤l) represents the instance copy of service f i , and l represents the number of instance copies of service f i . The resource state information ST ik of the service instance f ik is expressed as:

其中表示服务fi的实例副本fik所在的主机sj,cpu_shareik表示服务fi的实例副本fik的CPU权值,memoryik_total表示服务fi的实例副本fik的最大可占用内存。in Indicates the host s j where the instance copy f ik of the service f i is located, cpu_share ik indicates the CPU weight of the instance copy f ik of the service f i , and memory ik_t o tal indicates the maximum occupancy of the instance copy f ik of the service f i Memory.

步骤(3)每隔周期时间T,负载均衡服务器会定期收集Web集群中所有服务器在该周期时间T内的负载信息。主要负载信息包括:Step (3) Every cycle time T, the load balancing server periodically collects load information of all servers in the Web cluster within the cycle time T. Key payload information includes:

服务器sj的CPU利用率:CPU utilization of server s j :

CPUj=CPU繁忙时间/(CPU繁忙时间+CPU空闲时间)CPU j = CPU busy time/(CPU busy time + CPU idle time)

服务器sj的硬盘I/O负载:Hard disk I/O load of server s j :

IOj=硬盘IO繁忙时间/(硬盘IO繁忙时间+硬盘IO空闲时间)IO j = hard disk IO busy time / (hard disk IO busy time + hard disk IO idle time)

服务器sj的网络负载:Network load of server s j :

Networkj=(周期T内流入流量+周期T内输出流量)/(周期T*Pj_network)Network j = (incoming traffic in period T + output traffic in period T)/(period T*P j_network )

服务器sj上所有实例副本CPU权值数之和:The sum of CPU weights of all instance replicas on server s j :

服务器sj上服务fi的实例副本fik内存利用率:The memory utilization of instance copy f ik of service f i on server s j :

其中memoryik_used表示服务fi的实例副本fik已使用的内存值;Where memory ik_used represents the memory value used by the instance copy f ik of the service f i ;

步骤(4)负载均衡服务器根据收集的服务器负载信息以及现存服务器与服务实例状态信息,计算部署在服务器sj上的服务实例fik的最终权值并更新权值列表中相应服务实例的权值信息。Step (4) The load balancing server calculates the final weight of the service instance f ik deployed on the server s j according to the collected server load information and the status information of the existing servers and service instances And update the weight information of the corresponding service instance in the weight list.

其中αik、βik、γik、δik分别表示服务fi对CPU、内存、硬盘以及网络四类资源所赋予的不同权值,且同一服务不同服务实例对这四类资源所赋予的权值相同。负载均衡服务器根据每个服务实例的权值大小采用业界广泛使用的加权轮询算法分发相应服务的Web请求。Among them, α ik , β ik , γ ik , and δ ik respectively represent the different weights given by service f i to the four types of resources of CPU, memory, hard disk and network, and the weights given by different service instances of the same service to these four types of resources same value. According to the weight of each service instance, the load balancing server uses the weighted round-robin algorithm widely used in the industry to distribute the web requests of the corresponding services.

本发明所提供基于操作系统虚拟化的Web请求负载均衡方法由一组功能模块组成,它们包括:静态信息收集模块、动态信息收集模块、权值计算模块和负载分发模块。The web request load balancing method based on operating system virtualization provided by the present invention is composed of a group of functional modules, including: a static information collection module, a dynamic information collection module, a weight calculation module and a load distribution module.

静态信息收集模块在负载均衡方法初始化时收集服务器与服务实例的静态信息。服务器的静态信息主要包括:Web集群中每台服务器总的CPU计算能力Pj_cpu、内存处理能力Pj_memory、硬盘I/0能力Pj_io、网络吞吐能力Pj_network。服务实例的静态信息主要包括:服务fi的服务实例fik所在主机服务fi的服务实例fik的CPU权值cpu_shareik,服务fi的服务实例fik的最大可占用内存memoryik_total。当Web集群中服务器或服务动态变更时,在静态信息模板中需要更新相应服务器或服务的静态信息。The static information collection module collects static information of servers and service instances when the load balancing method is initialized. The static information of the server mainly includes: the total CPU computing capability P j_cpu of each server in the Web cluster, the memory processing capability P j_memory , the hard disk I/O capability P j_io , and the network throughput capability P j_network . The static information of the service instance mainly includes: the host of the service instance f ik of the service f i The CPU weight cpu_share ik of the service instance f ik of the service f i , the maximum memory ik_total that can be occupied by the service instance f ik of the service f i. When the server or service in the Web cluster changes dynamically, the static information of the corresponding server or service needs to be updated in the static information template.

动态信息收集模块主要收集服务器及服务实例动态变化的状态信息。每隔周期时间T,动态信息收集模块会收集服务器及服务实例动态变化的状态信息。为了防止信息收集过于频繁而造成网络负担,周期时间T的取值依据统计经验设定为5-10秒。此外,当服务实例新增或删除时,动态信息收集模块也会执行收集动作。收集的状态信息主要包括该周期时间T内服务器sj(1≤j≤n)的CPU利用率CPUj、硬盘的I/O负载IOj、网络负载Networkj、服务器sj上所有服务实例副本的CPU权值之和服务器sj上服务fi的实例副本fik的内存利用率 The dynamic information collection module mainly collects the dynamic state information of servers and service instances. Every cycle time T, the dynamic information collection module will collect the dynamically changing state information of the server and the service instance. In order to prevent network load caused by too frequent information collection, the value of cycle time T is set to 5-10 seconds based on statistical experience. In addition, when a service instance is added or deleted, the dynamic information collection module will also perform a collection action. The collected state information mainly includes the CPU utilization CPU j of the server s j (1≤j≤n) within the cycle time T, the I/O load IO j of the hard disk, the network load Network j , and all service instance copies on the server s j The sum of the CPU weights Memory utilization of instance copy f ik of service f i on server s j

权值计算模块根据所收集的服务器及服务实例的信息计算出每个服务实例的最终权值。The weight calculation module calculates the final weight of each service instance according to the collected information of servers and service instances.

负载分发模块根据权值计算模块所得的服务实例权值,采用加权轮询调度算法,将较多的Web请求分发给权值较大的服务实例,较少的服务请求分发给权值较小的服务实例,达到同一服务不同服务实例间的负载均衡。According to the weight of the service instance obtained by the weight calculation module, the load distribution module adopts the weighted round-robin scheduling algorithm to distribute more Web requests to service instances with larger weights, and distribute fewer service requests to those with smaller weights. Service instances to achieve load balancing among different service instances of the same service.

本发明提出的方法利用基于操作系统虚拟化的Docker容器能够实现运行时系统资源弹性分配的特点,即根据服务实例CPU权值大小将计算资源按比例分配给承载相应服务实例的Docker容器,实现不同服务实例副本及服务器间的负载均衡。该方法通过进一步在服务实例权值计算公式中引入服务实例的CPU权值,从而避免了同一服务器上承载不同服务实例的Docker容器对所在服务器剩余计算资源的恶性竞争而导致服务器负载过重的情况。与传统方法相比,本发明所述方法可以有效避免同一服务器上的不同服务实例副本,由于所在服务器负载较低而同时接收大量Web请求造成所在服务器超载的现象,实现服务实例副本及服务器间的负载均衡,提高Web集群系统的并发能力,减少请求的平均响应时间。The method proposed in the present invention utilizes the characteristics that the Docker container based on the virtualization of the operating system can realize the elastic allocation of system resources at runtime, that is, the computing resources are allocated in proportion to the Docker container carrying the corresponding service instance according to the CPU weight of the service instance, so as to realize different Service instance replicas and load balancing between servers. This method further introduces the CPU weight of the service instance into the calculation formula of the service instance weight, thus avoiding the vicious competition between the Docker containers carrying different service instances on the same server for the remaining computing resources of the server and causing the server to be overloaded . Compared with the traditional method, the method of the present invention can effectively avoid different service instance copies on the same server, and the phenomenon that the server is overloaded due to the low load of the server receiving a large number of Web requests at the same time can realize the service instance copy and server-to-server communication. Load balancing, improve the concurrent capability of the Web cluster system, and reduce the average response time of requests.

附图说明Description of drawings

图1为集群中服务器、服务、服务实例副本关系示例图;Figure 1 is an example diagram of the relationship among servers, services, and service instance replicas in the cluster;

图2为动态信息收集流程图。Figure 2 is a flowchart of dynamic information collection.

具体实施方式Detailed ways

本发明所提供的基于操作系统虚拟化的Web请求负载均衡方法具体实施方式主要分四步:The specific implementation of the Web request load balancing method based on operating system virtualization provided by the present invention is mainly divided into four steps:

(1)服务器资源信息收集与归一化;(2)服务器及服务实例动态信息收集(3)根据服务器资源信息以及周期性收集到的动态信息计算所有服务的服务实例副本的最终权值;(4)通过加权轮询分发请求。(1) Server resource information collection and normalization; (2) Server and service instance dynamic information collection (3) Calculate the final weight of service instance copies of all services based on server resource information and periodically collected dynamic information; ( 4) Distribute requests by weighted round robin.

(1)服务器资源信息收集与归一化(1) Collection and normalization of server resource information

静态信息收集模块收集Web集群中每台服务器的CPU计算能力Pj_cpu、内存处理能力Pj_memory、硬盘I/0能力Pj_io、网络吞吐能力Pj_network四项资源信息。并分别计算出他们的最大最小值如下:The static information collection module collects four resource information including CPU computing capability P j_cpu , memory processing capability P j_memory , hard disk I/0 capability P j_io , and network throughput capability P j_network of each server in the Web cluster. And calculate their maximum and minimum values respectively as follows:

Pmax_cpu=max(P1_cpu,P2_cpu,…,Pj_cpu,…,Pn_cpu)P max_cpu =max(P 1_cpu ,P 2_cpu ,…,P j_cpu ,…,P n_cpu )

Pmin_cpu=min(P1_cpu,P2_cpu,…,Pj_cpu,…,Pn_cpu)P min_cpu =min(P 1_cpu ,P 2_cpu ,…,P j_cpu ,…,P n_cpu )

Pmax_memory=max(P1_memory,P2_memory,…,Pj_memory,…,Pn_memory)P max_memory =max(P 1_memory ,P 2_memory ,…,P j_memory ,…,P n_memory )

Pmin_memory=min(P1_memory,P2_memory,…,Pj_memory,…,Pn_memory)P min_memory =min(P 1_memory ,P 2_memory ,…,P j_memory ,…,P n_memory )

Pmax_io=max(P1_io,P2_io,…,Pj_io,…,Pn_io)P max_io =max(P 1_io ,P 2_io ,…,P j_io ,…,P n_io )

Pmin_io=min(P1_io,P2_io,…,Pj_io,…,Pn_io)P min_io =min(P 1_io ,P 2_io ,…,P j_io ,…,P n_io )

Pmax_network=max(P1_network,P2_network,…,Pj_network,…,Pn_network)P max_network =max(P 1_network ,P 2_network ,…,P j_network ,…,P n_network )

Pmin_network=min(P1_network,P2_network,…,Pj_network,…,Pn_network)P min_network =min(P 1_network ,P 2_network ,…,P j_network ,…,P n_network )

为了消除服务器异构性及不同种类资源的差异性所带来的影响,采用Max-Min方法对服务器CPU计算能力Pj_cpu、内存处理能力Pj_memory、硬盘I/0能力Pj_io、网络吞吐能力Pj_network四项资源信息进行归一化操作,并分别用POj_cpu,POj_memory,POj_io,POj_network表示归一化后相对应的值。In order to eliminate the impact of server heterogeneity and the difference of different types of resources, the Max-Min method is used to evaluate the server CPU computing power P j_cpu , memory processing power P j_memory , hard disk I/0 capacity P j_io , and network throughput P The four resource information of j_network are normalized, and PO j_cpu , PO j_memory , PO j_io , PO j_network are respectively used to represent the corresponding values after normalization.

CPU计算能力归一化值POj_cpuNormalized value of CPU computing capability PO j _ cpu :

POj_cpu=(Pj_cpu-Pmin_cpu)/(Pmax_cpu-Pmin_cpu)PO j_cpu = (P j_cpu -P min_cpu )/(P max_cpu -P min_cpu )

内存处理能力归一化值Pj_memoryNormalized value of memory processing capability P j_memory :

POj_memory=(Pj_memory-Pmin_memory)/(Pmax_memory-Pmin_memory)PO j_memory = (P j_memory -P min_memory )/(P max_memory -P min_memory )

硬盘I/O能力归一化值POj_io:Hard disk I/O capability normalized value PO j _ i o:

POj_io=(Pj_io-Pmin_ix)/(Pmax_io-Pmin_io)PO j_io = (P j_io -P min_ix )/(P max_io -P min_io )

网络吞吐能力归一化值Pj_networkNormalized value of network throughput P j_network :

POj_network=(Pj_network-Pmin_network)/(Pmax_network-Pmin_network)PO j_network = (P j_network -P min_network )/(P max_network -P min_network )

(2)服务器及服务实例动态信息收集(2) Server and service instance dynamic information collection

在Web集群中服务器、服务以及服务实例副本之间的关系如图1所示。在图1中,Web集群中s1,s2,s3三个物理机运行着f1,f2,f3三个服务的8个服务实例副本(图1中f11,f12,f21,f22,f23,f31,f32,f33)。每隔周期时间T,动态信息收集模块根据图2所示的动态信息收集流程对图1中三个服务器以及三个服务的八个服务实例副本进行动态信息收集,然后通过权值计算模块重新计算所有服务的服务实例副本的权值。此外,当服务实例新增或删除时,动态信息收集模块也会执行收集动作并重新计算服务实例副本的权值。The relationship among servers, services and service instance replicas in the Web cluster is shown in Figure 1. In Figure 1, the three physical machines s 1 , s 2 , and s 3 in the Web cluster are running 8 service instance copies of the three services f 1 , f 2 , and f 3 (f 11 , f 12 , f 21 , f 22 , f 23 , f 31 , f 32 , f 33 ). Every cycle time T, the dynamic information collection module performs dynamic information collection on the three servers and eight service instance copies of the three services in Figure 1 according to the dynamic information collection process shown in Figure 2, and then recalculates through the weight calculation module The weight of service instance replicas for all services. In addition, when a service instance is added or deleted, the dynamic information collection module will also perform a collection action and recalculate the weight of the service instance copy.

动态信息收集模块收集的信息主要包括:周期时间T时间内服务器sj(1≤j≤n)的CPU利用率CPUj、硬盘的I/O负载IOj,网络负载Networkj,服务器sj上所有服务实例副本的CPU权值之和服务器sj上服务fi的实例副本fik的内存利用率 The information collected by the dynamic information collection module mainly includes: the CPU utilization CPU j of the server s j (1≤j≤n) within the cycle time T, the I/O load IO j of the hard disk, the network load Network j , and the The sum of the CPU weights of all service instance replicas Memory utilization of instance copy f ik of service f i on server s j

(3)服务实例副本权值计算(3) Service instance replica weight calculation

根据步骤(1)中计算所得的服务器资源归一化值以及步骤(2)中所收集的服务器及服务实例动态信息,计算部署在服务器sj上的服务实例fik的最终权值 According to the normalized value of server resources calculated in step (1) and the dynamic information of servers and service instances collected in step (2), calculate the final weight of service instance f ik deployed on server s j

(4)通过加权轮询分发请求(4) Distribute requests through weighted round robin

根据第(3)步所得的服务实例权值讲权值结果更新后,负载分发模块采用加权轮询调度算法,将同一服务的Web请求均衡地分发给该服务的不同服务实例副本,从而实现不同实例副本以及服务器之间的负载均衡。According to the service instance weight obtained in step (3) and after the weight result is updated, the load distribution module uses the weighted round-robin scheduling algorithm to evenly distribute the web requests of the same service to different service instance copies of the service, so as to realize different Instance replication and load balancing between servers.

Claims (1)

1. the Web request load-balancing method based on operating system virtualization, it is characterised in that this method comprises the following steps:
Step (1) establishes server resource state information list;Server set S is expressed as in Web clusters:
S={ s1,s2,s3,…,sj,…,sn}
Wherein sjThe a certain server in Web clusters is represented, 1≤j≤n, n represent the server sum that Web clusters include;Service Device sjTotal resource PjIt is expressed as:
Pj=(Pj_cpu,Pj_memory,Pj_io,Pj_network)
Wherein Pj_cpuRepresent server sjCPU computing capability, Pj_memoryRepresent server sjInternal memory disposal ability, Pj_io Represent server sjHard disk I/O abilities, Pj_networkRepresent server sjNetwork throughput;Using Max-Min methods to clothes Be engaged in device sjTotal resource PjValue is normalized, server sjTotal resource normalized value POjIt is expressed as:
POj=(POj_cpu,POj_memory,POj_io,POj_network)
Wherein POj_cpuRepresent Pj_cpuNormalized value, POj_memoryRepresent Pj_memoryNormalized value, POj_ioRepresent Pj_ioReturn One change value, POj_networkRepresent Pj_networkNormalized value;
Step (2) establishes Service Instance resource state information list;If the set of service F that Web clusters externally provide is expressed as:
F={ f1,f2,f3,…,fi,…,fm}
Wherein fiI-th kind of service that cluster externally provides is represented, 1≤i≤m, m represent the type service sum that cluster provides;Service fiInclude multiple different Service Instance copy set FiIt is expressed as:
Fi={ fi1,fi2,fi3,…,fik,…,fil}
Wherein fikRepresent service fiExample copy, 1≤k≤l, l represent service fiExample copy number;Service Instance fik's Resource state information STikIt is expressed as:
<mrow> <msub> <mi>ST</mi> <mrow> <mi>i</mi> <mi>k</mi> </mrow> </msub> <mo>=</mo> <mrow> <mo>(</mo> <msubsup> <mi>L</mi> <mrow> <mi>i</mi> <mi>k</mi> </mrow> <mi>j</mi> </msubsup> <mo>,</mo> <mi>c</mi> <mi>p</mi> <mi>u</mi> <mo>_</mo> <msub> <mi>share</mi> <mrow> <mi>i</mi> <mi>k</mi> </mrow> </msub> <mo>,</mo> <msub> <mi>memory</mi> <mrow> <mi>i</mi> <mi>k</mi> <mo>_</mo> <mi>t</mi> <mi>o</mi> <mi>t</mi> <mi>a</mi> <mi>l</mi> </mrow> </msub> <mo>)</mo> </mrow> </mrow>
WhereinRepresent service fiExample copy fikThe main frame s at placej, cpu_shareikRepresent service fiExample copy fik CPU weights, memoryik_totalRepresent service fiExample copy fikMaximum can committed memory;
Step (3) is every Servers-all in cycle time T, load-balanced server meeting periodic collection Web clusters in the cycle Load information in time T;Basic load information includes:
Server sjCpu busy percentage CPUj
CPUj=cpu busy time/(the cpu busy time+cpu idle time)
Server sjHard disk I/O load IOj
IOj=hard disk IO the rush hours/(the hard disk IO rush hours+hard disk IO free times)
Server sjNetwork load Networkj
Networkj=(output flow in flow+cycle T is flowed into cycle T)/(cycle T * Pj_network)
Server sjUpper all example copy CPU weights number sums:
Server sjUpper service fiExample copy fikMemory usage
<mrow> <msubsup> <mi>Memory</mi> <mrow> <mi>i</mi> <mi>k</mi> </mrow> <mi>j</mi> </msubsup> <mo>=</mo> <msub> <mi>memory</mi> <mrow> <mi>i</mi> <mi>k</mi> <mo>_</mo> <mi>u</mi> <mi>s</mi> <mi>e</mi> <mi>d</mi> </mrow> </msub> <mo>/</mo> <msub> <mi>memory</mi> <mrow> <mi>i</mi> <mi>k</mi> <mo>_</mo> <mi>t</mi> <mi>o</mi> <mi>t</mi> <mi>a</mi> <mi>l</mi> </mrow> </msub> </mrow>
Wherein memoryik_usedRepresent service fiExample copy fikThe memory value used;
Step (4) load-balanced servers are according to the server load information and existing service device of collection and Service Instance shape State information, calculating are deployed in server sjOn Service Instance fikFinal weightsAnd update corresponding in weights list The value information of Service Instance:
Wherein αik、βik、γik、δikService f is represented respectivelyiCPU, internal memory, hard disk and the class resource of network four are assigned not Same weights, and the weights that the different Service Instances of same service are assigned to this four classes resource are identical,Expression is deployed in Server sjOn service fiExample fikCPU weights;Load-balanced server is according to the weights size of each Service Instance Using the Web request of Weighted Round Robin distribution respective service.
CN201510160526.0A 2015-04-07 2015-04-07 Web request load-balancing method based on operating system virtualization Expired - Fee Related CN104902001B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510160526.0A CN104902001B (en) 2015-04-07 2015-04-07 Web request load-balancing method based on operating system virtualization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510160526.0A CN104902001B (en) 2015-04-07 2015-04-07 Web request load-balancing method based on operating system virtualization

Publications (2)

Publication Number Publication Date
CN104902001A CN104902001A (en) 2015-09-09
CN104902001B true CN104902001B (en) 2018-04-06

Family

ID=54034397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510160526.0A Expired - Fee Related CN104902001B (en) 2015-04-07 2015-04-07 Web request load-balancing method based on operating system virtualization

Country Status (1)

Country Link
CN (1) CN104902001B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106612310A (en) * 2015-10-23 2017-05-03 腾讯科技(深圳)有限公司 A server scheduling method, apparatus and system
CN105407162B (en) * 2015-11-27 2018-11-06 国云科技股份有限公司 Cloud computing Web application resource load balancing method based on S L A service level
CN106919450B (en) * 2015-12-24 2020-11-17 华为技术有限公司 Resource adjusting method and device
CN106850834A (en) * 2017-03-01 2017-06-13 郑州云海信息技术有限公司 A kind of service request method and apparatus and load equalizer
CN107483531A (en) * 2017-06-20 2017-12-15 华迪计算机集团有限公司 A kind of mass data high concurrent, which receives, solves method and system
CN107508884B (en) * 2017-08-24 2021-04-02 北京仿真中心 A Sharing Method of Simulation Model Based on SOA
CN108063814B (en) * 2017-12-15 2021-09-21 杭州迪普科技股份有限公司 Load balancing method and device
CN110233866B (en) * 2018-03-06 2021-12-07 中国移动通信集团广东有限公司 Load balancing method and load balancer
CN108632394A (en) * 2018-08-13 2018-10-09 北京奇艺世纪科技有限公司 A kind of web cluster load balancing method of adjustment and device
CN109040283A (en) * 2018-08-23 2018-12-18 上海海事大学 A kind of modified load-balancing algorithm based on difference reaction type
CN111625355A (en) * 2020-05-21 2020-09-04 慧众行知科技(北京)有限公司 Service balance control method and system on server
CN113596149B (en) * 2021-07-28 2024-07-12 马上消费金融股份有限公司 Flow control method, device, equipment and storage medium
CN115499873B (en) * 2022-07-29 2025-08-15 浪潮通信技术有限公司 Method, device and server for fusion selection of core network service message routes

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972311A (en) * 2006-12-08 2007-05-30 华中科技大学 A stream media server system based on cluster balanced load
WO2011035608A1 (en) * 2009-09-23 2011-03-31 中兴通讯股份有限公司 Data query system and constructing method thereof and corresponding data query method
CN102223419A (en) * 2011-07-05 2011-10-19 北京邮电大学 Virtual resource dynamic feedback balanced allocation mechanism for network operation system
CN102394929A (en) * 2011-10-31 2012-03-28 广东电子工业研究院有限公司 A session-oriented cloud computing load balancing system and method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8433749B2 (en) * 2009-04-15 2013-04-30 Accenture Global Services Limited Method and system for client-side scaling of web server farm architectures in a cloud data center

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972311A (en) * 2006-12-08 2007-05-30 华中科技大学 A stream media server system based on cluster balanced load
WO2011035608A1 (en) * 2009-09-23 2011-03-31 中兴通讯股份有限公司 Data query system and constructing method thereof and corresponding data query method
CN102223419A (en) * 2011-07-05 2011-10-19 北京邮电大学 Virtual resource dynamic feedback balanced allocation mechanism for network operation system
CN102394929A (en) * 2011-10-31 2012-03-28 广东电子工业研究院有限公司 A session-oriented cloud computing load balancing system and method thereof

Also Published As

Publication number Publication date
CN104902001A (en) 2015-09-09

Similar Documents

Publication Publication Date Title
CN104902001B (en) Web request load-balancing method based on operating system virtualization
CN103713956B (en) Method for intelligent weighing load balance in cloud computing virtualized management environment
CN103309946B (en) Multimedia file processing method, Apparatus and system
CN105491138B (en) A Distributed Load Scheduling Method Based on Load Rate Hierarchical Triggering
CN102394931B (en) Cloud-based user visit request scheduling method
CN107992353B (en) Container dynamic migration method and system based on minimum migration volume
CN103297499B (en) Scheduling method and system based on cloud platform
CN103412635B (en) Data center&#39;s power-economizing method and device
CN102307133A (en) A method for scheduling virtual machines on a public cloud platform
CN102195886A (en) Service scheduling method on cloud platform
CN107562537B (en) A cloud computing task scheduling method based on gravitational search
CN103475538A (en) Multi-interface-based self-adaptive cloud service test method
Shahapure et al. Virtual machine migration based load balancing for resource management and scalability in cloud environment
CN114064294B (en) Dynamic resource allocation method and system in mobile edge computing environment
Tao et al. Load feedback-based resource scheduling and dynamic migration-based data locality for virtual hadoop clusters in openstack-based clouds
CN105120008B (en) A kind of distributed cloud computing center balancing method of loads based on layering
CN108089918A (en) A kind of figure computational load equalization methods towards heterogeneous server structure
CN107070965B (en) Multi-workflow resource supply method under virtualized container resource
CN115022926A (en) A multi-objective optimized container migration method based on resource balance
Zhou et al. Strategy optimization of resource scheduling based on cluster rendering
CN104618480B (en) Cloud system resource allocation methods based on the driving of network link utilization rate
CN103699448A (en) Scheduling method based on time limit and budget in cloud computing environment
CN109005211A (en) Thin cloud deployment and scheduling user task method under a kind of wireless MAN environment
CN107656805A (en) A kind of electric power data job scheduling method based on Hadoop platform
CN103176850A (en) A load-balancing task allocation method for power system network clusters

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180406