A method, device and terminal equipment for determining CPU maximum usage of a server

By establishing a non-linear relationship between server CPU utilization and overall power consumption, and using a correction factor to determine the maximum CPU utilization, the problem of energy waste in data centers is solved, achieving a balance between energy saving and business processing efficiency.

CN115729792BActive Publication Date: 2026-02-24CHINA MOBILE SHANGHAI ICT CO LTD +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111010187.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2026-02-24
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

In existing technologies, data centers are designed based on peak power consumption, which leads to energy waste, and existing linear models have low accuracy in predicting the relationship between CPU utilization and energy consumption.

Method used

By acquiring the server's CPU utilization and total power consumption, a non-linear relationship between CPU utilization and actual total power consumption is established. Power consumption is corrected using a correction factor to determine the server's maximum CPU utilization. When the maximum utilization is exceeded, resources are released and an early warning is issued.

Benefits of technology

This approach achieves the goal of reducing server energy consumption while ensuring business processing efficiency, thus saving energy in the data center.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115729792B_ABST
    Figure CN115729792B_ABST
Patent Text Reader

Abstract

The application provides a method and device for determining the maximum CPU usage of a server and a terminal device, and relates to the technical field of computers.The method comprises the following steps: obtaining the CPU usage and the overall power consumption of the server in a preset time period; determining the correspondence between the CPU usage and the actual overall power consumption according to the CPU usage and the overall power consumption; determining the average CPU usage of the server according to the CPU usage of the server in the preset time period; and determining the maximum CPU usage of the server according to the correspondence between the CPU usage and the actual overall power consumption and the average CPU usage of the server.The scheme of the application realizes the saving of the energy consumption of the server by determining the maximum CPU usage of the server, reduces the energy consumption of the server while ensuring the business processing efficiency, and solves the problem that the energy consumption of the data center design does not match the actual use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, and terminal device for determining the maximum CPU utilization of a server. Background Technology

[0002] The CPU is the main energy-consuming component in a computer system. Adjusting the CPU's state to regulate the energy consumption of the entire data center system is a primary method for achieving energy conservation. Data centers are typically designed based on peak power consumption, but since actual operational needs rarely reach peak power, the design does not match real-world usage, resulting in wasted energy.

[0003] In existing technologies, the energy consumption of physical nodes is assessed and correlated with CPU utilization by determining the correspondence between CPU utilization and energy consumption. The study on the relationship between CPU utilization and energy consumption uses a linear model. However, in many related studies, the relationship between energy consumption and resource utilization is not simply linear. Therefore, the accuracy of predicting the relationship between CPU utilization and energy consumption based on a linear model is low. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus, and terminal device for determining the maximum CPU utilization of a server, in order to solve the problem in the related art that the energy consumption of data center design does not match the actual usage.

[0005] To achieve the above objectives, embodiments of the present invention provide a method for determining the maximum CPU utilization of a server, comprising:

[0006] Obtain the CPU utilization and total power consumption of the server within a preset time period;

[0007] Based on the CPU utilization rate and the total power consumption, determine the correspondence between the CPU utilization rate and the actual power consumption of the total system;

[0008] The average CPU utilization of the server is determined based on the CPU utilization of the server within the preset time period;

[0009] Based on the correlation between CPU utilization and actual power consumption of the entire machine and the average CPU utilization of the server, the maximum CPU utilization of the server is determined.

[0010] Further, determining the correspondence between the CPU utilization rate and the actual power consumption of the entire system based on the CPU utilization rate and the overall system power consumption includes:

[0011] Based on the server's CPU utilization and overall power consumption within the preset time period, the server's base power consumption and CPU power consumption are determined.

[0012] Wherein, the server's base power consumption = the server's total power consumption - CPU power consumption;

[0013] The CPU power consumption = power consumption impact factor × CPU utilization rate at the current moment;

[0014] The actual power consumption of the server is equal to the server's base power consumption plus the CPU power consumption plus the correction power consumption.

[0015] Furthermore, a correction factor is determined based on the difference between the CPU utilization rate of the server at the previous moment and the CPU utilization rate at the current moment, the CPU utilization rate of the server within the preset time period, and the total power consumption of the machine.

[0016] The corrected power consumption = correction factor × CPU utilization rate at the previous moment.

[0017] Further, the step of determining the correction factor based on the difference between the server's CPU utilization at the previous moment and the current moment, the server's CPU utilization within the preset time period, and the overall power consumption includes:

[0018] When the CPU utilization of the server at the current moment is in the first interval and the first difference is positive, the correction factor is the first value, and the first difference is the difference between the CPU utilization of the server at the previous moment and the CPU utilization at the current moment.

[0019] When the CPU utilization of the server at the current moment is in the first interval and the first difference is negative, the correction factor is the second value;

[0020] When the CPU utilization of the server at the current moment is in the second interval and the first difference is positive, the correction factor is the third value;

