CN114911602A - Load balancing method, device, equipment and storage medium for server cluster - Google Patents

Load balancing method, device, equipment and storage medium for server cluster Download PDF

Info

Publication number
CN114911602A
CN114911602A CN202110176716.7A CN202110176716A CN114911602A CN 114911602 A CN114911602 A CN 114911602A CN 202110176716 A CN202110176716 A CN 202110176716A CN 114911602 A CN114911602 A CN 114911602A
Authority
CN
China
Prior art keywords
server
reverse proxy
user access
object storage
proxy server
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.)
Pending
Application number
CN202110176716.7A
Other languages
Chinese (zh)
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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110176716.7A priority Critical patent/CN114911602A/en
Publication of CN114911602A publication Critical patent/CN114911602A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a load balancing method and device of a server cluster, electronic equipment and a computer storage medium, wherein the method comprises the following steps: when a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server; determining a target object storage gateway server corresponding to the user access request through a reverse proxy server; determining a target process used for processing a user access request on a target object storage gateway server through a reverse proxy server; sending a user access request to a target object storage gateway server through a reverse proxy server; the target process is called by the target object storage gateway server to respond to the user access request, so that the problem of user access request circulation is solved, the server cluster is ensured to receive and process the user access request in a balanced manner, and the problem of providing a single point for the outside in the server cluster is solved.

Description

