Service adjustment method, network equipment and storage medium
By obtaining and analyzing the status information of business instances and dynamically adjusting the number of business instances, the problem of manual configuration and adjustment efficiency of traditional load balancing technology is solved, and efficient business adjustment and resource optimization is achieved.
Patent Information
- Application Number
- CN202311636749.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2025-05-30
AI Technical Summary
Traditional load balancing technology requires manual configuration and adjustment, which is low in efficiency and is difficult to respond quickly to changes in business traffic, resulting in inefficient business adjustment.
By obtaining the business status information of each business instance, determining its maximum business carrying capacity and the actual total business volume of the current system, formulating a business instance number adjustment strategy, and dynamically adjusting the number of business instances to optimize resource utilization.
It realizes flexible business adjustment based on the business status information of business instances, improves business adjustment efficiency, optimizes resource utilization, and ensures that the system carries the actual total business volume under the minimum number of business instances.
Smart Images

Figure CN120075143A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and particularly to a service adjustment method, a network device, and a storage medium. Background Art
[0002] In the process of system service processing, load balancing (LB) is a commonly used network device or software technology for distributing network traffic to multiple computing resources in a system, improving the resource utilization rate of the system, and optimizing the system processing performance. Load balancing can be applied to various network applications, such as websites, e-commerce platforms, cloud computing platforms, etc.
[0003] With the continuous increase in network applications and service traffic, load balancing technology is also constantly evolving and improving. Traditional load balancing technologies often require manual configuration and adjustment, with low efficiency, and there is a need to improve the service adjustment efficiency. Summary of the Invention
[0004] This application provides a service adjustment method, a network device, and a storage medium for improving the service adjustment efficiency.
[0005] An embodiment of this application provides a service adjustment method, which includes: obtaining the service status information of each service instance in the current system; determining the maximum service capacity of each service instance and the actual total service volume of the current system according to the service status information of each service instance; determining the number adjustment strategy of the service instances in the current system according to the maximum service capacity of each service instance and the actual total service volume; and performing service adjustment on the current system based on the number adjustment strategy so that the adjusted current system can carry the actual total service volume with the least number of service instances.
[0006] An embodiment of this application provides a network device, including: one or more processors; a memory storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement any one of the service adjustment methods in the embodiments of this application.
[0007] An embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements any one of the service adjustment methods in the embodiments of this application.
[0008] According to the business adjustment method, network device, and storage medium of the embodiments of the present application, by obtaining the business status information of each business instance in the business system, the maximum business load capacity of each business instance and the actual total business volume of the current system are determined, and according to the maximum business load capacity of each business instance and the actual total business volume, the number adjustment strategy of the business instances in the current system is determined, so as to perform business adjustment on the current system based on the number adjustment strategy, so that the adjusted current system bears the actual total business volume through the least number of business instances; according to this method, the maximum business load capacity of each business instance in the current system and the actual total business volume in the current system can be comprehensively considered to perform business adjustment on the current system, realizing flexible adjustment of business according to the business status information of business instances and improving the business adjustment efficiency.
[0009] More descriptions are provided in the accompanying drawings, specific embodiments, and claims regarding the above embodiments and other aspects of the present application and their implementation manners. Description of the Drawings
[0010] Figure 1 The flowchart showing the business adjustment method provided by the embodiments of the present application is shown.
[0011] Figure 2 The flowchart showing the business processing method of the exemplary embodiments of the present application is shown.
[0012] Figure 3 The schematic diagram of the system architecture provided by the embodiments of the present application is shown.
[0013] Figure 4 The processing flow of the business adjustment method provided by another exemplary embodiment of the present application is shown.
[0014] Figure 5 The schematic diagram of the structure of the business adjustment device of the exemplary embodiments of the present application is shown.
[0015] Figure 6 The structure diagram showing the exemplary hardware architecture of the network device capable of implementing the method and device according to the embodiments of the present invention is shown. Detailed Description of the Embodiments
[0016] To make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, without conflict, the embodiments and features in the embodiments of the present application can be combined arbitrarily with each other.
[0017] Load balancing is a commonly used network device or software technology for distributing network traffic to multiple computing resources to achieve better resource utilization and performance optimization. With the continuous increase in network applications and business traffic, load balancing technology is also constantly evolving and improving. The embodiments of this application provide a service adjustment method, a network device, and a storage medium, which can improve the processing efficiency of service adjustment in the system.
[0018] In a first aspect, the embodiments of this application provide a service adjustment method, which can be applied to a network device.
[0019] Figure 1 The flowchart showing the service adjustment method provided by the embodiments of this application is referred to Figure 1 and the service adjustment method may include the following steps.
[0020] S110, obtain the service status information of each service instance in the current system.
[0021] In this step, a service instance may correspond to an execution entity in different service scenarios. For example, in the service architecture of a cluster, the cluster includes multiple servers or physical node devices, and each service instance may correspond to a server or a physical node device; in the service layer where a Central Processing Unit (CPU) application processes services, a service instance may be any one of a CPU, a container, and a process.
[0022] S120, determine the maximum service load capacity of each service instance and the actual total service volume of the current system according to the service status information of each service instance.
[0023] In this step, the service status information is used to indicate the service-related status information of the service instance, including but not limited to at least one of the following: service request volume, actual service volume, service response time, network card device status, service ability status of the service instance, etc.
[0024] Among them, the network card device status is the status of the network interface card, including at least one of information such as connection status and bandwidth utilization rate; the service ability status of the service instance is determined by the own ability of the service instance, and the own ability (also called its own characteristics) of the service instance, for example, may include at least one of the following: the number of CPUs, CPU ability, the number of network cards, network card bandwidth, memory capacity, etc. Among them, the CPU ability may include, for example, information such as CPU working frequency (used to characterize the computing rate) and cache capacity of the CPU.
[0025] In this step, the maximum service capacity of a certain service instance refers to: the maximum amount of services that the service instance can carry with its own capabilities. The maximum service capacity matches the service processing capabilities of the service instance and is independent of the value of the amount of services currently carried by the service instance. The actual total service volume of the current system can be calculated based on the sum of the amounts of services actually carried by each service instance in the current system.
[0026] S130. Determine the number adjustment strategy for the service instances in the current system according to the maximum service capacity and the actual total service volume of each service instance.
[0027] In this step, the number adjustment strategy refers to: increasing the number of service instances in the current system or reducing the number of service instances in the current system.
[0028] S140. Perform service adjustment on the current system based on the number adjustment strategy, so that the adjusted current system can carry the actual total service volume with the least number of service instances.
[0029] In this step, the service adjustment can specifically include adjusting the number of service instances in the current system and migrating the actual services in the current system.
[0030] According to the service adjustment method of the embodiments of the present application, by obtaining the service status information of each service instance in the service system, determine the maximum service capacity of each service instance and the actual total service volume of the current system, and determine the number adjustment strategy for the service instances in the current system according to the maximum service capacity and the actual total service volume of each service instance, so as to perform service adjustment on the current system based on the number adjustment strategy, so that the adjusted current system can carry the actual total service volume with the least number of service instances; according to this method, the maximum service capacity of each service instance in the current system and the actual total service volume in the current system can be comprehensively considered to perform service adjustment on the current system, realizing flexible adjustment of services according to the service status information of service instances and improving the service adjustment efficiency.
[0031] In some embodiments, the step of obtaining the service status information of each service instance in the current system in step S110 may specifically include: collecting the service status information of each service instance in the current system at regular intervals; or receiving the service status information reported by each service instance when it meets the first predetermined condition, and the first predetermined condition includes that the service instance goes online or the service status information corresponding to the service instance changes.
[0032] Exemplarily, the change in service status information includes: any information item of the service status information described in the above embodiments changes, including but not limited to at least one of the following: increase in actual service volume, decrease in actual service volume, increase in service request volume, decrease in service request volume, etc.
[0033] In this embodiment, each service instance can actively report service status information when the service instance goes online or the service status changes, so that the network device applying this service adjustment method can realize dynamic adjustment of the service by collecting the service status information reported by the service instance in real time.
[0034] In some embodiments, after step S110, it may further include: performing service status analysis based on the service status information of each service instance collected, obtaining the service health status corresponding to each service instance, and executing step S120 when the service health status of at least one service instance does not meet the requirements.
[0035] In this embodiment, the health status of the service can be monitored in real time according to the collected service status information, so as to timely discover the bottlenecks and problems of the service and perform dynamic adjustment of the service.
[0036] In the embodiments of the present application, a pre-trained service status analysis model or a third-party monitoring tool can be used to collect and monitor the service status information of each service instance. The third-party monitoring tool includes but is not limited to the monitoring and alerting system Prometheus; or, a custom service status collection tool can also be developed according to specific requirements to meet specific service requirements. The specific implementation manner of information collection can be selected according to actual needs, and the embodiments of the present application do not make specific limitations.
[0037] In the embodiments of the present application, an existing data analysis platform can be used to analyze the collected service status information to obtain a service status analysis result, and the service status analysis result is used to indicate the service health status corresponding to each service instance. The data analysis platform includes but is not limited to the distributed search and analysis engine Elasticsearch, etc.; or, algorithms and models can also be developed according to service characteristics and requirements for service status analysis and problem identification. The specific implementation manner of information collection can be selected according to actual needs, and the embodiments of the present application do not make specific limitations.
[0038] In some embodiments, when performing business status analysis based on the business status information of a business instance, specific business status analysis metrics can be determined according to the type of business carried by the business instance currently. The types of business can include network-intensive businesses and computing-intensive businesses; the analysis metrics corresponding to network-intensive businesses at least include: network card operation metrics; the analysis metrics corresponding to computing-intensive businesses at least include: central processing unit operation metrics. As an example, the network card operation metrics can include but are not limited to at least one of the following: the number of network cards, network card bandwidth, network card device status; the central processing unit operation metrics can include but are not limited to at least one of the following: the number of CPUs, CPU capabilities, CPU operating frequency, cache capacity of the CPU.
[0039] Exemplarily, if the business status analysis result of a certain business instance includes at least one of the following: business instance failure, the actual business volume of the business instance is greater than or equal to the maximum business load capacity of the business instance (indicating excessive load, which may affect processing performance), the actual business volume of the business instance is less than or equal to the minimum business load capacity of the business instance (indicating insufficient load, which may cause resource waste), it indicates that the business health status of the business instance does not meet the requirements.
[0040] In this embodiment, if the business status analysis results of a predetermined number of business instances in the current system indicate that the business health status does not meet the requirements, it means that the current system needs to perform business adjustment. The predetermined number is an integer greater than or equal to 1, and this predetermined number can be an empirical value, and can be specifically customized according to the actual application scenario. The embodiments of the present application do not make specific limitations.
[0041] In some embodiments, step S120 can specifically include the following steps.
[0042] S11, according to the business status information of each business instance, determine the actual business volume of each business instance, and determine the sum of the actual business volumes of each business instance as the actual total business volume of the current system; S12, determine the maximum business load capacity that each business instance can carry with its own capabilities as the maximum business load capacity corresponding to each business instance.
[0043] In this embodiment, the actual total business volume of the current system is the sum of the actual business volumes of multiple business instances in the current system, and the maximum business load capacity of each business instance is determined according to the capabilities (or characteristics) of the corresponding business instance. It provides a data basis for subsequently determining the number adjustment strategy of the business instances in the current system based on the actual total business volume of the current system and the maximum business load capacity of each business instance in the current system.
[0044] In the embodiments of the present application, the number adjustment strategy of business instances involves increasing or decreasing the number of business instances in the current system. Business adjustment of the current system according to the number adjustment strategy can be achieved through scaling technology. Scaling technology, namely elastic scaling technology, is used to automatically adjust computing resources and storage resources according to load changes.
[0045] Exemplarily, in the embodiments of the present application, taking a business instance as a server with processing capabilities, the scaling technology can specifically refer to adapting to fluctuations in business volume by dynamically allocating server, network bandwidth, and storage space resources, so as to save costs as much as possible and improve resource utilization. When the business volume decreases, the system can automatically recycle unnecessary resources to avoid resource waste. When the business volume increases, the system can dynamically allocate more business resources according to business requirements to meet the needs of business growth.
[0046] The following describes the specific processing methods for business adjustment in the embodiments of the present application through specific embodiments.
[0047] In some embodiments, step S130 may specifically include: S31, determining the total business load of the current system according to the maximum business load capacity of each business instance, where the total business load is the sum of the maximum business load capacities of all business instances; S32, when the total business load is greater than the actual total business volume and the sum of the maximum business load capacities of some business instances is greater than or equal to the actual total business volume, determining the number adjustment strategy as: reducing the business instances in the current system; S33, when the total business load is less than the actual total business volume, determining the number adjustment strategy as: increasing the business instances in the current system.
[0048] In the embodiments of the present application, when the number adjustment strategy is to increase the business instances in the current system, the increased business instances can be used to carry the overloaded business volume of the current system. There are no redundant or idle business instances in the current system, that is, only one business instance in the current system is allowed to be underloaded.
[0049] In some scenarios, the actual business volume carried by a business instance during operation increases, the actual business volume is greater than a predetermined proportion of the maximum business load capacity (the business volume that can be carried within the capacity range) of the business instance, or there are instance failures (the carrying capacity will decrease) and / or network card failures (the forwarding capacity will decrease) in the current system. At this time, the total business load of the current system (the sum of the maximum business volumes that all business instances can carry by themselves) can be calculated. If the total business load of the current system is less than the actual total business volume of the current system, business adjustment can be performed by increasing the number of business instances in the current system.
[0050] For example, a business system includes three business instances, namely Business Instance 1, Business Instance 2, and Business Instance 3. The actual business volume of Business Instance 1 accounts for 80% of the maximum business capacity of Business Instance 1. The actual business volume of Business Instance 2 accounts for 50% of the maximum business capacity of Business Instance 2. The actual business volume of Business Instance 3 accounts for 50% of the maximum business capacity of Business Instance 3. The actual business volume of Business Instance 1 increases to 220%. At this time, the total business capacity of the current system (reflecting the business capacity of the current system) is 300%, and the actual total business volume is 220% + 50% + 50% = 320%. At this time, the total business capacity of the current system is less than the actual total business volume, and business instances need to be added to carry the overloaded business volume of the current system (such as an overload of 20%).
[0051] In some scenarios, the actual business volume carried by a business instance during operation decreases, and the actual business volume is less than or equal to a predetermined proportion of the bearable business volume of the business instance. Or, the network card failure is recovered (the bearing capacity will be improved) and / or a new network card is added (the forwarding capacity will be improved). At this time, the total business capacity of the current system (the sum of the maximum business volumes that can be carried by the capabilities of all business instances) can be calculated. If the total business capacity of the current system is greater than the actual total business volume of the current system, and the sum of the maximum business capacities of a part of the business instances (not all business instances) in the current system is greater than or equal to the actual total business volume, that is, only a part of the business is actually required to carry the actual total business volume. Therefore, business adjustment can be carried out by reducing the number of business instances in the current system.
[0052] For example, a business system includes three business instances, namely Business Instance 1, Business Instance 2, and Business Instance 3. If the actual business volume of Business Instance 1 accounts for 20% of the maximum business capacity of Business Instance 1, the actual business volume of Business Instance 2 accounts for 20% of the maximum business capacity of Business Instance 2, and the actual business volume of Business Instance 3 accounts for 20% of the maximum business capacity of Business Instance 3, then the actual total business volume of the current system is 20% + 20% + 20% = 60%, and the total business capacity (reflecting the business capacity of the current system) is 300%. The total business capacity (300%) is greater than the actual total business volume (60%), and the sum of the maximum business capacities of some business instances (such as Business Instance 1) (that is, the maximum business capacity of Business Instance 1 is 100%) is greater than the actual total business volume (60%). Then the quantity adjustment strategy is: reduce the business instances in the current system. For example, in this example, migrate the business corresponding to the actual business volume of Business Instance 2 and Business Instance 3 to Business Instance 1, and then delete Business Instance 2 and Business Instance 3.
[0053] For another example, the actual business volume of service instance 1 accounts for 100% (fully loaded) of the maximum business load capacity of service instance 1, the actual business volume of service instance 2 accounts for 50% of the maximum business load capacity of service instance 2, and the actual business volume of service instance 3 accounts for 50% of the maximum business load capacity of service instance 3. The actual total business volume of the current system is 100% + 50% + 50% = 200%, and the total business load capacity (reflecting the processing capacity of the current system) is 300%. The total business load capacity (300%) is greater than the actual total business volume (200%), and the sum of the maximum business load capacities of some service instances (such as service instance 2 and service instance 3) (the sum of the maximum business load capacities of service instance 2 and service instance 3 is 200%) is equal to the actual total business volume (200%). Then the quantity adjustment strategy is: reduce the service instances of the current system. For example, in this example, service instance 2 and service instance 3 each have 50% free space. The actual business volume of service instance 1 can be migrated to service instance 2 and service instance 3, and then service instance 1 can be deleted.
[0054] For another example, the business system includes 3 service instances, namely service instance 1, service instance 2, and service instance 3. The actual business volume of each of these three service instances respectively accounts for 20% of the maximum business volume that the corresponding service instance can carry, which is lower than the predetermined minimum business load capacity of each service instance (for example, 30%). At this time, the quantity adjustment strategy can be: reduce the service instances of the current system, and based on this quantity adjustment strategy, reschedule the services (first perform service migration and then instance deletion). For example, service instance 1 can be used to carry the actual total business volume of the current system. Specifically, the actual business volumes of service instance 2 and service instance 3 are both migrated to service instance 1 (after migration, the actual business volume of service instance 1 accounts for 60% of the maximum business load capacity of service instance 1), and then service instance 2 and service instance 3 can be deleted.
[0055] In the embodiments of the present application, the quantity adjustment strategy (increase or decrease service instances in the current system) of the service instances of the current system can be determined according to the maximum business load capacity of each service instance and the actual total business volume of the current system, and the services of the current system can be adjusted based on this quantity adjustment strategy to achieve the load balancing of the system based on the above-mentioned scaling mechanism.
[0056] In some embodiments, when the quantity adjustment strategy is to increase the service instances of the current system, step S140 may specifically include: determining the overloaded business volume of the current system; adding service instances in the current system according to the overloaded business volume, and the sum of the maximum business load capacities of the newly added service instances is greater than the overloaded business volume; migrating the services corresponding to the overloaded business volume to the newly added service instances.
[0057] In some embodiments, when the quantity adjustment strategy is to reduce the service instances of the current system, step S140 may specifically include: obtaining a first part of service instances and a second part of service instances from all the service instances of the current system, where the service volume that the current remaining resources of the first part of service instances can carry is greater than or equal to the actual service volume of the second part of service instances in the current system, and all service instances are composed of the first part of service instances and the second part of service instances; migrating the current processing services of the second part of service instances to the first part of service instances; and after the migration is completed, deleting the second part of service instances.
[0058] For example, if the actual service volumes of service instance 2 and service instance 3 are migrated to service instance 1, then service instance 2 and service instance 3 will be idle. At this time, the current system can be scaled down, that is, service instance 2 and service instance 3 are deleted from the current system. That is to say, the service migration is performed first and then the reduction of the number of service instances is performed to improve resource utilization.
[0059] In some embodiments, the step of deleting the second part of service instances includes: deleting the second part of service instances when the second part of service instances meets the allowable deletion conditions, where the deletion conditions include: the current actual service volume of the second part of service instances is zero, and the status of the second part of service instances is normal operation.
[0060] Among them, the deletion conditions are used to indicate the conditions for allowing the deletion of service instances. For example, it may be at least one of the following: the current service volume of the service instance is zero, the current service volume of the service instance is zero and it is in normal operation. The normal operation of the service instance can ensure the non-fault state of the service and can also ensure that the service instance can receive the actual offline instruction.
[0061] In some embodiments, if the second part of service instances does not meet the allowable deletion conditions, the operation of deleting the second part of service instances can be paused first. When the second part of service instances meets the allowable deletion conditions again, the operation of deleting the second part of service instances is restarted; or, when the second part of service instances meets the allowable deletion conditions again, considering that the service status information of each service instance may have been updated, in order to improve the accuracy of the service adjustment method, the above service adjustment method of steps S110 - S140 can be re-executed.
[0062] In some embodiments, the step of obtaining the first part of service instances and the second part of service instances from all service instances of the current system may specifically include: dividing all service instances of the current system into the first part of service instances and the second part of service instances according to the quantization index of the processing capacity of each service instance, where the quantization index value of the processing capacity of the first part of service instances is greater than that of the second part of service instances, and the first part of service instances and the second part of service instances have the same processing capacity quantization index; the sum of the maximum service bearing capacities of the first part of service instances is greater than the actual total service volume.
[0063] In this embodiment, all service instances in the current system can be divided into the first part of service instances and the second part of service instances according to the quantization index of the processing capacity. The processing capacity of the first part of service instances is higher than that of the second part of service instances, and the sum of the maximum service bearing capacities of the first part of service instances is greater than the actual total service volume (including both: the sum of the actual service volumes of the first part of service instances and the sum of the actual service volumes of the second part of service instances), that is, the actual total service volume of the service system can be borne by the first part of service instances, and there are no redundant or idle service instances in the current system, that is, only one service instance in the current system is allowed to be not fully loaded.
[0064] According to the service adjustment method of the embodiments of the present application, the maximum service bearing capacity of each service instance in the obtained service system and the actual total service volume of the current system can be determined through the service status information of each service instance, and the number adjustment strategy of the service instances in the current system can be determined according to the maximum service bearing capacity and the actual total service volume of each service instance, so as to perform service adjustment on the current system based on the number adjustment strategy, so that the adjusted current system bears the actual total service volume through the least number of service instances; according to this method, the maximum service bearing capacity of each service instance in the current system and the actual total service volume in the current system can be comprehensively considered to perform service adjustment on the current system, realizing flexible adjustment of services according to the service status information of service instances, thereby performing dynamic service adjustment based on load balancing and global resources to achieve dynamic scaling and adjustment of services and improve service adjustment efficiency.
[0065] Figure 2 The flowchart of the service processing method showing an exemplary embodiment of the present application is as follows. As Figure 2 shown, in some embodiments, the service processing method includes the following steps.
[0066] S201, as Figure 2 shown in "Status Collection" in, collect service status information of service instances in the service system.
[0067] S202, as Figure 2As shown in "Status Analysis" in, business status analysis is performed based on the business status information of each collected business instance to obtain the business health status corresponding to each business instance.
[0068] In this step, when the business health status of at least one business instance does not meet the requirements, the following steps are executed (refer to steps S120 and S130 in the above Figure 1 ): According to the business status information of each business instance, determine the maximum business load capacity of each business instance and the actual total business volume of the current system, and determine the number adjustment strategy for the business instances in the current system based on the maximum business load capacity and the actual total business volume of each business instance. The number adjustment strategy includes increasing or decreasing the business instances in the current system.
[0069] S203, as Figure 2 shown in "Instance Addition?" in, determine whether it is necessary to increase the business instances in the current system; if so, execute step S204, if not, execute step S206.
[0070] S204, as Figure 2 shown in "Add Instance" in, determine the overloaded business volume of the current system, and add business instances to the business system according to the overloaded business volume. The sum of the maximum business load capacities of the newly added business instances is greater than the overloaded business volume, and the number of underloaded business instances in the current system does not exceed 1.
[0071] S205, as Figure 2 shown in "Business Migration" in, migrate the business corresponding to the overloaded business volume in the business system to the newly added business instances, and end the process.
[0072] S206, as Figure 2 shown in "Instance Reduction?" in, determine whether it is necessary to reduce the business instances in the current system; if so, execute step S207, if not, end the process.
[0073] S207, as Figure 2 shown in "Business Migration" in, migrate the current processing business of the second part of the business instances to the first part of the business instances; among them, the business volume that the current remaining resources of the first part of the business instances can bear is greater than or equal to the actual business volume of the second part of the business instances in the current system, and all the business instances in the current system are composed of the first part of the business instances and the second part of the business instances.
[0074] S208, as Figure 2 shown in "Reduce Instance" in, delete the second part of the business instances.
[0075] In the embodiments of the present application, according to the service status information of the collected service instances and in combination with the load balancing adjustment strategy, if the resource carrying capacity of the current system (the computing resources, network resources, etc. that all service instances in the current system can provide) cannot meet the resource requirements of the actual total service volume in the service system, then instances need to be added; if the resource carrying capacity of the current system (the computing resources, network resources, etc. that all service instances in the current system can provide) can meet the resource requirements of the actual total service volume in the service system, then further processing can be performed to make the current system achieve the optimal global resource utilization. The optimal global resource utilization means that the sum of the maximum service carrying capacities of the first part of service instances is greater than the actual total service volume of the current system, and the number of underloaded service instances in the current system does not exceed 1, so as to achieve the load balancing of the current system based on elastic scaling.
[0076] The following combines Figure 3 and Figure 4 to describe the processing flow of the service adjustment method in another exemplary embodiment of the present application. Figure 3 is the schematic diagram of the system architecture provided for the embodiments of the present application, Figure 4 is the processing flow of the service adjustment method provided for another exemplary embodiment of the present application. As shown in Figure 3 , in some embodiments, the architecture includes: a service status collection module 301, a service status analysis module 302, a load balancing module 303, and a scaling execution module 304.
[0077] Among them, the service status collection module 301 is used to periodically collect various service status information of multiple service instances in the service system according to the service configuration in the load balancing module 303. As an example, the multiple service instances include but are not limited to Figure 3 the service instance 1, service instance 2, and service instance 3 shown in
[0078] The service status analysis module 302 is used to determine the maximum service carrying capacity of each service instance and the actual total service volume of the current system according to the service status information of each service instance, and determine the number adjustment strategy of the service instances in the current system according to the maximum service carrying capacity and the actual total service volume of each service instance.
[0079] The load balancing module 303 is used to perform service adjustment on the current system based on the number adjustment strategy, so that the adjusted current system can carry the actual total service volume with the least number of service instances.
[0080] The scaling execution module 304 is used to increase or decrease the service instances of the current system to implement the elastic scaling management of the service instances.
[0081] In an embodiment of the present application, the load balancing module 303 may be implemented through the load balancing service of a cloud service provider. The cloud service provider may provide a load balancing service, and its provided load balancing function may be used to optimize global resources. The load balancing module 303 may also be implemented by a developer who develops a load balancing algorithm in advance according to specific business requirements, so as to balance and optimize global resources.
[0082] In some embodiments, as Figure 4 shown, the service adjustment method includes the following steps.
[0083] S401. The service instance 3 reports service status information.
[0084] In this step, when the service instance 3 goes online or the service status information corresponding to the service instance changes, the service instance 3 actively reports the service status information to the service status collection module 301.
[0085] S402. The service status collection module 301 collects service status information.
[0086] In this step, the service status collection module 301 may collect the service status information of multiple service instances and report it to the service status analysis device 302, and send the collected service status information to the service status analysis module 302 for service status analysis to obtain a service status analysis result, a service scaling decision.
[0087] S403. The service status analysis module 302 changes or adjusts the service instance according to it.
[0088] In this step, the service status analysis module 302 may determine the maximum service load capacity of each service instance and the actual total service volume of the current system according to the service status information of each service instance, and determine the number adjustment strategy of the service instances in the current system according to the maximum service load capacity and the actual total service volume of each service instance. For the specific processing steps, refer to the description of the above embodiments and will not be elaborated here.
[0089] S404. The service status analysis module 302 sends the generated service instance adjustment notice and configuration change information to the load balancing module 303.
[0090] Exemplarily, the configuration change information is the configuration information for different services in the load balancing system, and may include, for example, routing rules, load balancing policies, etc.
[0091] S405. The load balancing module 303 adjusts the service instance 3.
[0092] For example: The service adjustment includes the scheduling (increase or decrease) of the number of service instances and service migration.
[0093] S406, the load balancing module 303 sends a feedback message to the service status analysis module 302, and the feedback message is used to indicate that the service migration is completed.
[0094] S407, send a service instance adjustment notice to the scaling execution module 304.
[0095] S408, the scaling execution module 304 executes adding or deleting a service instance.
[0096] Exemplarily, when it is necessary to delete the service instance 3, an instance deletion instruction can be sent to the service instance 3, and the service instance 3 performs instance offline processing according to the received instance deletion instruction.
[0097] The service adjustment method of the embodiments of the present application can be applied to various service scenarios that require dynamic load adjustment, and the application scenarios are wide. In this method, by analyzing service status information, the health status of services can be monitored in real time, bottlenecks and problems of services can be discovered in time. When the system resource carrying capacity meets the global services (applications) in the system, the dynamic scaling of services can be realized by readjusting the load balancing strategy of services; when the system resource carrying capacity cannot meet the global services in the current system, the service adjustment of the current system can be realized by combining the overall adjustment strategies of dynamic scaling and load balancing. According to this method, the utilization efficiency of global resources can be improved, and the application performance can be optimized, which has important application value.
[0098] In a second aspect, the embodiments of the present application provide a service adjustment device. Figure 5 The structural schematic diagram of the service adjustment device of the embodiments of the present application is shown. Refer to Figure 5 , the service adjustment device 500 provided by the embodiments of the present application includes:
[0099] An acquisition module 510, configured to acquire the service status information of each service instance in the current system;
[0100] A first determination module 520, configured to determine the maximum service carrying capacity of each service instance and the actual total service volume of the current system according to the service status information of each service instance;
[0101] A second determination module 530, determines the number adjustment strategy of the service instances in the current system according to the maximum service carrying capacity and the actual total service volume of each service instance;
[0102] An adjustment module 540, configured to perform service adjustment on the current system based on the number adjustment strategy, so that the adjusted current system carries the actual total service volume with the least number of service instances.
[0103] In some embodiments, the obtaining module 510 may specifically include: collecting the service status information of each service instance in the current system at each predetermined period; or, receiving the service status information reported by each service instance when a first predetermined condition is met, where the first predetermined condition includes that the service instance goes online or the service status information corresponding to the service instance changes.
[0104] In some embodiments, the first determining module 520 is specifically configured to: determine the actual service volume of each service instance according to the service status information of each service instance, and determine the sum of the actual service volumes of each service instance as the actual total service volume of the current system; determine the maximum service capacity that can be borne by the own capacity of each service instance as the maximum service capacity corresponding to each service instance.
[0105] In some embodiments, the second determining module 530 is specifically configured to: determine the total service capacity of the current system according to the maximum service capacity of each service instance, where the total service capacity is the sum of the maximum service capacities of all service instances; when the total service capacity is greater than the actual total service volume and the sum of the maximum service capacities of some service instances is greater than or equal to the actual total service volume, determine the quantity adjustment strategy as: reducing the service instances in the current system; when the total service capacity is less than the actual total service volume, determine the quantity adjustment strategy as: increasing the service instances in the current system.
[0106] In some embodiments, the adjustment module 540 is specifically configured to: when the quantity adjustment strategy is to increase the service instances in the current system, determine the overloaded service volume in the current system; add service instances in the current system according to the overloaded service volume, where the sum of the maximum service capacities of the newly added service instances is greater than the overloaded service volume; migrate the services corresponding to the overloaded service volume to the newly added service instances.
[0107] In some embodiments, the adjustment module 540 is specifically configured to: when the quantity adjustment strategy is to reduce the service instances in the current system, obtain a first part of service instances and a second part of service instances from all service instances in the current system, where the service volume that can be borne by the current remaining resources of the first part of service instances is greater than or equal to the actual service volume of the second part of service instances in the current system, and all service instances are composed of the first part of service instances and the second part of service instances; migrate the current processing services of the second part of service instances to the first part of service instances; after the migration is completed, delete the second part of service instances.
[0108] In some embodiments, when the adjustment module 540 is used to delete the second part of service instances, it is specifically configured to: when the second part of service instances meets the condition allowing deletion, delete the second part of service instances, where the deletion condition includes: the current actual service volume of the second part of service instances is zero, and the status of the second part of service instances is normal operation.
[0109] In some embodiments, when the adjustment module 540 is used to obtain the first part of service instances and the second part of service instances from all service instances of the current system, it is specifically configured to: divide all service instances of the current system into the first part of service instances and the second part of service instances according to the quantitative index of the processing capacity of each service instance, where the quantitative index value of the processing capacity of the first part of service instances is greater than that of the second part of service instances, and the first part of service instances and the second part of service instances have the same quantitative index of processing capacity; the sum of the maximum service carrying capacities of the first part of service instances is greater than the actual total service volume.
[0110] According to the service adjustment device of the embodiments of the present application, it can determine the maximum service carrying capacity of each service instance in the service system and the actual total service volume of the current system through the obtained service status information of each service instance, and determine the number adjustment strategy of the service instances in the current system according to the maximum service carrying capacity and the actual total service volume of each service instance, so as to perform service adjustment on the current system based on the number adjustment strategy, so that the adjusted current system can carry the actual total service volume with the least number of service instances; according to this method, it is possible to comprehensively consider the maximum service carrying capacity of each service instance in the current system and the actual total service volume in the current system to perform service adjustment on the current system, realize flexible adjustment of services according to the service status information of service instances, and improve service adjustment efficiency.
[0111] It should be clear that the present invention is not limited to the specific configurations and processes described in the above embodiments and shown in the figures. For the convenience and brevity of description, the detailed description of known methods is omitted here, and the specific working processes of the systems, modules, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be repeated here.
[0112] In a third aspect, embodiments of the present application further provide a network device.
[0113] Refer to Figure 6 , the network device includes: at least one processor 601; at least one memory 602, and one or more I / O interfaces 603; wherein, the memory 602 stores one or more computer programs executable by at least one processor 601, and the one or more computer programs are executed by at least one processor 601 so that at least one processor 601 can execute the above service adjustment method.
[0114] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor / processing core, the above-mentioned service adjustment method is implemented. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0115] Those of ordinary skill in the art can understand that all or some of the steps, systems, and functional modules / units in the devices disclosed above can be implemented as software, firmware, hardware, and their appropriate combinations.
[0116] In the hardware implementation, the division between the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be executed by several physical components in cooperation.
[0117] Some or all physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH), or other disk memories; compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical disc memories; magnetic cartridges, tapes, disk storage, or other magnetic memories; and any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium typically contains computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0118] The present application has disclosed exemplary embodiments, and although specific terms are employed, they are used only and should be interpreted only as general illustrative meanings and not for the purpose of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly specified, features, characteristics, and / or elements described in connection with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in connection with other embodiments. Accordingly, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of the present application as set forth by the appended claims.
Claims
1. A service adjustment method, wherein, the method includes: Obtain the service status information of each service instance in the current system; Determine the maximum service capacity of each service instance and the actual total service volume of the current system according to the service status information of each service instance; Determine the quantity adjustment strategy of the service instances in the current system according to the maximum service capacity of each service instance and the actual total service volume; Perform service adjustment on the current system based on the quantity adjustment strategy, so that the adjusted current system can carry the actual total service volume with the least number of service instances.
2. The method according to claim 1, wherein, the obtaining the service status information of each service instance in the current system includes: Collect the service status information of each service instance in the current system at regular intervals; Or, Receive the service status information reported by each service instance when it meets the first predetermined condition, and the first predetermined condition includes that the service instance goes online or the service status information corresponding to the service instance changes.
3. The method according to claim 1, wherein, the determining the maximum service capacity of each service instance and the actual total service volume of the current system according to the service status information of each service instance includes: Determine the actual service volume of each service instance according to the service status information of each service instance, and determine the sum of the actual service volumes of each service instance as the actual total service volume of the current system; Determine the maximum service volume that each service instance can carry by its own capacity as the maximum service capacity corresponding to each service instance.
4. The method according to claim 1, wherein, the determining the quantity adjustment strategy of the service instances in the current system according to the maximum service capacity of each service instance and the actual total service volume includes: Determine the total service capacity of the current system according to the maximum service capacity of each service instance, and the total service capacity is the sum of the maximum service capacities of all service instances; When the total service capacity is greater than the actual total service volume, and the sum of the maximum service capacities of some service instances is greater than or equal to the actual total service volume, determine the quantity adjustment strategy as: reduce the service instances in the current system; When the total service capacity is less than the actual total service volume, determine the quantity adjustment strategy as: increase the service instances in the current system.
5. The method according to claim 4, wherein, when the quantity adjustment strategy is to increase the service instances in the current system, the performing service adjustment on the current system based on the quantity adjustment strategy includes: Determine the overloaded service volume of the current system; Add service instances in the current system according to the overloaded service volume, and the sum of the maximum service capacities of the newly added service instances is greater than the overloaded service volume; Migrate the services corresponding to the overloaded service volume to the newly added service instances.
6. The method according to claim 4, wherein, When the quantity adjustment strategy is to reduce the service instances of the current system, the service adjustment of the current system based on the quantity adjustment strategy includes: Obtain a first part of service instances and a second part of service instances from all the service instances of the current system, where the service volume that the current remaining resources of the first part of service instances can carry is greater than or equal to the actual service volume of the second part of service instances in the current system, and all the service instances are composed of the first part of service instances and the second part of service instances; Migrate the currently processed services of the second part of service instances to the first part of service instances; After the migration is completed, delete the second part of service instances.
7. The method according to claim 6, wherein, the deleting of the second part of service instances includes: When the second part of service instances meets the condition allowing deletion, delete the second part of service instances, where the deletion condition includes: the current actual service volume of the second part of service instances is zero, and the status of the second part of service instances is normal operation.
8. The method according to claim 6, wherein, the obtaining of the first part of service instances and the second part of service instances from all the service instances of the current system includes: According to the quantization index of the processing capacity of each service instance, divide all the service instances of the current system into a first part of service instances and a second part of service instances, where the quantization index value of the processing capacity of the first part of service instances is greater than the quantization index value of the processing capacity of the second part of instances, the first part of service instances and the second part of service instances have the same quantization index of processing capacity; the sum of the maximum service carrying capacities of the first part of service instances is greater than the actual total service volume.
9. A network device, including: One or more processors; A memory, on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the service adjustment method according to any one of claims 1-8.
10. A storage medium, wherein, the storage medium stores a computer program, and when the computer program is executed by a processor, it implements the service adjustment method according to any one of claims 1-8.