[0021] When the CPU utilization of the server at the current moment is in the second interval and the first difference is negative, the correction factor is the fourth value;

[0022] When the CPU utilization of the server at the current moment is in the third interval and the first difference is positive, the correction factor is the fifth value;

[0023] When the CPU utilization of the server at the current moment is in the third interval and the first difference is negative, the correction factor is the sixth value;

[0024] When the CPU utilization of the server at the current moment is in the fourth interval and the first difference is positive, the correction factor is the seventh value;

[0025] When the CPU utilization of the server at the current moment is in the fourth interval and the first difference is negative, the correction factor is the eighth value;

[0026] The first interval, the second interval, the third interval, and the fourth interval increase sequentially, and the first interval, the second interval, the third interval, and the fourth interval cover 0 to 100%.

[0027] Further, determining the maximum CPU utilization of the server based on the correspondence between CPU utilization and actual power consumption of the entire machine and the average CPU utilization of the server includes:

[0028] The maximum CPU utilization of the server is determined based on the average CPU utilization of the server and the corrected power consumption.

[0029] Furthermore, the method also includes:

[0030] When the CPU utilization of the server exceeds the maximum CPU utilization, the maximum CPU utilization is released and a warning is issued.

[0031] To achieve the above objectives, embodiments of the present invention provide an apparatus for determining the maximum CPU utilization of a server, including...

[0032] The acquisition module is used to acquire the CPU utilization and total power consumption of the server within a preset time period.

[0033] The first determining module is used to determine the correspondence between the CPU utilization rate and the actual power consumption of the whole machine based on the CPU utilization rate and the total power consumption.

[0034] The second determining module is used to determine the average CPU utilization of the server based on the CPU utilization of the server within the preset time period.

[0035] The third determining module is used to determine the maximum CPU utilization of the server based on the correspondence between the CPU utilization rate and the actual power consumption of the whole machine and the average CPU utilization rate of the server.

[0036] Furthermore, the first determining module is also used for:

[0037] Based on the server's CPU utilization and overall power consumption within the preset time period, the server's base power consumption and CPU power consumption are determined.

[0038] Wherein, the server's base power consumption = the server's total power consumption - CPU power consumption;

[0039] The CPU power consumption = power consumption impact factor × CPU utilization rate at the current moment;

[0040] The actual power consumption of the server is equal to the server's base power consumption plus the CPU power consumption plus the correction power consumption.

[0041] Furthermore, a correction factor is determined based on the difference between the CPU utilization rate of the server at the previous moment and the CPU utilization rate at the current moment, the CPU utilization rate of the server within the preset time period, and the total power consumption of the machine.

[0042] The corrected power consumption = correction factor × CPU utilization rate at the previous moment.

[0043] Further, the step of determining the correction factor based on the difference between the server's CPU utilization at the previous moment and the current moment, the server's CPU utilization within the preset time period, and the overall power consumption includes:

[0044] When the CPU utilization of the server at the current moment is in the first interval and the first difference is positive, the correction factor is the first value, and the first difference is the difference between the CPU utilization of the server at the previous moment and the CPU utilization at the current moment.

[0045] When the CPU utilization of the server at the current moment is in the first interval and the first difference is negative, the correction factor is the second value;

[0046] When the CPU utilization of the server at the current moment is in the second interval and the first difference is positive, the correction factor is the third value;

[0047] When the CPU utilization of the server at the current moment is in the second interval and the first difference is negative, the correction factor is the fourth value;

[0048] When the CPU utilization of the server at the current moment is in the third interval and the first difference is positive, the correction factor is the fifth value;

[0049] When the CPU utilization of the server at the current moment is in the third interval and the first difference is negative, the correction factor is the sixth value;

[0050] When the CPU utilization of the server at the current moment is in the fourth interval and the first difference is positive, the correction factor is the seventh value;

[0051] When the CPU utilization of the server at the current moment is in the fourth interval and the first difference is negative, the correction factor is the eighth value;

[0052] The first interval, the second interval, the third interval, and the fourth interval increase sequentially, and the first interval, the second interval, the third interval, and the fourth interval cover 0 to 100%.

[0053] Furthermore, the third determining module is also used for:

[0054] The maximum CPU utilization of the server is determined based on the average CPU utilization of the server and the corrected power consumption.

[0055] Furthermore, the device also includes:

[0056] The release module is used to release the maximum CPU utilization and issue a warning when the CPU utilization of the server exceeds the maximum CPU utilization.

[0057] To achieve the above objectives, embodiments of the present invention provide a terminal device, including a first processor and a transceiver, wherein the transceiver is used to acquire the CPU utilization rate and total power consumption of a server within a preset time period.

[0058] The first processor is used to determine the correspondence between the CPU utilization rate and the actual power consumption of the whole machine based on the CPU utilization rate and the total power consumption of the whole machine;

[0059] The average CPU utilization of the server is determined based on the CPU utilization of the server within the preset time period;