Load balancing method, device, equipment and storage medium for server cluster
Technical Field
The present application relates to the field of cloud computing technologies, and in particular, to a load balancing method for a server cluster, a load balancing apparatus for a server cluster, an electronic device, and a storage medium.
Background
In recent years, with the Wide application and the deep development of big data, cloud computing and mass data storage in information systems, application requests of users to access a server cluster global Wide area network (World Wide Web) service through a network are increasing. When the scale of the server cluster is gradually increased and a large number of requests fall in the server cluster web service, how to ensure the server cluster to receive and process the requests in a balanced manner becomes a problem to be solved urgently.
At present, in the related art, a keepalive + Linux Virtual Server component (LVS)/Nginx component is used to solve the above problem, and specifically, the keepalive receives a user access request and forwards the user access request to the LVS/Nginx, and the LVS/Nginx distributes the user access request to an object storage Gateway (RGW) node for processing. However, this method has a problem that the user request may loop back, which results in that the user request cannot be sent out, and thus the server cluster cannot correctly process the user request.
Disclosure of Invention
The application provides a load balancing method of a server cluster, a load balancing device of the server cluster, an electronic device and a storage medium, and solves the problems that in the related art, a user request can not be sent out due to the fact that the user request can be circulated, and therefore the server cluster can not correctly process the user request.
The technical scheme of the application is realized as follows:
the application provides a load balancing method of a server cluster, which comprises the following steps:
when a load balancing server in a server cluster receives user access requests sent by different clients, the user access requests are forwarded to a reverse proxy server through the load balancing server;
determining, by the reverse proxy server, a target object storage gateway server corresponding to the user access request;
determining, by the reverse proxy server, a target process on the target object storage gateway server for processing the user access request;
sending the user access request to the target object storage gateway server through the reverse proxy server;
and calling the target process through the target object storage gateway server to respond to the user access request.
In the above solution, the determining, by the reverse proxy server, a target process on the target object storage gateway server for processing the user access request includes:
determining a request identifier carried by the user access request through the reverse proxy server;
and searching the target process corresponding to the request identifier from a target object storage gateway server through the reverse proxy server.
In the foregoing solution, the searching, by the reverse proxy server, the target process corresponding to the request identifier from a target object storage gateway server includes:
searching a first process corresponding to the request identifier from a target object storage gateway server through the reverse proxy server;
determining, by the reverse proxy server, that the first process is in an out-of-contact state;
searching a second process corresponding to the request identifier from a target object storage gateway server through the reverse proxy server; wherein the second process is different from the first process;
and when the second process is in an idle state, determining that the second process is the target process.
In the above scheme, the weight of the second process is smaller than the weight of the first process.
In the above solution, after determining that the first process is in the offline state by the reverse proxy server, the method includes:
setting the weight of a first process as a first parameter through the reverse proxy server; wherein the first parameter is used for characterizing that the first process is in the offline state.
In the foregoing solution, after setting the weight of the first process as the first parameter by the reverse proxy server, the method includes:
determining, by the reverse proxy server, that the first process transitioned from the offline state to the idle state;
modifying, by the reverse proxy server, a weight of a first process from the first parameter to a second parameter; wherein the second parameter is used for characterizing that the first process is in the idle state.
In the foregoing solution, the determining, by the reverse proxy server, a target object storage gateway server corresponding to the user access request includes:
determining the resource utilization rate of each object storage gateway server in all the object storage gateway servers through the reverse proxy server;
and determining one object storage gateway server with the resource utilization rate smaller than the resource utilization rate threshold value in all the object storage gateway servers, and storing the gateway server as the target object storage gateway server.
The application provides a load balancing device of server cluster, the device includes:
the system comprises a first sending unit, a reverse proxy server and a second sending unit, wherein the first sending unit is used for forwarding a user access request to the reverse proxy server through a load balancing server when the load balancing server in a server cluster receives the user access request sent by different clients;
the first processing unit is used for determining a target object storage gateway server corresponding to the user access request through the reverse proxy server;
the second processing unit is used for determining a target process used for processing the user access request on the target object storage gateway server through the reverse proxy server;
a second sending unit, configured to send the user access request to the target object storage gateway server through the reverse proxy server;
and the third processing unit is used for calling the target process through the target object storage gateway server so as to respond to the user access request.
The application provides an electronic device, the electronic device includes: a memory for storing executable instructions; and the processor is used for executing the executable instructions stored in the memory so as to realize the load balancing method of the server cluster.
The present application provides a computer storage medium storing one or more programs, which are executable by one or more processors to implement the load balancing method for a server cluster described above.
The application provides a load balancing method of a server cluster, a load balancing device of the server cluster, electronic equipment and a storage medium, wherein when a load balancing server in the server cluster receives user access requests sent by different clients, the user access requests are forwarded to a reverse proxy server through the load balancing server; determining a target object storage gateway server corresponding to the user access request through a reverse proxy server; determining a target process used for processing a user access request on a target object storage gateway server through a reverse proxy server; sending a user access request to a target object storage gateway server through a reverse proxy server; calling a target process through a target object storage gateway server to respond to a user access request; in this way, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. Therefore, the problem of user access request circulation is solved, the server cluster is ensured to receive and process the user access request in a balanced manner, and the problem of providing a single point for the outside in the server cluster is solved; in addition, the weight of the RGW process is controlled by dynamically modifying the route configuration of the apisix through the HTTP request, and the apisix service does not need to be restarted, so that the data processing efficiency of the server cluster is improved.
Drawings
Fig. 1 is a block diagram illustrating a load balancing method for a server cluster according to the related art;
fig. 2 is a schematic flowchart of a load balancing method for an optional server cluster according to an embodiment of the present application;
fig. 3 is a structural block diagram of a load balancing method for a server cluster according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a load balancing method for an optional server cluster according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a load balancing method for an optional server cluster according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a load balancing method for an optional server cluster according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a load balancing apparatus of a server cluster according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, where "another" or "another" mentioned in the description of the drawings does not refer to a specific embodiment, and the embodiments of the present application may be combined with each other without conflict.
It should be appreciated that reference throughout this specification to "an embodiment of the present application" or "an embodiment described previously" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in the embodiments of the present application" or "in the embodiments" in various places throughout this specification are not necessarily all referring to the same embodiments. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
For ease of understanding, relevant terms in the embodiments of the present application will be first described.
1) Ceph is a distributed storage system characterized by high performance, high availability, high scalability, and rich features. The Ceph provides storage in three forms of block storage, file storage and object storage. The object store Gateway (RGW) is an entry for storing objects, and is essentially a HyperText Transfer Protocol (HTTP) server. Through this portal, users can access the object store for Ceph in RESTful fashion via the HTTP protocol.
2) A Linux Virtual Server (LVS) is a Virtual Server cluster system, and the LVS is mainly used for load balancing of a Server cluster. The system works in a network layer, and can realize a high-performance and high-availability server cluster technology; it is cheap, and can combine many low-performance servers together to form a super server; the method is easy to use, has very simple configuration, and has various load balancing methods; the cluster server is stable and reliable, and even if a certain server cannot work normally in the cluster server, the overall effect is not influenced; and meanwhile, the expandability is very good.
3) A Load Balance scheduler (LB) deploys network user access requests using a centralized or distributed policy, and determines specific configuration parameters according to the application of the cluster system, where the configuration parameters are related to a firewall, a router, and a network environment of the user.
4) Keepalived is a load balancing server in cluster management that guarantees the high availability of the cluster, which prevents single point of failure by detecting the state of the server.
5) Nginx is a high-performance and light-weight HTTP and reverse proxy web server, and provides an email IMAP/POP3/SMTP service, and is characterized by small memory occupation and strong concurrency capability.
6) Apsix is a cloud-native, high-performance, scalable microservice API gateway and reverse proxy server. Apsix is realized based on OpenResty and etcd, and compared with the traditional API gateway, Apsix has the functions of dynamic routing, plug-in hot loading, service hot starting, speed limit and current limit and the like.
In order to better understand the load balancing method for a server cluster provided in the present application, a load balancing method for a server cluster in the related art is first described:
current distributed storage systems are based on Ceph implementations. The object storage is one of three storages supported by Ceph, and the object storage system provides an object storage interface through an RGW based on the Ceph rados layer, wherein the RGW supports a standard s3 interface and a swift interface. The operation of the user on the data is to operate the underlying data through the RGW client, and mainly comprises the operations of uploading, downloading, deleting and the like, wherein the RGW is a total inflow and outflow processing client of the data in the object storage. Generally, a cluster has multiple RGW nodes, each of which has multiple RGW processes providing services to the outside, that is, multiple RGW instances, and these instances can provide an object storage and presentation State Transfer (Resource description State Transfer, rest) Application program Interface (api) service to the outside. With the increase of cluster size, the RGW node instances may even reach hundreds, how to ensure load balance and high availability of the server cluster, that is, how to ensure balanced request receiving processing of the RGW instances when a large number of requests fall in the server cluster, and solve the problem of providing a single point of service to the outside.
The related art solution for high availability and load balancing in a distributed storage system is achieved by two schemes, as shown in fig. 1, a scheme that adopts a mode of combining Keepalived and LVS components. Scheme two adopts a mode of combining Keepaldd and Nginx components; the two schemes are specifically realized in a process that a user access request is received through keepalive and forwarded to the LVS/Nginx, and the LVS/Nginx distributes the user access request to the RGW node for processing. The two schemes have the problems that the user request can be looped back, so that the user request cannot be sent out, and further, the server cluster cannot correctly process the user request.
The application provides a load balancing method for a server cluster, as shown in fig. 2, the method includes the following steps:
step 201, when a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server.
The load balancing server is service software for ensuring high availability of the server cluster in server cluster management, is used for preventing single-point faults of the server, and has the function of configuring and managing a reverse proxy server so as to realize high availability of web front-end services.
The reverse proxy server is a load balancing scheduler in server cluster management, and is used for load balancing of the server cluster, and here, the reverse proxy server is an apisix server.
In the embodiment of the present application, as shown in fig. 3, the server cluster includes at least N load balancing servers Keepalived, where N is greater than or equal to 2, and N is a positive integer, and includes at least M reverse proxy servers apisix, where M is greater than or equal to 2, and M is a positive integer, where N is less than M. Only one of the N load balancing servers keepalive is a main load balancing server keepalive, and the others are standby load balancing servers keepalive, and the main load balancing server keepalive and the standby load balancing servers keepalive communicate with each other through a Virtual Router Redundancy Protocol (VRRP). The main load balancing server keepalive provides a Virtual Internet Protocol (VIP) address of the virtual router for the outside, the user sends a user access request through the VIP address provided by the main load balancing server keepalive in the server cluster, and after receiving the user access request sent by different clients, the main load balancing server keepalive sends the user request to the reverse proxy server apisix corresponding to the main load balancing server keepalive.
Step 202, determining a target object storage gateway server corresponding to the user access request through the reverse proxy server.
The object storage gateway server is an object storage interface built in librados, is an interface for processing the total inflow and outflow of data in the server cluster, and supports a standard Amazon S3 RESTful interface and a Swift interface of OpenStack. It should be noted that the operation of the user on the data in the server cluster is to operate on the underlying data through the RGW, and the operation includes uploading, downloading, deleting, and the like.
The target object storage gateway server is an object storage gateway server corresponding to the user access request information.
Here, as shown in fig. 3, the server cluster at least includes P object storage gateway servers RGW, where P ≧ 2, and P is a positive integer, and the reverse proxy server apisix includes a correspondence between the user access request and each object storage gateway server RGW.
In the embodiment of the application, after receiving a user access request forwarded by a load balancing server Keepalived, a reverse proxy server apisix in a server cluster determines a target object storage gateway server RGW corresponding to the user access request through the reverse proxy server apisix.
And step 203, determining a target process used for processing the user access request on the target object storage gateway server through the reverse proxy server.
The process provides a rest api service in the server cluster for the outside, and is used for processing the user access request. Here, the process is an RGW process, which is also referred to as an RGW instance.
Here, as shown in fig. 3, the server cluster at least includes P object storage gateway servers RGW, where P is greater than or equal to 2 and P is a positive integer, each object storage gateway server RGW further includes at least Q RGW processes providing services to the outside, Q is greater than or equal to 2 and Q is a positive integer, and the reverse proxy server apisix in the server cluster manages multiple RGW processes in a grouped manner.
In the embodiment of the application, after the reverse proxy server apisix in the server cluster determines the target object storage gateway server RGW corresponding to the user access request, the target RGW process used for processing the user access request on the target object storage gateway server RGW is determined based on the group management of the reverse proxy server apisix on the plurality of RGW processes.
Step 204, sending the user access request to the target object storage gateway server through the reverse proxy server.
In the embodiment of the application, the user access request is sent to the target object storage gateway server RGW through the reverse proxy server apisix in the server cluster.
Step 205, the target RGW process is invoked by the target object storage gateway server RGW in response to the user access request.
In the embodiment of the application, a target object storage gateway server RGW in a server cluster calls a target RGW process to respond to a user access request.
The application provides a load balancing method of a server cluster, wherein when a load balancing server in the server cluster receives user access requests sent by different clients, the user access requests are forwarded to a reverse proxy server through the load balancing server; determining a target object storage gateway server corresponding to the user access request through a reverse proxy server; determining a target process used for processing a user access request on a target object storage gateway server through a reverse proxy server; sending a user access request to a target object storage gateway server through a reverse proxy server; calling a target process through a target object storage gateway server to respond to a user access request; in this way, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. Therefore, the problem of user access request circulation is solved, the server cluster is ensured to receive and process the user access request in a balanced manner, and the problem of providing a single point for the outside in the server cluster is solved; in addition, the weight of the RGW process is controlled by dynamically modifying the routing configuration of the apisix through the HTTP request, and the apisix services do not need to be restarted, so that the data processing efficiency of the server cluster is improved.
The application provides a load balancing method for a server cluster, as shown in fig. 4, the method includes the following steps:
step 301, when a load balancing server in a server cluster receives user access requests sent by different clients, forwarding the user access requests to a reverse proxy server through the load balancing server.
Step 302, determining a target object storage gateway server corresponding to the user access request through the reverse proxy server.
Step 303, determining a request identifier carried in the user access request through the reverse proxy server.
The request identifier may be a request address included in the user access request, and the request identifier may also be a uniform resource identifier included in the user access request.
In the embodiment of the application, the request identifier carried by the user access request is determined through a reverse proxy server in a server cluster.
And step 304, searching a target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server.
Here, since a plurality of routes are set in the reverse proxy server, a user access request input by a user at the client may be allocated to a corresponding route set by the reverse proxy server based on the request identification, and it should be noted that different routes correspond to different RGW processes in the target object storage gateway server RGW.
In a scenario of load balancing of a server cluster that can be implemented, when a request identifier is a request address included in a user access request, for example, the request address includes a host address and a client address, a reverse proxy server in the server cluster searches a target RGW process corresponding to the request address carried in the user access request from a target object storage gateway server RGW. It should be noted that, because the RGW processes corresponding to different address ranges set by the reverse proxy server are different, the reverse proxy server determines the address range to which the request address belongs, and searches for a target RGW process corresponding to the current address range from the target object storage gateway server RGW based on the address range to which the request address belongs. In this way, based on the included request address of the user access request, the RGW processes are group-managed using apisix to ensure that the user access request is sent to the target RGW process corresponding to the request address.
In a scenario of load balancing of a server cluster that can be implemented, when a request Identifier is a Uniform Resource Identifier (URI) contained in a user access request, a target RGW process corresponding to the URI carried in the user access request is searched from a target object storage gateway server RGW through a reverse proxy server in the server cluster. It should be noted that, since the RGW processes corresponding to URIs set by the reverse proxy server are different, the reverse proxy server searches for a target RGW process corresponding to the current URI from the target object storage gateway server RGW. In this way, the RGW processes are group-managed using apisix based on the URI included in the user access request to ensure that the user access request is sent to the target RGW process corresponding to the URI.
In this embodiment of the present application, step 304 may be implemented by searching, by the reverse proxy server, a target process corresponding to the request identifier from the target object storage gateway server, as shown in fig. 5,
step 3041, searching the first process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server.
The first process allocates RGW processes corresponding to the request identifiers carried in the user access requests in advance for the plurality of RGW processes.
Illustratively, the first process may be one of a plurality of RGW processes corresponding to the same address range.
In the embodiment of the application, a first process which is pre-allocated to correspond to a request identifier carried in a user access request is searched from a target object storage gateway server through a reverse proxy server in a server cluster.
Step 3042, determining, by the reverse proxy server, that the first process is in an offline state.
The loss of connection state may be understood as that the first process and the target object storage gateway server cannot perform normal communication.
In the embodiment of the application, the target storage gateway server RGW corresponding to the request from the user is requested through the reverse proxy server in the server cluster, and the first process corresponding to the request identifier and the target storage gateway server RGW are determined to be in an offline state.
In other embodiments of the present application, it may also be determined that the first process is in the upgrade state through the reverse proxy server.
In other embodiments of the present application, after determining that the first process is in the offline state through the reverse proxy server, setting the weight of the first process as the first parameter through the reverse proxy server.
The first parameter is used for representing that the first process is in an offline state. Illustratively, the first parameter may be 0, indicating that the first process is in an offline state and cannot process the user access request.
In a load balancing scenario of a server cluster, a weight of a first process in a reverse proxy server apisix in the server cluster may be dynamically modified through a HyperText Transfer Protocol (HTTP), that is, the weight of the first process may be dynamically modified as a first parameter through an HTTP request; thus, the modified weight of the first process can be dynamically validated without restarting the reverse proxy server apisix. In addition, when the first process is in a normal working state, the weight of the first process can still be dynamically modified to be a second parameter through the HTTP request, the second parameter is different from the first parameter, and the second parameter is a positive integer larger than the first parameter. Therefore, when the first process is in the offline state, the weight of the first process is dynamically modified through the HTTP request, service restarting is not needed, other RGW processes cannot be influenced to receive user access requests, a user does not feel, and the performance of a cluster is not influenced.
In other embodiments of the present application, after determining that the first process is in the offline state in step 3042 by the reverse proxy server, the following steps may also be performed,
a transition of the first process from the offline state to the idle state is determined by the reverse proxy server.
Modifying the weight of the first process from the first parameter to a second parameter through a reverse proxy server; and the second parameter is used for representing that the first process is in an idle state.
Step 3043, search the second process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server.
Wherein the second process is different from the first process.
And the second process allocates RGW processes corresponding to the request identifiers carried in the user access request to the plurality of RGW processes in advance.
In an embodiment of the present application, the second process may be one of a plurality of RGW processes corresponding to the same address range. It should be noted that the first process and the second process may be two different RGW processes among a plurality of RGW processes corresponding to the same address range.
In the embodiment of the application, it is determined that the first process is in an offline state, and a second process which is pre-allocated and corresponds to a request identifier carried in a user access request is searched from a target object storage gateway server through a reverse proxy server in a server cluster.
In other embodiments of the present application, the weight of the second process is smaller than the weight of the first process.
Here, the RGW process is weighted high, the greater the number of user access requests it receives. Specifically, a certain request class identifier corresponds to one address range, one address range corresponds to a plurality of RGW processes, and the higher the weight in the RGW processes is, the greater the number of user access requests received by the RGW processes is.
In the embodiment of the application, the weight of the second process corresponding to the request identifier of the user access request is smaller than the weight of the first process corresponding to the request identifier of the user access request, that is, the number of the user access requests received by the second process and corresponding to the request identifier is smaller than the number of the user access requests received by the first process and corresponding to the request identifier.
Step 3044, determining the second process as the target process when the second process is in the idle state.
The idle state may be understood as that the target object storage gateway server RGW does not invoke the second RGW process to process any user access request.
In the embodiment of the application, the reverse proxy server in the server cluster determines that the target object storage gateway server RGW does not invoke the second process to process any user access request, that is, determines that the second process is in an idle state, and determines the second process as the target process.
Step 305, the user access request is sent to the target object storage gateway server through the reverse proxy server.
Step 306, the target process is called by the target object storage gateway server to respond to the user access request.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
The application provides a load balancing method for a server cluster, as shown in fig. 6, the method includes the following steps:
step 401, when a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server.
Step 402, determining the resource utilization rate of each object storage gateway server in all the object storage gateway servers through the reverse proxy server.
Wherein the resource utilization is a ratio of the number of RGW processes in the RGW in the working state to the total number of RGW processes in the RGW.
In the embodiment of the present application, a ratio of the number of RGW processes in a working state of each RGW to the total number of RGW processes in each RGW, that is, a resource utilization rate of each RGW, is determined by apisix, and based on the resource utilization rate of each RGW, the target object storage gateway server RGW may be determined.
In other embodiments of the present application, after determining the resource utilization rate of each RGW in all RGWs by the reverse proxy server in step 402, the following steps can be further performed,
determining a first request rate of a user access request through apisix, obtaining a second request rate threshold and a third request rate threshold of the preset user access request through apisix, and when the first request rate of the user access request is smaller than the second request rate, receiving the user access request forwarded by keepalived by apisix; when the first request rate of the user access request is greater than the second request rate and not greater than the third request rate, the apisix delays to receive the user access request forwarded by the keepalived; and when the first request rate of the user access request is greater than the third request rate, the apisix refuses to receive the user access request forwarded by the keepalived, generates request failure information and outputs the request failure information. Therefore, the rate and the quantity of the user access request traffic injected into the server cluster are controlled through the apisix, and the burst traffic in the server cluster is smoothed.
Step 403, determining one object storage gateway server with the resource utilization rate smaller than the resource utilization rate threshold value in all the object storage gateway servers, and storing the gateway server as the target object.
The resource utilization threshold may be a threshold preset in the RGW based on the historical resource utilization of all RGWs, or a threshold dynamically set in the RGW in real time based on the current resource utilization of all RGWs.
In the embodiment of the application, after the resource utilization rate of each RGW in all the RGWs is determined by the reverse proxy server apisix, whether the RGWs with the resource utilization rates smaller than the resource utilization rate threshold exist in all the RGWs is judged, and when the RGWs with the resource utilization rate smaller than the resource utilization rate threshold exist, one of the RGWs is obtained to serve as a target object storage gateway server RGW. Therefore, the resource utilization rate of the RGW is improved, and meanwhile, the processing efficiency of the user access request is improved.
Step 404, determining a target process on the target object storage gateway server for processing the user access request through the reverse proxy server.
Step 405, sending the user access request to the target object storage gateway server through the reverse proxy server.
Step 406, the target process is invoked by the target object storage gateway server to respond to the user access request.
It should be noted that, for the descriptions of the same steps and the same contents in this embodiment as those in other embodiments, reference may be made to the descriptions in other embodiments, which are not described herein again.
Based on the foregoing embodiment, the present application provides a load balancing apparatus for a server cluster, where the load balancing apparatus for a server cluster may be applied to a load balancing method for a server cluster correspondingly provided in fig. 2, 4 to 6, and as shown in fig. 7, the load balancing apparatus 7 for a server cluster includes:
a first sending unit 701, configured to, when a load balancing server in a server cluster receives user access requests sent by different clients, forward the user access requests to a reverse proxy server through the load balancing server;
a first processing unit 702, configured to determine, by the reverse proxy server, a target object storage gateway server corresponding to the user access request;
a second processing unit 703, configured to determine, by using the reverse proxy server, a target process on the target object storage gateway server for processing the user access request;
a second sending unit 704, configured to send the user access request to the target object storage gateway server through the reverse proxy server;
a third processing unit 705, configured to invoke the target process through the target object storage gateway server to respond to the user access request.
In other embodiments of the present application, the second processing unit 703 is further configured to determine, by using the reverse proxy server, a request identifier carried in the user access request; and searching a target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server.
In other embodiments of the present application, the second processing unit 703 is further configured to search, by the reverse proxy server, a first process corresponding to the request identifier from the target object storage gateway server; determining, by the reverse proxy server, that the first process is in an out-of-contact state; searching a second process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server; wherein the second process is different from the first process; and when the second process is in an idle state, determining that the second process is a target process.
In other embodiments of the present application, the second processing unit 703 is further configured to make the weight of the second process smaller than the weight of the first process.
In other embodiments of the present application, the second processing unit 703 is further configured to set, by the reverse proxy server, a weight of the first process as a first parameter; the first parameter is used for representing that the first process is in an offline state.
In other embodiments of the present application, the second processing unit 703 is further configured to determine, by the reverse proxy server, that the first process is transitioned from the offline state to the idle state; modifying the weight of the first process from the first parameter to a second parameter through a reverse proxy server; and the second parameter is used for representing that the first process is in an idle state.
In other embodiments of the present application, the first processing unit 702 is further configured to determine, by the reverse proxy server, a resource utilization rate of each object storage gateway server in all object storage gateway servers; and determining one object storage gateway server with the resource utilization rate smaller than the resource utilization rate threshold value in all the object storage gateway servers, and taking the object storage gateway server as a target object storage gateway server.
The application provides a load balancing device of a server cluster, wherein when a load balancing server in the server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server; determining a target object storage gateway server corresponding to the user access request through a reverse proxy server; determining a target process used for processing a user access request on a target object storage gateway server through a reverse proxy server; sending a user access request to a target object storage gateway server through a reverse proxy server; calling a target process through a target object storage gateway server to respond to a user access request; in this way, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. Therefore, the problem of user access request circulation is solved, the server cluster is ensured to receive and process the user access request in a balanced manner, and the problem of providing a single point for the outside in the server cluster is solved; in addition, the weight of the process of rgw is controlled by dynamically modifying the routing configuration of the apisix through the HTTP request, and the apisix services do not need to be restarted, so that the data processing efficiency of the server cluster is improved.
Based on the foregoing embodiments, the present application provides an electronic device, where the electronic device may be applied to a load balancing method for a server cluster correspondingly provided in fig. 2 and 4 to 6, and as shown in fig. 8, the electronic device 8 (the electronic device 8 in fig. 8 corresponds to the load balancing apparatus 7 of the server cluster in fig. 7) includes: a memory 81 and a processor 82, wherein; the processor 82 is configured to execute a load balancing program of the server cluster stored in the memory 81, and the electronic device 8 implements the following steps through the processor 82:
when a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server;
determining a target object storage gateway server corresponding to the user access request through a reverse proxy server;
determining a target process used for processing a user access request on a target object storage gateway server through a reverse proxy server;
sending a user access request to a target object storage gateway server through a reverse proxy server;
and calling the target process through the target object storage gateway server to respond to the user access request.
In other embodiments of the present application, the processor 82 is configured to execute a load balancing program of a server cluster stored in the memory 81 to implement the following steps:
determining a request identifier carried by a user access request through a reverse proxy server; and searching a target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server.
In other embodiments of the present application, the processor 82 is configured to execute a load balancing program of a server cluster stored in the memory 81 to implement the following steps:
searching a first process corresponding to the request identifier from a target object storage gateway server through a reverse proxy server; determining, by the reverse proxy server, that the first process is in an out-of-contact state; searching a second RGW process corresponding to the request identifier from the target object storage gateway server through a reverse proxy server; wherein the second process is different from the first process; and when the second process is in an idle state, determining that the second process is a target process.
In other embodiments of the present application, the processor 82 is configured to execute a load balancing program of a server cluster stored in the memory 81 to implement the following steps:
the weight of the second process is less than the weight of the first process.
In other embodiments of the present application, the processor 82 is configured to execute a load balancing program of a server cluster stored in the memory 81 to implement the following steps:
setting the weight of the first process as a first parameter through the reverse proxy server; the first parameter is used for representing that the first process is in an offline state.
In other embodiments of the present application, the processor 82 is configured to execute a load balancing program of a server cluster stored in the memory 81 to implement the following steps:
determining, by the reverse proxy server, that the first process transitioned from the offline state to an idle state; modifying the weight of the first process from the first parameter to a second parameter through the reverse proxy server; and the second parameter is used for representing that the first process is in an idle state.
In other embodiments of the present application, the processor 82 is configured to execute a load balancing program of a server cluster stored in the memory 81 to implement the following steps:
determining the resource utilization rate of each object storage gateway server in all the object storage gateway servers through a reverse proxy server; and determining one object storage gateway server with the resource utilization rate smaller than the resource utilization rate threshold value in all the object storage gateway servers, and taking the object storage gateway server as a target object storage gateway server.
The application provides an electronic device, wherein when a load balancing server in a server cluster receives user access requests sent by different clients, the user access requests are forwarded to a reverse proxy server through the load balancing server; determining a target object storage gateway server corresponding to the user access request through a reverse proxy server; determining a target process used for processing a user access request on a target object storage gateway server through a reverse proxy server; sending a user access request to a target object storage gateway server through a reverse proxy server; calling a target process through a target object storage gateway server to respond to a user access request; in this way, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. Therefore, the problem of user access request circulation is solved, the server cluster is ensured to receive and process the user access request in a balanced manner, and the problem of providing a single point for the outside in the server cluster is solved; in addition, the weight of the process of rgw is controlled by dynamically modifying the routing configuration of the apisix through the HTTP request, and the apisix services do not need to be restarted, so that the data processing efficiency of the server cluster is improved.
The present application provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to perform the steps of:
when a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server;
determining a target object storage gateway server corresponding to the user access request through a reverse proxy server;
determining a target process used for processing a user access request on a target object storage gateway server through a reverse proxy server;
sending a user access request to a target object storage gateway server through a reverse proxy server;
and calling the target process through the target object storage gateway server to respond to the user access request.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
determining a request identifier carried by a user access request through a reverse proxy server; and searching a target process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
searching a first process corresponding to the request identifier from a target object storage gateway server through a reverse proxy server; determining, by a reverse proxy server, that a first process is in an offline state; searching a second process corresponding to the request identifier from the target object storage gateway server through the reverse proxy server; wherein the second process is different from the first process; and when the second process is in an idle state, determining the second process as a target process.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further perform the steps of:
the weight of the second process is less than the weight of the first process.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
setting the weight of the first process as a first parameter through the reverse proxy server; the first parameter is used for representing that the first process is in an offline state.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further perform the steps of:
determining, by the reverse proxy server, that the first process transitioned from the offline state to the idle state; modifying the weight of the first process from the first parameter to a second parameter through a reverse proxy server; and the second parameter is used for representing that the first process is in an idle state.
In other embodiments of the present application, the one or more programs are executable by the one or more processors and further implement the steps of:
determining the resource utilization rate of each object storage gateway server in all the object storage gateway servers through a reverse proxy server; and determining one object storage gateway server with the resource utilization rate smaller than the resource utilization rate threshold value in all the object storage gateway servers, and storing the gateway server as the target object.
The application provides a storage medium, wherein when a load balancing server in a server cluster receives user access requests sent by different clients, the load balancing server forwards the user access requests to a reverse proxy server; determining a target object storage gateway server corresponding to the user access request through a reverse proxy server; determining a target process used for processing a user access request on a target object storage gateway server through a reverse proxy server; sending a user access request to a target object storage gateway server through a reverse proxy server; calling a target process through a target object storage gateway server to respond to a user access request; in this way, based on the load balancing server in the server cluster, the user access request is sent to the reverse proxy server, and the reverse proxy server sends the user access request to the target process corresponding to the user access request. Therefore, the problem of user access request circulation is solved, the server cluster is ensured to receive and process the user access request in a balanced manner, and the problem of providing a single point for the outside in the server cluster is solved; in addition, the weight of the process is controlled rgw by dynamically modifying the routing configuration of the apisix through the HTTP request, and the apisix service does not need to be restarted, so that the data processing efficiency of the server cluster is improved.
The computer storage medium/Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a magnetic Random Access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read-Only Memory (CD-ROM); and may be various terminals such as mobile phones, computers, tablet devices, personal digital assistants, etc., including one or any combination of the above-mentioned memories.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing module, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit may be implemented in the form of hardware, or in the form of hardware plus a software functional unit. Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for load balancing of a server cluster, the method comprising:
when a load balancing server in a server cluster receives user access requests sent by different clients, the user access requests are forwarded to a reverse proxy server through the load balancing server;
determining, by the reverse proxy server, a target object storage gateway server corresponding to the user access request;
determining, by the reverse proxy server, a target process on the target object storage gateway server for processing the user access request;
sending the user access request to the target object storage gateway server through the reverse proxy server;
and calling the target process through the target object storage gateway server to respond to the user access request.
2. The method of claim 1, wherein the determining, by the reverse proxy server, a target process on the target object storage gateway server for processing the user access request comprises:
determining a request identifier carried by the user access request through the reverse proxy server;
and searching the target process corresponding to the request identifier from a target object storage gateway server through the reverse proxy server.
3. The method according to claim 2, wherein the searching, by the reverse proxy server, for the target process corresponding to the request identifier from a target object storage gateway server includes:
searching a first process corresponding to the request identifier from a target object storage gateway server through the reverse proxy server;
determining, by the reverse proxy server, that the first process is in an out-of-contact state;
searching a second process corresponding to the request identifier from a target object storage gateway server through the reverse proxy server; wherein the second process is different from the first process;
and when the second process is in an idle state, determining that the second process is the target process.
4. The method of claim 3, wherein the weight of the second process is less than the weight of the first process.
5. The method of claim 3, wherein after determining that the first process is in the offline state by the reverse proxy server, the method comprises:
setting the weight of a first process as a first parameter through the reverse proxy server; wherein the first parameter is used for characterizing that the first process is in the offline state.
6. The method according to claim 4, wherein after the setting the weight of the first process as the first parameter by the reverse proxy server, the method comprises:
determining, by the reverse proxy server, that the first process transitioned from the offline state to the idle state;
modifying, by the reverse proxy server, a weight of a first process from the first parameter to a second parameter; wherein the second parameter is used for characterizing that the first process is in the idle state.
7. The method for load balancing of server cluster according to any one of claims 1 to 6, wherein the determining, by the reverse proxy server, a target object storage gateway server corresponding to the user access request includes:
determining the resource utilization rate of each object storage gateway server in all the object storage gateway servers through the reverse proxy server;
and determining one object storage gateway server with the resource utilization rate smaller than a resource utilization rate threshold value in all the object storage gateway servers, and storing the gateway server as the target object.
8. An apparatus for load balancing of a server cluster, the apparatus comprising:
the system comprises a first sending unit, a reverse proxy server and a load balancing server, wherein the first sending unit is used for forwarding a user access request to the reverse proxy server through the load balancing server when the load balancing server in a server cluster receives the user access request sent by different clients;
the first processing unit is used for determining a target object storage gateway server corresponding to the user access request through the reverse proxy server;
the second processing unit is used for determining a target process used for processing the user access request on the target object storage gateway server through the reverse proxy server;
a second sending unit, configured to send the user access request to the target object storage gateway server through the reverse proxy server;
and the third processing unit is used for calling the target process through the target object storage gateway server so as to respond to the user access request.
9. An electronic device, characterized in that the electronic device comprises:
a memory for storing executable instructions;
a processor for executing executable instructions stored in the memory to implement the method of load balancing for a cluster of servers of any of claims 1 to 7.
10. A computer storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the method of load balancing for a cluster of servers of any of claims 1 to 7.
CN202110176716.7A 2021-02-07 2021-02-07 Load balancing method, device, equipment and storage medium for server cluster Pending CN114911602A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110176716.7A CN114911602A (en) 2021-02-07 2021-02-07 Load balancing method, device, equipment and storage medium for server cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110176716.7A CN114911602A (en) 2021-02-07 2021-02-07 Load balancing method, device, equipment and storage medium for server cluster

