Detailed Description
In order to better understand the technical solutions, the technical solutions of the embodiments of the present specification are described in detail below with reference to the drawings and specific embodiments, and it should be understood that the specific features of the embodiments and embodiments of the present specification are detailed descriptions of the technical solutions of the embodiments of the present specification, and are not limitations of the technical solutions of the present specification, and the technical features of the embodiments and embodiments of the present specification may be combined with each other without conflict.
Please refer to fig. 1, which is a schematic view of an application scenario of the network service management method according to the embodiment of the present specification. The terminal is located at the user side 100 and communicates with the network side 200. The network service client 101 in the terminal may be an APP or a website for implementing network services (services) based on the internet, provides an interface for a user to query (e.g., search engine, etc.), trade (e.g., online shopping, finance, etc.), etc., and provides service request data provided by the user to the network side for processing; the network side includes a network service providing system 201 and a network service management system 202. Wherein: the network service providing system 201 is used for communicating with the network service client 101, receiving service request data such as query or transaction of the network service client 101, and feeding back service response data to the network service client 101 after processing; the network service management system 202 is configured to maintain and manage the operation of the network service providing system 201 according to a load condition of the network service providing system 201.
In a first aspect, an embodiment of the present specification provides a network service management method, which is used for determining a processing policy and adjusting resources for a network service providing system that provides a network service. Referring to FIG. 2, S201-S203 are included.
S201: and acquiring current index data of the network service providing system.
The indexes of the embodiment of the specification can include a system performance index and a service effect index. The system performance index includes, for example, processor utilization (cpu), memory utilization (Mem), Disk transfer rate (Disk), Network utilization (Network), and the like. The service effectiveness indicators include, for example, query rate per second (qps), number of concurrencies, response time (rt), and the like. The system performance index data can be obtained by inquiring a system file to obtain relevant information and calculating; the service effect index data can be obtained by monitoring the service processing condition in real time and calculating.
For example, processor usage may extract four data from the system directory/proc/stat: user mode (user), low priority user mode (nic), kernel mode (system), and idle processor time (idle); the processor usage is then calculated using the following formula:
CPU utilization is 100 × (user + nice + system)/(user + nice + system + idle).
For another example, the memory usage rate may extract two data from the system directory/proc/meminfo file: current memory usage (cmem) and total memory amount (amem). The memory usage is then calculated using the following formula:
the memory usage rate is 100 (cmem/umem).
The other index data are obtained in a similar manner and are not described in detail.
S202: and determining the current load level of the network service providing system according to the index data.
After obtaining the index data, comparing the index data with the corresponding index threshold value to determine the score (water level) of each index, then integrating the score of each index to calculate the load score, and finally determining the current load grade of the network service providing system.
In an alternative implementation, the step of determining the current load level of the network service providing system according to the index data includes:
(1) setting index threshold values for various indexes of a network service providing system;
(2) comparing the current index data of the network service providing system with corresponding index thresholds respectively to obtain the scores of the indexes;
(3) calculating load scores according to the scores of the indexes;
(4) and determining the load grade according to the load score.
The implementation process of the step (4) may include:
(4.1) setting a lowest load threshold and a highest load threshold;
and (4.2) comparing the load score with a lowest load threshold value and a highest load threshold value respectively to determine that the load grade is a lowest grade, a middle grade or a highest grade.
One specific implementation example of calculating the load score according to the scores of the indexes to finally determine the load grade is as follows: assuming that indexes referred by the current system comprise four items of cpu, mem, qps and rt, setting an index threshold value for each item; assuming that when the cpu exceeds the cpu threshold (for example, the cpu threshold is 60%), the cpu is considered as a consideration index item, and scores the cpu item (the specific score can be determined according to the size of the cpu data and the threshold, for example, the score is higher when the cpu exceeds the threshold too much); assuming that the other three terms are within the safe threshold, they are all noted as 0 without regard. When calculating the load scores according to the index scores, weights may be assigned to different index items in advance (or not set), and then the load scores are obtained by comprehensive calculation (for example, weighted average). And finally, respectively comparing the load score with a preset lowest load threshold and a preset highest load threshold, and determining the interval where the current load score is located, so as to determine the current load grade. For example, when the load score is below a minimum load threshold, determining the load level as the lowest level; when the load score is higher than the highest load threshold value, determining that the load grade is the highest grade; when the load score is between the lowest load threshold and the highest load threshold, the load level is determined to be an intermediate level.
S203: and adjusting the strategy proportion of the optimal effect strategy, the performance effect balancing strategy and the optimal performance strategy according to the current load level of the network service providing system, so that the service flow is processed according to the configuration of the strategy proportion.
In an alternative implementation, different processing strategies may be determined by setting up different code execution logic. Wherein the best effort strategy corresponds to code execution logic with priority on computational accuracy, and the best performance strategy corresponds to code execution logic with priority on computational speed. Wherein: the best effect can be understood as good business effect, for example, the calculation is more accurate; by optimal performance is understood a high processing performance, e.g. a higher processing speed (shorter response time). Taking a search engine service system as an example, the more complex the ranking algorithm is, the better the ranking effect is, but the longer the processing time is, the better the processing strategy is, and the performance is poor; conversely, the simpler the ranking algorithm, the worse the effect, but the shorter the time consumption, the worse the effect, and the better the performance.
For example: and if the current load level is the highest level, reducing the proportion of the best effect strategy and/or increasing the performance effect balancing strategy and the best performance strategy. When the load level is the highest level, which indicates that the processing pressure of the current system is large (such as the case of a double 11-flow blowout), only the processing performance can be sacrificed or the business effect can be improved to solve the problem. The same principle is that: if the current load level is the lowest level, the proportion of the performance optimization strategy can be reduced, and/or the proportion of the performance effect balancing strategy and the effect optimization strategy can be increased. When the load level is lower, indicating that the processing pressure of the current system has passed (e.g. double 11 has passed), the best effect in the default state can be ensured by increasing the ratio of the best effect strategy.
What is meant by "having traffic flow processed in accordance with the policy-scaled configuration" is: determining the number of requests processed by each strategy according to the strategy proportion aiming at service requests in a period of time; that is, the service request in a period of time is processed by allocating corresponding strategies according to the strategy proportion.
In a specific application, different processing strategies and configuration of service processing according to a strategy proportion can be respectively realized through different strategy buckets. For example, the effect bucket, the balance bucket and the performance bucket are set to correspond to the strategy of the best effect strategy, the strategy of the balance performance strategy and the strategy of the best performance strategy respectively. Assuming that the ratio of the effect bucket, the balance bucket and the performance bucket is 1:2:7 when the traffic is in a peak, in the process of traffic processing, the traffic flow is controlled to be processed according to the ratio, that is, for example, 10000 traffic requests in a period of time, 1000 traffic requests are processed according to the effect optimal strategy of the effect bucket, 2000 traffic requests are processed according to the performance effect balance strategy of the balance bucket, and 7000 traffic requests are processed according to the performance optimal strategy of the performance bucket.
Therefore, the proportion of the processing strategy of the system is adjusted after the load grade is determined according to the index data, so that the system strategy can be managed in a grading mode. For example, the effect of degradation is achieved by increasing the proportion of the best performance policy at peak traffic, and the order of policy degradation is: an optimal effect strategy- > an effect performance balancing strategy- > an optimal performance strategy; when the flow is low peak, the upgrading effect is achieved by improving the proportion of the best strategy of the effect, and the strategy upgrading sequence is as follows: the optimal performance strategy- > the balanced effect and performance strategy- > the optimal effect strategy.
Besides policy upgrading and downgrading adjustment, adjustment (capacity expansion and capacity reduction) of system resource allocation can be performed according to load levels, and especially capacity expansion is performed at the time of a traffic peak. Therefore, in an alternative implementation, after determining the current load level of the network service providing system, the method further includes S204: and adjusting system resources for the network service providing system according to the current load level of the network service providing system. Step S204 may be performed simultaneously or in time-sharing with step S203. For example, if the current load level is the highest level, the system resources are increased through capacity expansion operation. For example, by a capacity expansion operation (such as increasing deployment machine resources) when traffic peaks arrive. Similarly, if the current load level is the lowest level, the system resources can be reduced through capacity reduction operation (machine resource reduction).
An example of the network service management method provided by the embodiment of the present disclosure is exemplarily described below in a manner that a search engine system is used as a specific example of the network service providing system and different processing policies are implemented by policy buckets.
Referring to fig. 3, a schematic diagram of an example of a network service management method provided in the embodiments of the present specification is shown.
The components in fig. 3 are described as follows:
1. search engine services: the system is an online service system of a search engine, and in the embodiment of the specification, the system is taken as a system object which is demoted and expanded and reduced.
Wherein "downgrade" is a visual expression that is implemented by configuring the allocation ratio between different processing strategies as previously described. By downgrading is understood to be reducing or diminishing part of the service capacity to make the primary function available. For example, the system originally supported function A, B, C, where a is the primary function, when performance bottlenecks occur, to guarantee a's service, degrade the service, B and C capabilities are no longer provided, a is still applicable. Or from a to a (a weaker function than a), basic services can be provided despite the reduced capabilities.
"Capacity expansion and capacity reduction" refers to the increase and decrease of resources. For example, 10 original machines of the module A are expanded to 15 machines and contracted to 5 machines.
2. Bucket 0, bucket 1, bucket 2: the processing strategies with different service capabilities are formulated according to the performance and effect indexes. For example, bucket 0 (effect bucket), bucket 1 (balance bucket), and bucket 2 (performance bucket) correspond to the policies of the best effect policy, the performance effect balance policy, and the best performance policy, respectively.
3. Searching an access layer: is a traffic inlet, and can introduce traffic into different policy buckets according to different processing policy configuration proportions.
4. BTS (experimental system) can intelligently control which strategy bucket the current flow falls into according to the configuration and metrics system indexes.
The BTS intelligent control method is, for example:
(1) the current system load level (water level) is obtained.
And reading system indexes such as cpu, mem and disk of the current system and service indexes such as qps and rt from the amytor server. For example, the cpu usage rate is 45%, the mem usage rate is 15GB, latency 20ms, and the like.
(2) And judging whether the current system load water level is too high.
For example, if the cpu water level is set to be too high when exceeding 60%, the degradation operation is triggered when the current cpu water level exceeds 60%, the effect is sacrificed, and the performance is improved and the water level is reduced.
(3) A degradation process is performed.
And modifying the degradation strategy through the interface to enable the degradation strategy to take effect.
5. Amonitor server: system indexes of the search engine service system, such as cpu, qps and rt, can be collected, so that the current load capacity of the system can be perceived.
6. A Hippo (scheduling system) may perform capacity expansion and capacity reduction operations on an application, for example, operations including installation, deployment, drainage, and the like.
7. Intelligent capacity expansion and capacity reduction: the current capacity condition is judged by obtaining the metrics (indexes) of a search engine service system from the amonitor server, and then an instruction is sent to the hippo through decision, so that the capacity expansion and the capacity reduction of the system are completed.
The following describes an implementation of the system downgrading and expanding at a peak flow rate in the example of fig. 3.
Intelligent degradation:
to achieve the best performance and effect, the degradation to the policy bucket is supported as previously introduced (bucket 0: best effect policy, bucket 1: performance effect balancing policy, bucket 2: best performance policy). The search engine service system reports state information to the Amonitor server in a second level, the intelligent bucket selection strategy can read current system index data and service index data from the Amonitor server, the current system load level is determined, and a proper strategy bucket is selected according to the load level. For example: when the traffic peak comes and the load grade of the search engine service exceeds the highest threshold, the proportion of the best effect strategy (bucket 0) is automatically reduced to improve the performance and ensure the availability of the system; if the flow peak period is over, the proportion of the optimal effect strategy (bucket 2) can be automatically improved, and the optimal business effect is guaranteed.
(II) Intelligent capacity expansion
In order to support flow in expectation and flow out of expectation and optimize machine distribution, an intelligent capacity expansion and reduction module reads index data of a search engine service system from an Amonitor server, determines the current load level, dynamically adjusts each machine resource of the search engine service through Hippo, performs a series of operations such as deployment or unloading and the like to achieve the aim of dynamic capacity expansion and reduction, can ensure minute-level real-time optimization of on-line resources and support flow peak, can also globally and optimally utilize machine resources, and simultaneously realizes unmanned value conservation and labor cost saving.
As can be seen, in the network service management method provided in the embodiments of the present specification, after the load level is determined according to the index data, the proportions of various processing policies of the network service providing system are adjusted according to the load level, for example, the system policy can be degraded when the traffic is in a peak, so as to ensure normal operation of the system when the burst traffic comes. In addition, the capacity expansion and the capacity reduction of the system can be realized by adjusting the system resources.
In a second aspect, based on the same inventive concept, an embodiment of the present specification provides a network service management apparatus, for determining a processing policy for a network service providing system providing the network service, with reference to fig. 4, including:
an index data obtaining unit 401, configured to obtain current index data of the network service providing system;
a load level determining unit 402, configured to determine a current load level of the network service providing system according to the index data;
a policy configuration unit 403, configured to adjust policy proportions of the best-effect policy, the performance-effect balancing policy, and the best-performance policy according to the current load level of the network service providing system, so that the traffic flow is processed according to the configuration of the policy proportions.
In an optional mode, the index data comprises system performance index data and/or service effect index data; wherein: the system performance index comprises one or more of processor utilization rate, memory utilization rate, disk transmission rate and network utilization rate; the service effect index comprises one or more items of inquiry rate, concurrency and response time per second.
In an alternative, the load level determining unit 402 includes:
an index threshold setting subunit 4021, configured to set an index threshold for each index of the network service providing system;
an index comparison subunit 4022, configured to compare current index data of the network service providing system with corresponding index thresholds, respectively, to obtain scores of the indexes;
a load score value operator unit 4023, configured to calculate a load score according to each index score;
a load grade determining subunit 4024, configured to determine the load grade according to the load score.
In an optional manner, the load class determination subunit 4024 is specifically configured to: and comparing the load score with a preset lowest load threshold and a preset highest load threshold respectively to determine that the load grade is the lowest grade, the middle grade or the highest grade.
In an optional mode, the processing strategy comprises an effect optimization strategy, a performance effect balancing strategy and a performance optimization strategy;
in an optional manner, the policy configuration unit 403 is specifically configured to: if the current load level is the highest level, reducing the proportion of the optimal effect strategy and/or increasing the proportion of the performance effect balancing strategy and the optimal performance strategy; and if the current load level is the lowest level, reducing the proportion of the performance optimal strategy and/or increasing the proportion of the performance effect balancing strategy and the effect optimal strategy.
In an alternative, the method further comprises:
a policy implementation unit 404, configured to determine different processing policies by setting different code execution logics; wherein the best effort strategy corresponds to code execution logic with priority on computational accuracy, and the best performance strategy corresponds to code execution logic with priority on computational speed.
In an alternative, the method further comprises:
a resource adjusting unit 405, configured to adjust system resources for the network service providing system according to the current load level of the network service providing system.
In an optional manner, the resource adjusting unit 405 is specifically configured to: if the current load level is the highest level, increasing the system resources through capacity expansion operation; and if the current load level is the lowest level, reducing the system resources through capacity reduction operation.
In a third aspect, based on the same inventive concept as the network service management method in the foregoing embodiments, the present invention further provides a server, as shown in fig. 5, including a memory 504, a processor 502 and a computer program stored on the memory 504 and executable on the processor 502, wherein the processor 502 implements the steps of any one of the foregoing network service management methods when executing the program.
Where in fig. 5 a bus architecture (represented by bus 500) is shown, bus 500 may include any number of interconnected buses and bridges, and bus 500 links together various circuits including one or more processors, represented by processor 502, and memory, represented by memory 504. The bus 500 may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface 506 provides an interface between the bus 500 and the receiver 501 and transmitter 503. The receiver 501 and the transmitter 503 may be the same element, i.e. a transceiver, providing a means for communicating with various other apparatus over a transmission medium. The processor 502 is responsible for managing the bus 500 and general processing, and the memory 504 may be used for storing data used by the processor 502 in performing operations.
In a fourth aspect, based on the inventive concept of the network service management method as in the previous embodiments, the present invention further provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of any one of the aforementioned network service management methods.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present specification have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all changes and modifications that fall within the scope of the specification.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present specification without departing from the spirit and scope of the specification. Thus, if such modifications and variations of the present specification fall within the scope of the claims of the present specification and their equivalents, the specification is intended to include such modifications and variations.