[0060] Based on the correlation between CPU utilization and actual power consumption of the entire machine and the average CPU utilization of the server, the maximum CPU utilization of the server is determined.

[0061] To achieve the above objectives, embodiments of the present invention provide a terminal device, including a transceiver, a second processor, a memory, and a program or instructions stored in the memory and executable on the second processor; when the second processor executes the program or instructions, it implements the method described above for determining the maximum CPU utilization of a server.

[0062] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, which, when executed by a processor, implement the steps in the method for determining the maximum CPU utilization of a server as described above.

[0063] The beneficial effects of the above-described technical solution of the present invention are as follows:

[0064] The method for determining the maximum CPU utilization of a server according to embodiments of the present invention determines the maximum CPU utilization of the server by calculating the relationship between the server's CPU utilization and the actual power consumption of the entire machine, as well as the average CPU utilization of the server. The solution of the present invention can determine the non-linear relationship between CPU utilization and the actual power consumption of the entire machine. The algorithm is simple, and by determining the maximum CPU utilization of the server, server energy consumption is saved, reducing server energy consumption while ensuring business processing efficiency. Attached Figure Description

[0065] Figure 1 A flowchart illustrating a method for determining the maximum CPU utilization of a server according to an embodiment of the present invention;

[0066] Figure 2 This is a schematic diagram of an apparatus for determining the maximum CPU utilization of a server according to an embodiment of the present invention.

[0067] Figure 3 A comparison chart showing the changes in overall power consumption before and after setting the maximum CPU utilization of a server using the method of the embodiment of the present invention.

[0068] Figure 4 The method for setting the maximum CPU utilization of a server according to an embodiment of the present invention is used to determine the energy saving ratio of the server under different CPU utilization rates after setting the maximum CPU utilization of the server.

[0069] Figure 5 This is a schematic diagram of the structure of a terminal device according to an embodiment of the present invention;

[0070] Figure 6 This is a structural diagram of a terminal device according to an embodiment of the present invention. Detailed Implementation

[0071] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0072] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0073] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0074] In addition, the terms "system" and "network" are often used interchangeably in this article.

[0075] In the embodiments provided in this application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0076] like Figure 1 As shown, an embodiment of the present invention provides a method for determining the maximum CPU utilization of a server, comprising:

[0077] Step 101: Obtain the CPU utilization and total power consumption of the server within a preset time period;

[0078] Step 102: Determine the correspondence between the CPU utilization rate and the actual power consumption of the whole machine based on the CPU utilization rate and the total power consumption.

[0079] Step 103: Determine the average CPU utilization of the server based on the CPU utilization of the server within the preset time period;

[0080] Step 104: Determine the maximum CPU utilization of the server based on the correspondence between the CPU utilization rate and the actual power consumption of the whole machine and the average CPU utilization rate of the server.

[0081] Optionally, prior to the embodiments of the present invention, the system can be checked for support for setting the maximum CPU utilization rate by using the CPU power management command cpupower idle-info or the auto-processing loadable tool modprobe acpi-cpufreq.

[0082] In one embodiment of the present invention, the CPU utilization of the server can be obtained and recorded to a file using the perf (or i7z) tool, and the overall power consumption can be obtained and recorded using the ipmitool tool. The sampling interval for CPU utilization and overall power consumption is 1 second, and the sampling duration is 3 days. Here, perf is a built-in Linux tool that can detect CPU utilization; i7z is a Linux tool for checking CPU utilization.

[0083] In one embodiment of the present invention, after determining the maximum CPU utilization of the server, the maximum CPU utilization can be set through the NodeManager, or the system parameters such as / dev / cpu_dma_latency can be set directly using code to extend the system response time. The NodeManager is an Intel product and can control the CPU frequency through an interface.

[0084] The method for determining the maximum CPU utilization of a server according to embodiments of the present invention determines the maximum CPU utilization of the server by calculating the relationship between the server's CPU utilization and the actual power consumption of the entire machine, as well as the average CPU utilization of the server. The solution of the present invention can determine the non-linear relationship between CPU utilization and the actual power consumption of the entire machine. The algorithm is simple, and by determining the maximum CPU utilization of the server, server energy consumption is saved, reducing server energy consumption while ensuring business processing efficiency.

[0085] Optionally, determining the correspondence between the CPU utilization rate and the actual power consumption of the entire system based on the CPU utilization rate and the overall system power consumption includes:

[0086] Based on the server's CPU utilization and overall power consumption within the preset time period, the server's base power consumption and CPU power consumption are determined.

[0087] Wherein, the server's base power consumption = the server's total power consumption - CPU power consumption;

[0088] The CPU power consumption = power consumption impact factor × CPU utilization rate at the current moment;

[0089] The actual power consumption of the server is equal to the server's base power consumption plus the CPU power consumption plus the correction power consumption.