Publications (1)

Publication Number Publication Date
CN114911602A true CN114911602A (en) 2022-08-16

Family

ID=82760744

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110176716.7A Pending CN114911602A (en) 2021-02-07 2021-02-07 Load balancing method, device, equipment and storage medium for server cluster

Country Status (1)

Country Link
CN (1) CN114911602A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800472A (en) * 2020-06-12 2020-10-20 易联众信息技术股份有限公司 Block link point load balancing method, device, medium and equipment
CN115589577A (en) * 2022-12-12 2023-01-10 融合通信技术(天津)有限公司 Communication service access management method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800472A (en) * 2020-06-12 2020-10-20 易联众信息技术股份有限公司 Block link point load balancing method, device, medium and equipment
CN115589577A (en) * 2022-12-12 2023-01-10 融合通信技术(天津)有限公司 Communication service access management method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10528390B2 (en) Idempotent task execution in on-demand network code execution systems
JP7252356B2 (en) MOBILE EDGE COMPUTING NODE SELECTION METHOD, APPARATUS AND SYSTEM AND COMPUTER PROGRAM
US10360067B1 (en) Dynamic function calls in an on-demand network code execution system
US11392422B1 (en) Service-managed containers for container orchestration service
US11422844B1 (en) Client-specified network interface configuration for serverless container management service
US9244817B2 (en) Remote debugging in a cloud computing environment
US8938510B2 (en) On-demand mailbox synchronization and migration system
CN114930295A (en) Serverless call allocation with reserved capacity without throttling scaling
CN113783922A (en) Load balancing method, system and device
CN111857873A (en) Method for realizing cloud native container network
US20130254261A1 (en) System and Method of Managing Servers for Streaming Desktop Applications
JP5000456B2 (en) Resource management system, resource management apparatus and method
US10318347B1 (en) Virtualized tasks in an on-demand network code execution system
CN111352716B (en) Task request method, device and system based on big data and storage medium
US20130325885A1 (en) Provisioning composite applications using a hierarchical data structures
WO2021120633A1 (en) Load balancing method and related device
Huang et al. Converged network-cloud service composition with end-to-end performance guarantee
CN112437006B (en) Request control method and device based on API gateway, electronic equipment and storage medium
US10986065B1 (en) Cell-based distributed service architecture with dynamic cell assignment
US11055108B2 (en) Network booting in a peer-to-peer environment using dynamic magnet links
CN114911602A (en) Load balancing method, device, equipment and storage medium for server cluster
US20230216895A1 (en) Network-based media processing (nbmp) workflow management through 5g framework for live uplink streaming (flus) control
CN112600761A (en) Resource allocation method, device and storage medium
US11616725B1 (en) Hierarchical token buckets
CN112424749A (en) On-demand code execution with limited memory footprint

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination