Traffic adjustment method and device, computer equipment, storage medium and program product
By acquiring and analyzing the CPU load and QPS data of the gateway and tenant in the cloud computing scenario, determining the adjustment weight of the tenant and adjusting the traffic, the problem of high CPU load when the tenant shares the gateway is solved, and better service quality and resource utilization are achieved .
Patent Information
- Application Number
- CN202411693175.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-25
AI Technical Summary
In the cloud computing scenario, multiple tenants share application layer gateway services, resulting in high load on the gateway CPU and affecting the QoS service quality of other tenants. The existing methods are difficult to accurately limit the overhead of burst tenants.
By obtaining the CPU load and QPS data of the gateway and each real tenant during the target period, when the gateway CPU load exceeds the alert value, the adjustment weight of each tenant is determined according to the individual standard CPU load and actual load, and the tenant traffic is determined based on the QPS and weights. Make adjustments.
It realizes accurate adjustment of traffic to each tenant, reduces the gateway CPU load, improves the service quality of other tenants, and solves the problem of excessive use of gateway resources by sudden tenants.
Smart Images

Figure CN119484411A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network services, and in particular to a traffic adjustment method, device, computer equipment, storage medium and program product. Background Art
[0002] For the application layer gateway deployed between the client and the business server, it can perform fine-grained routing, load balancing, security protection, compression, caching and other functions for various application protocol requests such as HTTP and HTTPS. Therefore, it is widely used in seven-layer load balancing, API gateway, and CDN (Content Delivery Network) scenarios.
[0003] In cloud computing scenarios, multiple tenants share application layer gateway services and compete for the limited CPU time of the gateway. If a tenant's business bursts, or there are complex encryption and compression requests, it will cause a high load on the network element CPU, affecting the QoS (Quality of Service) of other tenants. In addition, due to the natural complexity of application layer traffic, there are both IO (Input / Output) intensive services and computing intensive services. It is impossible to accurately limit the overhead of burst tenants by limiting fixed QPS (Queries Per Second) and bandwidth speed limits. Summary of the invention
[0004] Based on this, it is necessary to provide a traffic adjustment method, device, computer equipment, storage medium and program product to address the above technical problems, which can accurately achieve traffic adjustment for each tenant.
[0005] In a first aspect, the present application provides a flow adjustment method, the method comprising:
[0006] Obtain the actual central processing unit (CPU) load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant;
[0007] When the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant;
[0008] The traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0009] In one embodiment, each real tenant corresponds to at least one virtual tenant, the individual actual CPU loads of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual CPU loads of the virtual tenants corresponding to the same real tenant is equal to the individual actual CPU load corresponding to the real tenant; the individual actual QPSs of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual QPSs of the virtual tenants corresponding to the same real tenant is equal to the individual actual QPS corresponding to the real tenant; the individual standard CPU load is determined according to the gateway standard CPU load and the number of real tenants.
[0010] In one embodiment, determining the adjustment weight corresponding to each real tenant according to the individual standard CPU load and the individual actual CPU load of each real tenant includes:
[0011] According to the relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant, select the over-standard tenant from each virtual tenant; based on the actual CPU load of the gateway, the standard CPU load of the gateway and the individual actual CPU load of each over-standard tenant, determine the adjustment weight corresponding to each over-standard tenant; according to the adjustment weight corresponding to each over-standard tenant, determine the adjustment weight of the real tenant corresponding to each over-standard tenant.
[0012] In one embodiment, selecting the over-standard tenant from each virtual tenant according to the size relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant includes:
[0013] A virtual tenant whose individual actual CPU load is greater than the individual standard CPU load among the virtual tenants is regarded as an over-standard tenant.
[0014] In one embodiment, based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the individual actual CPU load of each tenant exceeding the standard, the adjustment weight corresponding to each tenant exceeding the standard is determined, including:
[0015] The sum of the individual actual CPU loads of each tenant exceeding the standard is taken as the total excess CPU; based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the total excess CPU, the adjustment weight corresponding to each tenant exceeding the standard is determined.
[0016] In one embodiment, the traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant, including:
[0017] For each real tenant, the product of the individual actual QPS corresponding to the real tenant and the adjustment weight is determined as the adjusted QPS of the real tenant; based on each adjusted QPS, the traffic of the corresponding real tenant is adjusted.
[0018] In one embodiment, obtaining the actual central processing unit (CPU) load of the gateway corresponding to the gateway within the target period, and the individual actual CPU load and the individual actual query rate (QPS) per second corresponding to each real tenant includes:
[0019] Get the individual actual QPS corresponding to each real tenant; get the number of user-state beats and kernel-state beats consumed by the entire process within the target time period, as well as the number of user-state beats and kernel-state beats consumed by each real tenant; determine the actual CPU load of the gateway corresponding to the gateway based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by the entire process; determine the individual actual CPU load corresponding to each real tenant based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by each real tenant.
[0020] In a second aspect, the present application further provides a flow adjustment device, the device comprising:
[0021] The acquisition module is used to obtain the actual central processing unit CPU load of the gateway corresponding to the gateway within the target period, as well as the individual actual CPU load and individual actual query rate per second QPS corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant;
[0022] A weight determination module, used to determine the adjustment weight corresponding to each real tenant according to the individual standard CPU load and the individual actual CPU load of each real tenant when the actual CPU load of the gateway exceeds the load warning value;
[0023] The adjustment module is used to adjust the traffic of each real tenant according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0024] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0025] Obtain the actual central processing unit (CPU) load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant;
[0026] When the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant;
[0027] The traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0028] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0029] Obtain the actual central processing unit (CPU) load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant;
[0030] When the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant;
[0031] The traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0032] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0033] Obtain the actual central processing unit (CPU) load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant;
[0034] When the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant;
[0035] The traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0036] The above-mentioned traffic adjustment method, device, computer equipment, storage medium and program product provide data basis for judging whether the CPU is overloaded by obtaining the actual central processing unit CPU load of the gateway corresponding to the gateway within the target period, as well as the individual actual CPU load and individual actual query rate per second QPS corresponding to each real tenant; further, when the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant, which provides a way to control the traffic; finally, the traffic of each real tenant can be adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant. The scheme provides a basis for realizing refined traffic adjustment by respectively obtaining the actual CPU load of the gateway corresponding to the gateway and the individual actual CPU load corresponding to each real tenant; furthermore, by introducing the adjustment weight, it provides a way to control the traffic according to the actual CPU status of each real tenant, and finally accurately realizes the traffic adjustment of each real tenant. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] FIG1 is an application environment diagram of a flow adjustment method provided in an embodiment of the present application;
[0039] FIG2 is a schematic diagram of a flow chart of flow adjustment provided in an embodiment of the present application;
[0040] FIG3 is a diagram of a gateway service structure provided in an embodiment of the present application;
[0041] FIG4 is a schematic diagram of a flow chart of determining an adjustment weight provided in an embodiment of the present application;
[0042] FIG5 is a schematic diagram of a process for adjusting the traffic of each real tenant provided in an embodiment of the present application;
[0043] FIG6 is a flow chart of another flow adjustment method provided in an embodiment of the present application;
[0044] FIG7 is a structural block diagram of a flow adjustment device provided in an embodiment of the present application;
[0045] FIG8 is a structural block diagram of another flow adjustment device provided in an embodiment of the present application;
[0046] FIG. 9 is an internal structure diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] The traffic adjustment method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 can obtain the actual central processing unit CPU load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and the individual actual query rate per second QPS corresponding to each real tenant, and calculate and analyze them, and adjust the traffic of each real tenant according to the results of the analysis. The actual central processing unit CPU load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and the individual actual query rate per second QPS corresponding to each real tenant, and the adjusted data can be presented through the terminal 102. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0049] In an exemplary embodiment, as shown in FIG. 2 , a traffic adjustment method is provided, which is described by taking the method applied to the server 104 in FIG. 1 as an example, and may include the following steps:
[0050] S201, obtaining the actual central processing unit (CPU) load of the gateway corresponding to the gateway within the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant.
[0051] Among them, the actual central processing unit (CPU) load of the gateway refers to the load borne by the central processing unit (i.e., CPU) on the gateway device when processing network traffic and data forwarding tasks; the actual CPU load of an individual refers to the actual occupancy rate of the CPU resources allocated to the real tenant during its operation, which can include the CPU time consumed by the real tenant's applications, processes, and threads; the actual query rate per second (QPS) of an individual refers to the number of query requests actually processed per second by the real tenant during the target period; the CPU load refers to the number of processes running and waiting to run, which can reflect the busyness of the CPU when processing tasks. In general, the higher the load, the more tasks the CPU is processing, which may lead to performance degradation.
[0052] It should be noted that the gateway is used to forward the traffic data of each real tenant and works at the application layer, which is also called the Application Layer Gateway (ALG). It is a device or system used to forward application layer data between different networks. As shown in Figure 3, the gateway in the embodiment of the present application is located between the client and server of multiple real tenants, receives and processes client requests, and forwards the requests to the server of the corresponding real tenant; receives and processes server responses, and forwards the responses to the client. The application layer gateway service specifically carries the network element, which can be a single physical machine or a virtual machine, or a machine composed of multiple devices.
[0053] Exemplarily, the CPU load of the gateway during the target period, as well as the CPU load and QPS of each real user, can be monitored in real time through a performance monitoring tool, and the actual central processing unit CPU load of the gateway corresponding to the target period, as well as the individual actual CPU load and the individual actual query rate per second QPS corresponding to each real tenant can be determined based on the monitoring data; data related to the CPU load of the gateway during the target period, as well as the CPU load and QPS of each real user can also be obtained through commands or instructions, and ultimately the actual central processing unit CPU load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and the individual actual query rate per second QPS corresponding to each real tenant can be determined.
[0054] S202: When the actual CPU load of the gateway exceeds the load warning value, an adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant.
[0055] Among them, the load warning value can indicate that the gateway is in an overloaded state. The load warning value can be set in advance to ensure the stability and security of the gateway; the individual standard CPU load can indicate the CPU load level expected by the tenant under normal circumstances, and can be used to evaluate the CPU load situation of the tenant; the adjustment weight can be used to adjust the traffic limit of each tenant.
[0056] Optionally, the setting of the load warning value can be based on the actual performance and business needs of the system or device, ensuring that overload conditions can be detected in a timely manner while avoiding frequent traffic adjustments due to setting too low a value. For example, the historical load data of the system or device can be analyzed in combination with factors such as performance fluctuations of the system or device and changes in business needs, and a reasonable load warning value can be determined.
[0057] Exemplarily, when the actual CPU load of the gateway exceeds the load warning value, it indicates that the gateway is in an overloaded state, and it is necessary to adjust the traffic of each tenant for which the gateway is responsible (such as limiting the traffic of some tenants) to reduce the CPU load of the gateway; further, the individual standard CPU load can be compared with the individual actual CPU load of each real tenant, and the tenant who needs traffic adjustment can be determined based on the comparison result; further, the adjustment range, that is, the adjustment weight, can be determined based on the gap between the individual actual CPU load and the individual standard CPU load of the tenant who needs traffic adjustment.
[0058] For example, when the actual CPU load of the gateway exceeds the load warning value, the individual standard CPU load and the individual actual CPU load of each real tenant can be input into the weight determination model, and the weight determination model analyzes them and determines the adjustment weight corresponding to each real tenant; wherein, the weight determination model can be a model obtained by training based on historical CPU loads, and this application does not specifically limit the determination process of the weight determination model.
[0059] S203: Adjust the traffic of each real tenant according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0060] Exemplarily, the individual actual QPS and adjustment weight corresponding to each real tenant can be input into the traffic adjustment model, which analyzes them and determines the adjusted QPS of each real tenant based on the analysis results; further, based on the adjusted QPS of each real tenant, a traffic speed limit strategy can be adopted for each real tenant, such as delayed processing and returning a 429 error code (i.e., too many requests error code).
[0061] It should be noted that after traffic adjustment for each real tenant, if it is monitored that the actual CPU load of the gateway corresponding to the gateway reaches a gateway standard CPU load (i.e., it returns to normal), the traffic restriction on each real tenant can be automatically lifted through the automatic recovery mechanism; for example, the automatic recovery mechanism can be used to lift the traffic restriction on each real tenant (e.g., not executing the delay processing strategy) after 10 minutes when the entire gateway is in a normal state, i.e., not in an overloaded state.
[0062] The above-mentioned traffic adjustment method provides a data basis for judging whether the CPU is overloaded by obtaining the actual central processing unit CPU load of the gateway corresponding to the gateway within the target period, as well as the individual actual CPU load and individual actual query rate per second QPS corresponding to each real tenant; further, when the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant, which provides a way to control the traffic; finally, the traffic of each real tenant can be adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant. The scheme provides a basis for realizing refined traffic adjustment by respectively obtaining the actual CPU load of the gateway corresponding to the gateway and the individual actual CPU load corresponding to each real tenant; furthermore, by introducing the adjustment weight, it provides a way to control the traffic according to the actual CPU status of each real tenant, and finally accurately realizes the traffic adjustment of each real tenant.
[0063] Based on the above embodiment, the embodiment of the present application explains the above embodiment S202 in detail. Specifically, the process of determining the adjustment weight corresponding to each real tenant in the embodiment of the present application, as shown in FIG4, specifically includes the following steps:
[0064] S401 , selecting an over-standard tenant from each virtual tenant according to the size relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant.
[0065] Among them, the over-standard tenant refers to the tenant whose CPU load exceeds the individual standard CPU load, that is, the tenant who needs traffic control and traffic adjustment.
[0066] Optionally, the individual standard CPU load may be determined by the gateway standard CPU load and the number of virtual tenants, such as individual standard CPU load = gateway standard CPU load ÷ number of virtual tenants.
[0067] It should be noted that in the actual multi-tenant gateway scenario, different tenants can have different tenant quotas, such as basic, performance, and advanced types. The three quotas allow tenants to consume CPU loads in a ratio of 1:2:4. Therefore, there may be resource unfairness between real tenants in the actual scenario. Furthermore, in the process of controlling the flow of each real user, if the same flow adjustment strategy is used, the impact on real users with high quotas and real users with low quotas may be different. In order to reduce the difference in CPU load quotas between real users, the concept of virtual tenants is introduced, that is, each real tenant corresponds to at least one virtual tenant, the individual actual CPU loads of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual CPU loads of the virtual tenants corresponding to the same real tenant is equal to the individual actual CPU load corresponding to the real tenant; the individual actual QPS of the virtual tenants corresponding to the same real tenant is the same, and the sum of the individual actual QPS of the virtual tenants corresponding to the same real tenant is equal to the individual actual QPS corresponding to the real tenant; the individual standard CPU load is determined according to the gateway standard CPU load and the number of real tenants.
[0068] For example, there are three real tenants (A, B, and C), real tenant A is basic, real tenant B is performance, and real tenant C is advanced. The CPU load consumption ratios of the three types of tenants are 1:2:4, respectively. Therefore, there can be a total of 7 virtual tenants, with real tenant A corresponding to 1 virtual tenant, real tenant B corresponding to 2 virtual tenants, and real tenant C corresponding to 4 virtual tenants. If the CPU load of real tenant A (basic) is 8% and the QPS is 100 during the statistical period, the CPU consumption of the virtual tenant corresponding to real tenant A is 100. U load is 8%, QPS is 100; the CPU load of real tenant B (performance type) is 12% and QPS is 170 during the statistical period. Among the two virtual tenants corresponding to real tenant B, each virtual tenant consumes a CPU load of 12%÷2, that is, 6%, and a QPS of 170÷2, that is, 85; the CPU load of real tenant C (advanced type) is 80% and QPS is 1000 during the statistical period. Among the four virtual tenants corresponding to real tenant C, each virtual tenant consumes a CPU load of 80%÷4, that is, 20%, and a QPS of 1000÷4, that is, 250.
[0069] Optionally, a virtual tenant whose individual actual CPU load is greater than an individual standard CPU load among the virtual tenants is regarded as an over-standard tenant.
[0070] As shown in the above example, if the individual standard CPU load is 15%, based on the fact that the CPU load consumed by one virtual tenant corresponding to real tenant A is 8%, the CPU load consumed by two virtual tenants corresponding to real tenant B is 6% respectively, and the CPU load consumed by four virtual tenants corresponding to real tenant C is 20% respectively, it can be known that the CPU load consumed by the four virtual tenants corresponding to real tenant C (20%) is greater than the individual standard CPU load (15%), and the four virtual tenants corresponding to real tenant C are determined as tenants exceeding the standard.
[0071] S402: Determine an adjustment weight corresponding to each tenant exceeding the standard based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the individual actual CPU load of each tenant exceeding the standard.
[0072] It should be noted that, for a tenant whose individual actual CPU load is not greater than the individual standard CPU load in each virtual tenant, no traffic adjustment is performed on the virtual tenant, that is, the adjustment weight may be 1.
[0073] One implementable method is to use the sum of the individual actual CPU loads of each over-standard tenant as the total over-standard CPU; based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the total over-standard CPU, determine the adjustment weight corresponding to each over-standard tenant.
[0074] The total amount of excess CPU may represent the total amount of CPU loads of all tenants that exceed the quota.
[0075] For example, if the number of tenants exceeding the quota is n, the actual CPU load of the individual tenant i exceeding the quota is , then the total number of CPUs exceeding the limit It can be expressed as Furthermore, it can be based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the total CPU load exceeding the standard. , determine the candidate weights corresponding to each over-standard tenant, such as ; Then, the maximum value between the candidate weight and 0 is determined as the adjustment weight corresponding to each over-standard tenant.
[0076] Another possible implementation method is to input the actual CPU load of the gateway, the standard CPU load of the gateway and the individual actual CPU load of each tenant exceeding the standard into the adjustment weight model, which analyzes them and ultimately determines the adjustment weight corresponding to each tenant exceeding the standard.
[0077] S403: Determine the adjustment weight of the real tenant corresponding to each over-standard tenant according to the adjustment weight corresponding to each over-standard tenant.
[0078] Exemplarily, for each real tenant, if there is an over-standard tenant among the virtual tenants corresponding to the real tenant, the adjustment weight corresponding to the over-standard tenant can be directly determined as the adjustment weight of the real tenant.
[0079] In the embodiment of the present application, by introducing virtual tenants, a method is provided to improve the unfair traffic adjustment phenomenon caused by resource differences among real tenants in actual scenarios.
[0080] Based on the above embodiment, the present application embodiment explains the above embodiment S203 in detail. Specifically, the process of adjusting the flow of each real tenant in the present application embodiment, as shown in FIG5, specifically includes the following steps:
[0081] S501 , for each real tenant, multiplying the individual actual QPS corresponding to the real tenant and the adjustment weight to determine the adjusted QPS of the real tenant.
[0082] The adjustment of QPS may be expressed as adjusting the target QPS of the real tenant, that is, the QPS to be achieved after traffic adjustment.
[0083] S502: Based on each adjusted QPS, traffic is adjusted for corresponding real tenants.
[0084] Exemplarily, based on the adjusted QPS corresponding to each real tenant, traffic can be adjusted for each real tenant through traffic rate limiting strategies such as delayed processing and returning a 429 error code (ie, too many requests error code) to achieve the adjusted QPS corresponding to each real tenant.
[0085] In the embodiment of the present application, traffic is adjusted for each real tenant based on the individual actual QPS and adjustment weight corresponding to the real tenant, thereby laying a data foundation for accurately achieving the effect of traffic adjustment.
[0086] Based on the above embodiment, the present embodiment of the present application explains the above embodiment S201 in detail. Specifically, the process of obtaining CPU load and QPS in the present embodiment of the present application specifically includes:
[0087] Get the individual actual QPS corresponding to each real tenant; get the number of user-state beats and kernel-state beats consumed by the entire process within the target time period, as well as the number of user-state beats and kernel-state beats consumed by each real tenant; determine the actual CPU load of the gateway corresponding to the gateway based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by the entire process; determine the individual actual CPU load corresponding to each real tenant based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by each real tenant.
[0088] For example, during the period between time t and time t+T, the actual individual QPS corresponding to each real tenant can be directly obtained through instructions or monitoring tools; further, for the entire gateway, the number of ticks in user state + kernel state consumed by the entire process at time t can be obtained through Linuxtimes system call. t , and the number of ticks in user state + kernel state consumed by the process at time t+T t+T ; Then, we can get the number of user-mode + kernel-mode ticks consumed by the entire process within the target period T, Δtick=tick t+T -tick t ; On Linux systems, the tick rate Hz can be obtained through the sysconf(_SC_CLK_TCK) system call; further, the overall CPU load (i.e., the actual CPU load of the gateway corresponding to the gateway) can be determined based on the user-mode + kernel-mode ticks Δtick and tick rate Hz consumed by the entire process within the target period T, such as the actual CPU load of the gateway = Δtick ÷ (T×Hz); for each real tenant, within the target period T, at the time t when the real user processes the request, the tick number tick is obtained through the times system t At the time t+Δt when the real user stops processing the request, the tick count is obtained again through the times system. t+Δt , tick t+Δt -tick t The consumption of processing requests by the real user within the time Δt can be obtained. By summing up the consumption of all requests of the real user within the target period T, the total number of beats Stick consumed by the real user within the target period T can be obtained. Furthermore, based on the total number of beats Stick and the beat rate Hz consumed by each real user within the target period T, the individual actual CPU load corresponding to each tenant can be determined, such as individual actual CPU load = Stick ÷ (T×Hz).
[0089] Optionally, the gateway status can be counted every target period T (such as 10 seconds), and traffic adjustment can be performed if an abnormality is found. It should be noted that the shorter the target period, the faster the traffic adjustment takes effect, but the inspection overhead and burr impact will be greater.
[0090] It should be noted that the gateway can perform various operations such as decryption, authentication, security scanning, complex routing lookup, transcoding, caching, compression, etc.; further, when receiving new connections and requests from real tenants, it can parse the identification code (such as ID) of the real tenant. For example, the real tenant information table can be queried according to the TCP connection information of the request to obtain the identification of the real tenant; the gateway can forward the processed client request to the appropriate real tenant server based on load balancing strategies, etc.
[0091] In the embodiment of the present application, by obtaining the user state beat number and the kernel state beat number, a data basis is provided for accurately determining the actual CPU load of the gateway and the individual actual CPU load, and finally a foundation is laid for accurate flow control.
[0092] Based on the above embodiment, this embodiment provides an optional example of a flow adjustment method. As shown in FIG6 , the specific implementation process is as follows:
[0093] S601, obtaining the individual actual QPS corresponding to each real tenant.
[0094] It should be noted that each real tenant corresponds to at least one virtual tenant, the individual actual CPU loads of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual CPU loads of the virtual tenants corresponding to the same real tenant is equal to the individual actual CPU load corresponding to the real tenant; the individual actual QPSs of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual QPSs of the virtual tenants corresponding to the same real tenant is equal to the individual actual QPS corresponding to the real tenant.
[0095] S602, obtaining the number of user-state beats and kernel-state beats consumed by the entire process within the target period, and the number of user-state beats and kernel-state beats consumed by each real tenant.
[0096] S603, determining the actual CPU load of the gateway corresponding to the gateway according to the target time period, the beat rate, and the number of user-mode beats and kernel-mode beats consumed by the entire process.
[0097] The gateway is used to forward the traffic data of each real tenant.
[0098] S604, determining the individual actual CPU load corresponding to each real tenant according to the target time period, the beat rate, and the number of user-mode beats and kernel-mode beats consumed by each real tenant.
[0099] S605 , when the actual CPU load of the gateway exceeds the load warning value, selecting an over-standard tenant from each virtual tenant according to the size relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant.
[0100] The individual standard CPU load is determined according to the gateway standard CPU load and the actual number of tenants.
[0101] Optionally, a virtual tenant whose individual actual CPU load is greater than an individual standard CPU load among the virtual tenants is regarded as an over-standard tenant.
[0102] S606: The sum of the individual actual CPU loads of the tenants exceeding the quota is taken as the total excess CPU.
[0103] S607: Determine an adjustment weight corresponding to each tenant exceeding the standard based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the total CPU load exceeding the standard.
[0104] S608: Determine the adjustment weight of the real tenant corresponding to each over-standard tenant according to the adjustment weight corresponding to each over-standard tenant.
[0105] S609: For each real tenant, the product of the individual actual QPS corresponding to the real tenant and the adjustment weight is determined as the adjusted QPS of the real tenant.
[0106] S610: Based on each adjusted QPS, traffic is adjusted for corresponding real tenants.
[0107] The specific process of the above S601-S610 can refer to the description of the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0108] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0109] Based on the same inventive concept, the embodiment of the present application also provides a flow adjustment device for implementing the flow adjustment method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more flow adjustment device embodiments provided below can refer to the limitations of the flow adjustment method above, and will not be repeated here.
[0110] In an exemplary embodiment, as shown in FIG7 , a flow adjustment device 1 is provided, comprising: an acquisition module 10, a weight determination module 20 and an adjustment module 30, wherein:
[0111] The acquisition module 10 is used to obtain the actual central processing unit CPU load of the gateway corresponding to the gateway within the target period, as well as the individual actual CPU load and individual actual query rate per second QPS corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant.
[0112] The weight determination module 20 is used to determine the adjustment weight corresponding to each real tenant according to the individual standard CPU load and the individual actual CPU load of each real tenant when the actual CPU load of the gateway exceeds the load warning value.
[0113] The adjustment module 30 is used to adjust the traffic of each real tenant according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0114] In one embodiment, each real tenant corresponds to at least one virtual tenant, the individual actual CPU loads of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual CPU loads of the virtual tenants corresponding to the same real tenant is equal to the individual actual CPU load corresponding to the real tenant; the individual actual QPSs of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual QPSs of the virtual tenants corresponding to the same real tenant is equal to the individual actual QPS corresponding to the real tenant; the individual standard CPU load is determined according to the gateway standard CPU load and the number of real tenants.
[0115] In one embodiment, as shown in FIG8 , the weight determination module 20 includes:
[0116] The over-standard selection unit 21 is used to select an over-standard tenant from each virtual tenant according to the size relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant.
[0117] The over-standard weight unit 22 is used to determine the adjustment weight corresponding to each over-standard tenant based on the actual CPU load of the gateway, the standard CPU load of the gateway and the individual actual CPU load of each over-standard tenant.
[0118] The real weight unit 23 is used to determine the adjustment weight of the real tenant corresponding to each over-standard tenant according to the adjustment weight corresponding to each over-standard tenant.
[0119] In one embodiment, the exceeding standard selection unit 21 is specifically used for:
[0120] A virtual tenant whose individual actual CPU load is greater than the individual standard CPU load among the virtual tenants is regarded as an over-standard tenant.
[0121] In one embodiment, the excess weight unit 22 is specifically used for:
[0122] The sum of the individual actual CPU loads of each tenant exceeding the standard is taken as the total excess CPU; based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the total excess CPU, the adjustment weight corresponding to each tenant exceeding the standard is determined.
[0123] In one embodiment, the adjustment module 30 is specifically used for:
[0124] For each real tenant, the product of the individual actual QPS corresponding to the real tenant and the adjustment weight is determined as the adjusted QPS of the real tenant; based on each adjusted QPS, the traffic of the corresponding real tenant is adjusted.
[0125] In one embodiment, the acquisition module 10 is specifically used for:
[0126] Get the individual actual QPS corresponding to each real tenant; get the number of user-state beats and kernel-state beats consumed by the entire process within the target time period, as well as the number of user-state beats and kernel-state beats consumed by each real tenant; determine the actual CPU load of the gateway corresponding to the gateway based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by the entire process; determine the individual actual CPU load corresponding to each real tenant based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by each real tenant.
[0127] Each module in the above-mentioned flow adjustment device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0128] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG9. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store traffic data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a traffic adjustment method is implemented.
[0129] Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0130] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0131] Obtain the actual central processing unit (CPU) load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant;
[0132] When the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant;
[0133] The traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0134] In one embodiment, each real tenant corresponds to at least one virtual tenant, the individual actual CPU loads of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual CPU loads of the virtual tenants corresponding to the same real tenant is equal to the individual actual CPU load corresponding to the real tenant; the individual actual QPSs of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual QPSs of the virtual tenants corresponding to the same real tenant is equal to the individual actual QPS corresponding to the real tenant; the individual standard CPU load is determined according to the gateway standard CPU load and the number of real tenants.
[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0136] According to the relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant, select the over-standard tenant from each virtual tenant; based on the actual CPU load of the gateway, the standard CPU load of the gateway and the individual actual CPU load of each over-standard tenant, determine the adjustment weight corresponding to each over-standard tenant; according to the adjustment weight corresponding to each over-standard tenant, determine the adjustment weight of the real tenant corresponding to each over-standard tenant.
[0137] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0138] A virtual tenant whose individual actual CPU load is greater than the individual standard CPU load among the virtual tenants is regarded as an over-standard tenant.
[0139] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0140] The sum of the individual actual CPU loads of each tenant exceeding the standard is taken as the total excess CPU; based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the total excess CPU, the adjustment weight corresponding to each tenant exceeding the standard is determined.
[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0142] For each real tenant, the product of the individual actual QPS corresponding to the real tenant and the adjustment weight is determined as the adjusted QPS of the real tenant; based on each adjusted QPS, the traffic of the corresponding real tenant is adjusted.
[0143] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0144] Get the individual actual QPS corresponding to each real tenant; get the number of user-state beats and kernel-state beats consumed by the entire process within the target time period, as well as the number of user-state beats and kernel-state beats consumed by each real tenant; determine the actual CPU load of the gateway corresponding to the gateway based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by the entire process; determine the individual actual CPU load corresponding to each real tenant based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by each real tenant.
[0145] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0146] Obtain the actual central processing unit (CPU) load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant;
[0147] When the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant;
[0148] The traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0149] In one embodiment, each real tenant corresponds to at least one virtual tenant, the individual actual CPU loads of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual CPU loads of the virtual tenants corresponding to the same real tenant is equal to the individual actual CPU load corresponding to the real tenant; the individual actual QPSs of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual QPSs of the virtual tenants corresponding to the same real tenant is equal to the individual actual QPS corresponding to the real tenant; the individual standard CPU load is determined according to the gateway standard CPU load and the number of real tenants.
[0150] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0151] According to the relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant, select the over-standard tenant from each virtual tenant; based on the actual CPU load of the gateway, the standard CPU load of the gateway and the individual actual CPU load of each over-standard tenant, determine the adjustment weight corresponding to each over-standard tenant; according to the adjustment weight corresponding to each over-standard tenant, determine the adjustment weight of the real tenant corresponding to each over-standard tenant.
[0152] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0153] A virtual tenant whose individual actual CPU load is greater than the individual standard CPU load among the virtual tenants is regarded as an over-standard tenant.
[0154] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0155] The sum of the individual actual CPU loads of each tenant exceeding the standard is taken as the total excess CPU; based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the total excess CPU, the adjustment weight corresponding to each tenant exceeding the standard is determined.
[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0157] For each real tenant, the product of the individual actual QPS corresponding to the real tenant and the adjustment weight is determined as the adjusted QPS of the real tenant; based on each adjusted QPS, the traffic of the corresponding real tenant is adjusted.
[0158] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0159] Get the individual actual QPS corresponding to each real tenant; get the number of user-state beats and kernel-state beats consumed by the entire process within the target time period, as well as the number of user-state beats and kernel-state beats consumed by each real tenant; determine the actual CPU load of the gateway corresponding to the gateway based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by the entire process; determine the individual actual CPU load corresponding to each real tenant based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by each real tenant.
[0160] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0161] Obtain the actual central processing unit (CPU) load of the gateway corresponding to the gateway during the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant;
[0162] When the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant;
[0163] The traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant.
[0164] In one embodiment, each real tenant corresponds to at least one virtual tenant, the individual actual CPU loads of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual CPU loads of the virtual tenants corresponding to the same real tenant is equal to the individual actual CPU load corresponding to the real tenant; the individual actual QPSs of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual QPSs of the virtual tenants corresponding to the same real tenant is equal to the individual actual QPS corresponding to the real tenant; the individual standard CPU load is determined according to the gateway standard CPU load and the number of real tenants.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] According to the relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant, select the over-standard tenant from each virtual tenant; based on the actual CPU load of the gateway, the standard CPU load of the gateway and the individual actual CPU load of each over-standard tenant, determine the adjustment weight corresponding to each over-standard tenant; according to the adjustment weight corresponding to each over-standard tenant, determine the adjustment weight of the real tenant corresponding to each over-standard tenant.
[0167] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0168] A virtual tenant whose individual actual CPU load is greater than the individual standard CPU load among the virtual tenants is regarded as an over-standard tenant.
[0169] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0170] The sum of the individual actual CPU loads of each tenant exceeding the standard is taken as the total excess CPU; based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the total excess CPU, the adjustment weight corresponding to each tenant exceeding the standard is determined.
[0171] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0172] For each real tenant, the product of the individual actual QPS corresponding to the real tenant and the adjustment weight is determined as the adjusted QPS of the real tenant; based on each adjusted QPS, the traffic of the corresponding real tenant is adjusted.
[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0174] Get the individual actual QPS corresponding to each real tenant; get the number of user-state beats and kernel-state beats consumed by the entire process within the target time period, as well as the number of user-state beats and kernel-state beats consumed by each real tenant; determine the actual CPU load of the gateway corresponding to the gateway based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by the entire process; determine the individual actual CPU load corresponding to each real tenant based on the target time period, beat rate, and the number of user-state beats and kernel-state beats consumed by each real tenant.
[0175] It should be noted that the information (including but not limited to gateway CPU load information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0176] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0177] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0178] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A flow adjustment method, characterized in that: The method comprises: Obtain the actual central processing unit (CPU) load of the gateway corresponding to the gateway within the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant; When the actual CPU load of the gateway exceeds the load warning value, the adjustment weight corresponding to each real tenant is determined according to the individual standard CPU load and the individual actual CPU load of each real tenant; The traffic of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant.
2. The method according to claim 1, characterized in that Each real tenant corresponds to at least one virtual tenant, the individual actual CPU loads of the virtual tenants corresponding to the same real tenant are the same, and the sum of the individual actual CPU loads of the virtual tenants corresponding to the same real tenant is equal to the individual actual CPU load corresponding to the real tenant; The individual actual QPS of each virtual tenant corresponding to the same real tenant is the same, and the sum of the individual actual QPS of each virtual tenant corresponding to the same real tenant is equal to the individual actual QPS corresponding to the real tenant; The individual standard CPU load is determined according to the gateway standard CPU load and the number of virtual tenants.
3. The method according to claim 2, characterized in that The step of determining the adjustment weight corresponding to each real tenant according to the individual standard CPU load and the individual actual CPU load of each real tenant includes: According to the relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant, select the tenant that exceeds the standard from each virtual tenant; Determine an adjustment weight corresponding to each tenant exceeding the standard based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the individual actual CPU load of each tenant exceeding the standard; According to the adjustment weight corresponding to each over-standard tenant, the adjustment weight of the real tenant corresponding to each over-standard tenant is determined.
4. The method according to claim 3, characterized in that The selecting the over-standard tenant from each virtual tenant according to the size relationship between the individual actual CPU load and the individual standard CPU load of each virtual tenant includes: A virtual tenant whose individual actual CPU load is greater than the individual standard CPU load among the virtual tenants is regarded as an over-standard tenant.
5. The method according to claim 3, characterized in that: The determining, based on the actual CPU load of the gateway, the standard CPU load of the gateway and the individual actual CPU load of each tenant exceeding the standard, an adjustment weight corresponding to each tenant exceeding the standard, includes: The sum of the actual CPU loads of each tenant that exceeds the quota is taken as the total excess CPU; Based on the actual CPU load of the gateway, the standard CPU load of the gateway, and the sum of the excess CPUs, an adjustment weight corresponding to each excess tenant is determined.
6. The method according to claim 1, characterized in that The flow of each real tenant is adjusted according to the individual actual QPS and adjustment weight corresponding to each real tenant, including: For each real tenant, the product of the individual actual QPS corresponding to the real tenant and the adjustment weight is determined as the adjusted QPS of the real tenant; Based on each of the adjusted QPS, traffic is adjusted for the corresponding real tenant.
7. The method according to claim 1, characterized in that The method of obtaining the actual central processing unit (CPU) load of the gateway corresponding to the gateway within the target period, as well as the individual actual CPU load and individual actual query rate per second (QPS) corresponding to each real tenant, includes: Get the actual QPS of each tenant. Obtain the number of user-state beats and kernel-state beats consumed by the entire process during the target period, as well as the number of user-state beats and kernel-state beats consumed by each real tenant; Determine the actual CPU load of the gateway corresponding to the gateway according to the target time period, the beat rate, and the number of user-state beats and kernel-state beats consumed by the process as a whole; According to the target time period, the beat rate, and the number of user-state beats and kernel-state beats consumed by each real tenant, the individual actual CPU load corresponding to each real tenant is determined.
8. A flow adjustment device, characterized in that: The device comprises: An acquisition module is used to obtain the actual central processing unit CPU load of the gateway corresponding to the gateway within the target period, as well as the individual actual CPU load and individual actual query rate per second QPS corresponding to each real tenant; wherein the gateway is used to forward the traffic data of each real tenant; A weight determination module, used to determine the adjustment weight corresponding to each real tenant according to the individual standard CPU load and the individual actual CPU load of each real tenant when the actual CPU load of the gateway exceeds the load warning value; The adjustment module is used to adjust the traffic of each real tenant according to the individual actual QPS and adjustment weight corresponding to each real tenant.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and system for carrying out statistic on RPM packages of Linux systems
CN107491372A
Real-time multi-tenant workload tracking and automatic throttling
CN115004156A
Gateway project test method and device, electronic equipment and storage medium
CN115941543A
Adaptive rate control based on overload signals
US20100271947A1
Tuning utilization and heap memory size for real-time garbage collection
US20160253103A1