[0090] In one embodiment of the present invention, the first model represents the linear relationship between the server's total power consumption P and CPU utilization Ucpu:

[0091] P = C0 + C1 × Ucpu

[0092] It should be noted that C0 is a constant representing the base power consumption of the entire system, including the power consumption of the processor, memory, and disk; CPU utilization Ucpu is the instantaneous CPU utilization of the server. C1 is obtained by linear regression of CPU utilization and total power consumption of multiple server groups.

[0093] In one embodiment of the present invention, the second model represents the non-linear relationship between the server's total power consumption P and CPU utilization Ucpu:

[0094] P = C0 + C1 × Ucpu + C2 × U'cpu

[0095] It should be noted that U'cpu represents the server's CPU utilization at the previous moment; C2 is a constant obtained through experiments. The relationship between the server's overall power consumption and CPU utilization is corrected by adjusting power consumption.

[0096] The method for determining the maximum CPU utilization of a server according to embodiments of the present invention determines the nonlinear relationship between the CPU utilization of the server and the actual power consumption of the whole machine by using the CPU utilization of the server at the previous moment. The algorithm is simple and highly reliable.

[0097] Optionally, a correction factor is determined based on the difference between the CPU utilization rate of the server at the previous moment and the CPU utilization rate at the current moment, the CPU utilization rate of the server within the preset time period, and the total power consumption of the machine.

[0098] Wherein, the corrected power consumption = correction factor × CPU utilization rate at the previous moment.

[0099] Here, corrected power consumption is added to more accurately characterize the changes in overall system power consumption with CPU utilization. If the influence of corrected power consumption is removed, the relationship between server power consumption and CPU utilization would be a straight line, which is clearly inconsistent with reality. This is because, in reality, when CPU utilization changes instantaneously, the change in overall system power consumption often lags behind. This is because at the instant of sampling, the server's CPU utilization is affected by the CPU utilization at the previous moment. Therefore, corrected power consumption is introduced to take into account the influence of the CPU utilization at the moment before sampling.

[0100] In one embodiment of the present invention, the correction factor is determined experimentally; it is related to the difference between the CPU utilization rate of the server at the previous moment and the CPU utilization rate at the current moment, and its range is determined by the difference (U'cpu-Ucpu) between the CPU utilization rate U'cpu at the previous moment and the CPU utilization rate Ucpu at the current moment.

[0101] Specifically, when U'cpu-Ucpu is positive, the overall power consumption of the system is decreasing, and when U'cpu-Ucpu is negative, the overall power consumption of the system is increasing.

[0102] The method for determining the maximum CPU utilization of a server in this embodiment of the invention introduces a correction factor to eliminate the influence of the CPU utilization at the previous moment on the CPU utilization at the time of data collection, thereby improving the accuracy of the correspondence between the server's total power consumption and CPU utilization.

[0103] Optionally, determining the correction factor based on the difference between the server's CPU utilization at the previous moment and the current moment, the server's CPU utilization during the preset time period, and the overall power consumption includes:

[0104] When the CPU utilization of the server at the current moment is in the first interval and the first difference is positive, the correction factor is the first value, and the first difference is the difference between the CPU utilization of the server at the previous moment and the CPU utilization at the current moment.

[0105] When the CPU utilization of the server at the current moment is in the first interval and the first difference is negative, the correction factor is the second value;

[0106] When the CPU utilization of the server at the current moment is in the second interval and the first difference is positive, the correction factor is the third value;

[0107] When the CPU utilization of the server at the current moment is in the second interval and the first difference is negative, the correction factor is the fourth value;

[0108] When the CPU utilization of the server at the current moment is in the third interval and the first difference is positive, the correction factor is the fifth value;

[0109] When the CPU utilization of the server at the current moment is in the third interval and the first difference is negative, the correction factor is the sixth value;

[0110] When the CPU utilization of the server at the current moment is in the fourth interval and the first difference is positive, the correction factor is the seventh value;

[0111] When the CPU utilization of the server at the current moment is in the fourth interval and the first difference is negative, the correction factor is the eighth value;

[0112] The first interval, the second interval, the third interval, and the fourth interval increase sequentially, and the first interval, the second interval, the third interval, and the fourth interval cover 0 to 100%.

[0113] In one embodiment of the present invention, the first interval, the second interval, the third interval, and the fourth interval are 0%-35%, 35%-60%, 60%-90%, and 90%-100%, respectively.

[0114] In one embodiment of the present invention, the correction factor is related to the current CPU utilization rate (Ucpu) value. Specifically, power consumption changes fastest when Ucpu is below 35%; power consumption changes slower when Ucpu is between 35% and 60%; and power consumption changes slowly when Ucpu is above 60%. Therefore, the correction factor needs to be segmented.

[0115] Optionally, the values ​​of the correction factor are shown in Table 1:

[0116] Table 1

[0117] CPU load 0%-35% 35%-60% 60%-90% 90%-100% C2 (Ascending) V1 V2 V3 V4 C2 (decreased) V1` V2` V3` V4`

[0118] The value of correction factor C2 is calculated by substituting C1, calculated using the first model, and the collected data on server power consumption and CPU utilization into the second model, and then calculating the value through linear regression. It should be noted that the correction factor C2 can be a fixed value or a range of values.

[0119] The method for determining the maximum CPU utilization of a server according to embodiments of the present invention can determine the nonlinear relationship between CPU utilization and actual power consumption of the whole machine. The algorithm is simple and saves server energy consumption by determining the maximum CPU utilization of the server, thereby reducing server energy consumption while ensuring business processing efficiency.

[0120] Optionally, determining the maximum CPU utilization of the server based on the correspondence between the CPU utilization rate and the actual power consumption of the entire machine and the average CPU utilization rate of the server includes:

[0121] The maximum CPU utilization of the server is determined based on the average CPU utilization of the server and the corrected power consumption.

[0122] The method for determining the maximum CPU utilization of a server according to embodiments of the present invention can determine the nonlinear relationship between CPU utilization and actual power consumption of the whole machine. The algorithm is simple and saves server energy consumption by determining the maximum CPU utilization of the server, thereby reducing server energy consumption while ensuring business processing efficiency.

[0123] Optionally, the method for determining the maximum CPU utilization of the server further includes:

[0124] When the CPU utilization of the server exceeds the maximum CPU utilization, the maximum CPU utilization is released and a warning is issued.

[0125] The purpose of calculating the average CPU utilization here is to determine the current daily usage status of the server.

[0126] In one embodiment of the present invention, if the historical CPU utilization of the server does not change significantly, a maximum CPU utilization rate is set to ensure the server operates within this range. However, if the instantaneous CPU utilization rate exceeds the maximum CPU utilization rate, the maximum CPU utilization rate is released and a warning is issued to ensure smooth server operation. Simultaneously, based on the warning information, the server's CPU utilization rate is monitored in real time. When the server's CPU utilization rate falls below the maximum CPU utilization rate, the maximum CPU utilization rate is reset.

[0127] The method for determining the maximum CPU utilization of a server in this embodiment of the invention ensures the overall operation of the server while saving the server's overall energy consumption by releasing the maximum CPU utilization and issuing an early warning when the instantaneous CPU utilization exceeds the maximum CPU utilization.

[0128] like Figure 2 The above refers to a comparison chart of the changes in overall energy consumption of different servers within the same business cluster belonging to the same manufacturer, after setting the maximum CPU utilization rate of the servers using the method for determining the maximum CPU utilization rate of the servers in this embodiment of the invention.

[0129] like Figure 3 The above refers to the energy saving percentage of a certain server model under different CPU utilization rates.

[0130] Depend on Figure 2 and Figure 3 As can be seen, compared with the method of determining the maximum CPU utilization of the server using the embodiments of the present invention, the server's energy consumption is significantly reduced from low to high CPU utilization.

[0131] like Figure 4 As shown, the apparatus 400 for determining the maximum CPU utilization of a server according to an embodiment of the present invention includes:

[0132] The acquisition module 401 is used to acquire the CPU utilization and total power consumption of the server within a preset time period.

[0133] The first determining module 402 is used to determine the correspondence between the CPU utilization rate and the actual power consumption of the whole machine based on the CPU utilization rate and the total power consumption.

[0134] The second determining module 403 is used to determine the average CPU utilization of the server based on the CPU utilization of the server within the preset time period.

[0135] The third determining module 404 is used to determine the maximum CPU utilization of the server based on the correspondence between the CPU utilization rate and the actual power consumption of the whole machine and the average CPU utilization rate of the server.

[0136] The apparatus for determining the maximum CPU utilization of a server according to embodiments of the present invention determines the maximum CPU utilization of the server by calculating the relationship between the server's CPU utilization and the actual power consumption of the entire machine, as well as the average CPU utilization of the server. The solution of the present invention can determine the non-linear relationship between CPU utilization and the actual power consumption of the entire machine. The algorithm is simple, and by determining the maximum CPU utilization of the server, server energy consumption is saved, reducing server energy consumption while ensuring business processing efficiency.

[0137] Optionally, the first determining module is further configured to:

[0138] Based on the server's CPU utilization and overall power consumption within the preset time period, the server's base power consumption and CPU power consumption are determined.

[0139] Wherein, the server's base power consumption = the server's total power consumption - CPU power consumption;

[0140] The CPU power consumption = power consumption impact factor × CPU utilization rate at the current moment;

[0141] The actual power consumption of the server is equal to the server's base power consumption plus the CPU power consumption plus the correction power consumption.

[0142] The method for determining the maximum CPU utilization of a server according to embodiments of the present invention determines the nonlinear relationship between CPU utilization and actual power consumption of the entire machine by using the CPU utilization of the server at the previous moment. The algorithm is simple and highly reliable.

[0143] Optionally, a correction factor is determined based on the difference between the CPU utilization rate of the server at the previous moment and the CPU utilization rate at the current moment, the CPU utilization rate of the server within the preset time period, and the total power consumption of the machine.

[0144] The corrected power consumption = correction factor × CPU utilization rate at the previous moment.

[0145] The method for determining the maximum CPU utilization of a server in this embodiment of the invention introduces a correction factor to eliminate the influence of the CPU utilization at the previous moment on the CPU utilization at the time of data collection, thereby improving the accuracy of the correspondence between the server's total power consumption and CPU utilization.

[0146] Optionally, determining the correction factor based on the difference between the server's CPU utilization at the previous moment and the current moment, the server's CPU utilization during the preset time period, and the overall power consumption includes:

[0147] When the CPU utilization of the server at the current moment is in the first interval and the first difference is positive, the correction factor is the first value, and the first difference is the difference between the CPU utilization of the server at the previous moment and the CPU utilization at the current moment.

[0148] When the CPU utilization of the server at the current moment is in the first interval and the first difference is negative, the correction factor is the second value;

[0149] When the CPU utilization of the server at the current moment is in the second interval and the first difference is positive, the correction factor is the third value;

[0150] When the CPU utilization of the server at the current moment is in the second interval and the first difference is negative, the correction factor is the fourth value;

[0151] When the CPU utilization of the server at the current moment is in the third interval and the first difference is positive, the correction factor is the fifth value;

[0152] When the CPU utilization of the server at the current moment is in the third interval and the first difference is negative, the correction factor is the sixth value;

[0153] When the CPU utilization of the server at the current moment is in the fourth interval and the first difference is positive, the correction factor is the seventh value;

[0154] When the CPU utilization of the server at the current moment is in the fourth interval and the first difference is negative, the correction factor is the eighth value;

[0155] The first interval, the second interval, the third interval, and the fourth interval increase sequentially, and the first interval, the second interval, the third interval, and the fourth interval cover 0 to 100%.

[0156] The method for determining the maximum CPU utilization of a server according to embodiments of the present invention can determine the nonlinear relationship between CPU utilization and actual power consumption of the whole machine. The algorithm is simple and saves server energy consumption by determining the maximum CPU utilization of the server, thereby reducing server energy consumption while ensuring business processing efficiency.

[0157] Optionally, the third determining module is further configured to:

[0158] The maximum CPU utilization of the server is determined based on the average CPU utilization of the server and the corrected power consumption.

[0159] Optionally, the device further includes:

[0160] The release module is used to release the maximum CPU utilization and issue a warning when the CPU utilization of the server exceeds the maximum CPU utilization.

[0161] The method for determining the maximum CPU utilization of a server in this embodiment of the invention ensures the overall operation of the server while saving the server's overall energy consumption by releasing the maximum CPU utilization and issuing an early warning when the instantaneous CPU utilization exceeds the maximum CPU utilization.

[0162] like Figure 5 As shown, a terminal device 500 according to an embodiment of the present invention includes a first processor 510 and a transceiver 520, wherein,

[0163] The transceiver 520 is used to obtain the CPU utilization rate and total power consumption of the server within a preset time period.

[0164] The first processor 510 is used to determine the correspondence between the CPU utilization rate and the actual power consumption of the whole machine based on the CPU utilization rate and the total power consumption of the whole machine;

[0165] The average CPU utilization of the server is determined based on the CPU utilization of the server within the preset time period;

[0166] Based on the correlation between CPU utilization and actual power consumption of the entire machine and the average CPU utilization of the server, the maximum CPU utilization of the server is determined.

[0167] The terminal device of this invention determines the maximum CPU utilization of the server by calculating the relationship between the server's CPU utilization and the actual power consumption of the entire machine, as well as the average CPU utilization of the server. The solution of this invention can determine the non-linear relationship between CPU utilization and the actual power consumption of the entire machine. The algorithm is simple, and by determining the maximum CPU utilization of the server, it achieves energy savings for the server, reducing server energy consumption while ensuring business processing efficiency.

[0168] Optionally, the first processor 510 is further configured to:

[0169] Based on the server's CPU utilization and overall power consumption within the preset time period, the server's base power consumption and CPU power consumption are determined.

[0170] Wherein, the total power consumption of the server = the basic power consumption of the server + the CPU power consumption;

[0171] The CPU power consumption = power consumption impact factor × CPU utilization rate at the current moment;

[0172] The actual power consumption of the server is equal to the server's base power consumption plus the CPU power consumption plus the correction power consumption.

[0173] Optionally, the first processor 510 is further configured to:

[0174] The maximum CPU utilization of the server is determined based on the average CPU utilization of the server and the corrected power consumption.

[0175] Optionally, the first processor 510 is further configured to:

[0176] When the CPU utilization of the server exceeds the maximum CPU utilization, the maximum CPU utilization is released and a warning is issued.

[0177] Another embodiment of the present invention provides a terminal device, such as... Figure 6 As shown, it includes a transceiver 610, a second processor 600, a memory 620, and a program or instructions stored in the memory 620 and executable on the second processor 600; when the second processor 600 executes the program or instructions, it implements the above-described method for determining the maximum CPU utilization of a server.

[0178] The transceiver 610 is used to receive and send data under the control of the second processor 600.

[0179] Among them, Figure 6 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by the second processor 600 and the memory represented by the memory 620. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 610 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. For different user equipment, the user interface 630 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0180] The second processor 600 is responsible for managing the bus architecture and general processing, while the memory 620 can store the data used by the second processor 600 when performing operations.

[0181] An embodiment of the present invention provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the steps in the method for determining the maximum CPU utilization of a server as described above, and achieve the same technical effect. To avoid repetition, the details will not be repeated here.

[0182] The processor mentioned above is the processor in the terminal device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0183] It should be further noted that the terminals described in this specification include, but are not limited to, smartphones, tablets, etc., and many of the functional components described are referred to as modules in order to emphasize the independence of their implementation.

[0184] In this embodiment of the invention, the module can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.

[0185] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable type of data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.

[0186] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.

[0187] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values ​​includes the upper and lower limits of the range and any subranges in between.

[0188] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method of determining CPU maximum usage of a server, characterized by, The method comprises: acquiring CPU usage and overall power consumption of a server in a preset time period; determining a correspondence between the CPU usage and actual overall power consumption of the server according to the CPU usage and overall power consumption; determining an average CPU usage of the server according to the CPU usage of the server in the preset time period; wherein the correspondence between the CPU usage and actual overall power consumption of the server is: actual overall power consumption of the server = basic power consumption of the server + CPU power consumption + correction power consumption; the correction power consumption = correction factor x CPU usage at a previous time point; determining a maximum CPU usage of the server according to the correspondence between the CPU usage and actual overall power consumption of the server and the average CPU usage of the server; wherein the correction factor is determined according to a difference between CPU usage at a previous time point and CPU usage at a current time point of the server, the CPU usage and overall power consumption of the server in the preset time period, wherein: when the CPU usage at the current time point of the server is in a first interval and the first difference is positive, the correction factor is a first value, and the first difference is the difference between the CPU usage at the previous time point and the CPU usage at the current time point of the server; when the CPU usage at the current time point of the server is in the first interval and the first difference is negative, the correction factor is a second value; when the CPU usage at the current time point of the server is in a second interval and the first difference is positive, the correction factor is a third value; when the CPU usage at the current time point of the server is in the second interval and the first difference is negative, the correction factor is a fourth value; when the CPU usage at the current time point of the server is in a third interval and the first difference is positive, the correction factor is a fifth value; when the CPU usage at the current time point of the server is in the third interval and the first difference is negative, the correction factor is a sixth value; when the CPU usage at the current time point of the server is in a fourth interval and the first difference is positive, the correction factor is a seventh value; when the CPU usage at the current time point of the server is in the fourth interval and the first difference is negative, the correction factor is an eighth value; wherein the first interval, the second interval, the third interval and the fourth interval are sequentially increasing, and the first interval, the second interval, the third interval and the fourth interval cover 0-100%.

2. The method of determining CPU maximum usage of a server according to claim 1, wherein, The method comprises: determining the basic power consumption and CPU power consumption of the server according to the CPU usage and overall power consumption of the server in the preset time period; wherein the basic power consumption of the server = overall power consumption of the server - CPU power consumption; the CPU power consumption = power consumption influence factor x CPU usage at a current time point.

3. The method of determining CPU maximum usage of a server according to claim 1, wherein, The CPU maximum usage of the server is determined according to the correspondence between the CPU usage and the actual power consumption of the whole machine and the CPU average usage of the server. The CPU maximum usage of the server is determined according to the CPU average usage of the server and the correction power consumption.

4. The method of determining CPU maximum usage of a server according to claim 1, wherein, The method further comprises: When the CPU usage of the server is greater than the CPU maximum usage, the CPU maximum usage is released, and a pre-warning prompt is issued.

5. An apparatus for determining CPU maximum usage of a server, the apparatus comprising: The method comprises The CPU usage of the server and the whole machine power consumption in a preset time period are acquired. A first determination module is configured to determine the correspondence between the CPU usage and the actual power consumption of the whole machine according to the CPU usage and the whole machine power consumption, wherein the correspondence between the CPU usage and the actual power consumption of the whole machine is: the actual power consumption of the whole machine of the server = the basic power consumption of the server + CPU power consumption + correction power consumption; and the correction power consumption = correction factor * CPU usage at a previous time. A second determination module is configured to determine the CPU average usage of the server according to the CPU usage of the server in the preset time period. A third determination module is configured to determine the CPU maximum usage of the server according to the correspondence between the CPU usage and the actual power consumption of the whole machine and the CPU average usage of the server. The correction factor is determined according to the difference between the CPU usage at the previous time and the CPU usage at the current time, the CPU usage of the server in the preset time period and the whole machine power consumption, wherein: When the CPU usage of the server at the current time is in a first interval, and the first difference is positive, the correction factor is a first value, and the first difference is the difference between the CPU usage of the server at the previous time and the CPU usage at the current time. When the CPU usage of the server at the current time is in the first interval, and the first difference is negative, the correction factor is a second value. When the CPU usage of the server at the current time is in a second interval, and the first difference is positive, the correction factor is a third value. When the CPU usage of the server at the current time is in the second interval, and the first difference is negative, the correction factor is a fourth value. When the CPU usage of the server at the current time is in a third interval, and the first difference is positive, the correction factor is a fifth value. When the CPU usage of the server at the current time is in the third interval, and the first difference is negative, the correction factor is a sixth value. When the CPU usage of the server at the current time is in a fourth interval, and the first difference is positive, the correction factor is a seventh value. When the CPU usage of the server at the current time is in the fourth interval, and the first difference is negative, the correction factor is an eighth value. The first interval, the second interval, the third interval and the fourth interval are sequentially increased, and the first interval, the second interval, the third interval and the fourth interval cover 0 to 100%.

6. The apparatus for determining CPU maximum usage of a server according to claim 5, wherein, The first determination module is further configured to: According to the CPU usage rate and the whole machine power consumption of the server in the preset time period, the base power consumption and the CPU power consumption of the server are determined; The base power consumption of the server = the whole machine power consumption of the server - CPU power consumption; The CPU power consumption = power consumption influence factor * current time CPU usage rate.

7. The apparatus for determining CPU maximum usage of a server according to claim 5, wherein, The third determination module is further configured to: According to the CPU average usage rate of the server and the correction power consumption, the CPU maximum usage rate of the server is determined.

8. The apparatus for determining CPU maximum usage of a server according to claim 5, wherein, The device further comprises: The release module is configured to release the CPU maximum usage rate when the CPU usage rate of the server is greater than the CPU maximum usage rate, and issue a warning prompt.

9. A terminal device, comprising: Comprise: Transceiver and first processor; The transceiver is configured to acquire the CPU usage rate and the whole machine power consumption of the server in a preset time period; The first processor is configured to determine the corresponding relationship between the CPU usage rate and the whole machine actual power consumption according to the CPU usage rate and the whole machine power consumption; wherein the corresponding relationship between the CPU usage rate and the whole machine actual power consumption is: the whole machine actual power consumption of the server = base power consumption of the server + CPU power consumption + correction power consumption; the correction power consumption = correction factor * CPU usage rate at the previous time; According to the CPU usage rate of the server in the preset time period, the CPU average usage rate of the server is determined; According to the corresponding relationship between the CPU usage rate and the whole machine actual power consumption and the CPU average usage rate of the server, the CPU maximum usage rate of the server is determined; The correction factor is determined according to the difference between the CPU usage rate at the previous time and the CPU usage rate at the current time, the CPU usage rate and the whole machine power consumption of the server in the preset time period, wherein: When the CPU usage rate of the server at the current time is in the first interval, and the first difference is positive, the correction factor is a first value, and the first difference is the difference between the CPU usage rate at the previous time and the CPU usage rate at the current time; When the CPU usage rate of the server at the current time is in the first interval, and the first difference is negative, the correction factor is a second value; When the CPU usage rate of the server at the current time is in the second interval, and the first difference is positive, the correction factor is a third value; When the CPU usage rate of the server at the current time is in the second interval, and the first difference is negative, the correction factor is a fourth value; When the CPU usage rate of the server at the current time is in the third interval, and the first difference is positive, the correction factor is a fifth value; When the CPU usage rate of the server at the current time is in the third interval, and the first difference is negative, the correction factor is a sixth value; When the CPU usage rate of the server at the current time is in the fourth interval, and the first difference is positive, the correction factor is a seventh value; When the CPU usage rate of the server at the current time is in the fourth interval, and the first difference is negative, the correction factor is an eighth value; The first interval, the second interval, the third interval and the fourth interval are sequentially increased, and the first interval, the second interval, the third interval and the fourth interval cover 0 to 100%.

10. A terminal device comprising: The transceiver, a second processor, a memory, and a program or instructions stored on the memory and executable on the second processor; wherein the second processor implements the method for determining the CPU maximum usage rate of the server according to any one of claims 1-4 when executing the program or instructions.

11. A readable storage medium, on which a program or instructions are stored, characterized in that, The program or instructions are executed by the processor to implement the steps in the method for determining the CPU maximum usage rate of the server according to any one of claims 1-4.

Citation Information

Patent Citations

  • Server platform power consumption optimizing method and device

    CN108121638A