Disclosure of Invention
The application aims to provide a server energy-saving method, a server energy-saving device, an electronic device and a computer-readable storage medium, so that the energy consumption of a server is reduced on the basis of reducing the cost of electric charges.
In order to achieve the above object, the present application provides a server energy saving method, including:
monitoring the load condition of each server node in the multi-node server;
determining a target server node needing to be dormant according to the load condition obtained by monitoring;
and sending a sleep instruction to the target server node to enable the target server node to stop all services and enter a sleep mode.
Optionally, the monitoring the load condition of each server node in the multi-node server includes:
monitoring the mainboard load capacity, and/or the processor power consumption, and/or the processor frequency, and/or the memory frequency, and/or the network bandwidth, and/or the overall power consumption of each server node in the multi-node server to obtain power consumption data;
and storing the power consumption data into a memory, and recording the time corresponding to the power consumption data.
Optionally, the determining, according to the monitored load condition, a target server node that needs to be dormant includes:
generating a power consumption curve of each server node according to the power consumption data of each server node monitored in a preset time period;
and determining the server node with the mainboard load amount lower than a first preset threshold value as a target server node needing to be dormant according to the power consumption curve.
Optionally, the sending a sleep instruction to the target server node to enable the target server node to stop all services includes:
according to the power consumption curve, determining a target time period of the target server node when the load of the mainboard is lower than a first preset threshold;
distributing the service to be processed of the target server node in the target time period to other server nodes;
and sending a sleep instruction to the target server node at regular time according to the target time period so as to enable the target server node to stop all services.
Optionally, after the sending the sleep instruction to the target server node according to the target time period, the method further includes:
and sending a service awakening instruction to the target server node after the target time period is monitored to be ended so that the target server node exits the sleep mode.
Optionally, after monitoring the load condition of each server node in the multi-node server, the method further includes:
determining a server node to be subjected to frequency reduction with the load exceeding a second preset threshold according to the load condition of each server node obtained through monitoring;
determining a low-load server node capable of receiving the service based on a load balancing strategy;
and scheduling part of the to-be-processed services of the to-be-reduced frequency server node to the low-load server node for processing.
In order to achieve the above object, the present application provides a server energy saving device, including:
the load monitoring module is used for monitoring the load condition of each server node in the multi-node server;
the target determining module is used for determining a target server node which needs to be dormant according to the load condition obtained by monitoring;
and the node dormancy module is used for sending a dormancy instruction to the target server node so that the target server node stops all services and enters a dormancy mode.
Optionally, the method further includes:
the first determining module is used for determining the server nodes to be subjected to frequency reduction with the load exceeding a second preset threshold according to the load condition of each server node obtained through monitoring;
the second determining module is used for determining a low-load server node capable of receiving the service based on the load balancing strategy;
and the service scheduling module is used for scheduling part of the services to be processed of the server nodes to be subjected to frequency reduction to the low-load server nodes for processing.
To achieve the above object, the present application provides an electronic device including:
a memory for storing a computer program;
a processor for implementing the steps of any of the server power saving methods disclosed above when executing the computer program.
To achieve the above object, the present application provides a computer-readable storage medium having a computer program stored thereon, which when executed by a processor, implements the steps of any of the server power saving methods disclosed in the foregoing.
According to the scheme, the server energy saving method provided by the application comprises the following steps: monitoring the load condition of each server node in the multi-node server; determining a target server node needing to be dormant according to the load condition obtained by monitoring; and sending a sleep instruction to the target server node to enable the target server node to stop all services and enter a sleep mode. Therefore, the server nodes are provided, the load conditions of the server nodes can be monitored, the target server nodes can be conveniently determined to be dormant according to the load conditions of the server nodes, the problems of high energy consumption and high cost caused by the fact that the server always works in a high-performance mode are avoided, more precise energy-saving regulation and control requirements can be met, and the energy consumption of the server is reduced on the basis of reducing the cost of electric charges.
The application also discloses a server energy-saving device, an electronic device and a computer readable storage medium, which can also realize the technical effects.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the conventional technology, the server processes the task in the high-performance working mode, no matter the data access of a large amount of data during the peak period of a large task amount or the data access of a small amount of data of a small task block. In this operating mode, the server consumes the maximum amount of energy regardless of the load of the client, which not only wastes the energy provided by the server, but also consumes more electric power, resulting in a substantial increase in electricity cost.
Therefore, the embodiment of the application discloses a server energy-saving method, which is used for reducing the energy consumption of a server on the basis of reducing the cost of electricity charges.
Referring to fig. 1, a server energy saving method disclosed in an embodiment of the present application includes:
s101: monitoring the load condition of each server node in the multi-node server;
in the embodiment of the application, the power consumption states of all parts of the current multi-node server system and the load of each server mainboard node can be monitored. In specific implementation, the main board load capacity, and/or the processor power consumption, and/or the processor frequency, and/or the memory frequency, and/or the network bandwidth, and/or the overall power consumption of each server node in the multi-node server may be monitored to obtain corresponding power consumption data.
It can be understood that, when monitoring the load condition of each server node, a regular monitoring mode may be specifically adopted, that is, the load condition of each server node is obtained at regular time according to a certain time interval, and of course, a real-time monitoring mode may also be adopted, which is not specifically limited in this embodiment of the present application.
After the server node is monitored and the corresponding power consumption data are obtained, the power consumption data can be stored in the memory, and the time corresponding to the power consumption data is recorded, so that the subsequent backtracking analysis can be conveniently carried out.
S102: determining a target server node needing to be dormant according to the load condition obtained by monitoring;
in this step, it may be determined whether a target server that needs to be dormant exists in all the server nodes according to the load condition of each server node monitored in the above step. Specifically, the target server node that needs to be dormant may be a server node with a smaller or almost zero current load.
S103: and sending a sleep instruction to the target server node to enable the target server node to stop all services and enter a sleep mode.
After determining the target server node which needs to be dormant, the target server node may send a corresponding dormancy instruction to the target server node, and after receiving the dormancy instruction, the target server node stops all services and enters a dormancy mode, thereby reducing waste of power consumption.
When the target server node needs to exit the sleep mode, the target server node can be issued with a corresponding wake-up service instruction, and the target server node can exit the sleep mode.
According to the scheme, the server energy saving method provided by the application comprises the following steps: monitoring the load condition of each server node in the multi-node server; determining a target server node needing to be dormant according to the load condition obtained by monitoring; and sending a sleep instruction to the target server node to enable the target server node to stop all services and enter a sleep mode. Therefore, the server nodes are provided, the load conditions of the server nodes can be monitored, the target server nodes can be conveniently determined to be dormant according to the load conditions of the server nodes, the problems of high energy consumption and high cost caused by the fact that the server always works in a high-performance mode are avoided, more precise energy-saving regulation and control requirements can be met, and the energy consumption of the server is reduced on the basis of reducing the cost of electric charges.
The embodiment of the application discloses another server energy saving method, and compared with the previous embodiment, the embodiment further explains and optimizes the technical scheme. Referring to fig. 2, specifically:
s201: monitoring the load condition of each server node in the multi-node server;
s202: generating a power consumption curve of each server node according to the power consumption data of each server node monitored in a preset time period;
in the embodiment of the application, the power consumption data of each server node is obtained by monitoring the load condition of each server node in the multi-node server, the collected power consumption data can be counted, and the power consumption data of each server node in the preset time period is used for generating the corresponding power consumption curve. It should be noted that the power consumption curve is specifically a curve representing a relationship between the power consumption of the server node and time, and the preset time period may be set according to actual conditions in specific implementation, for example, may be set to 12 hours, one day, one week, and the like.
S203: according to the power consumption curve, determining the server node with the mainboard load lower than a first preset threshold value as a target server node needing to be dormant;
after the power consumption curves corresponding to the server nodes are obtained, whether a node with a mainboard load lower than a first preset threshold exists in all the server nodes or not can be screened, and the node is determined as a target server node needing to be dormant. The first preset threshold may be set in specific implementation, and is not limited to a specific value.
S204: according to the power consumption curve, determining a target time period of the target server node when the load of the mainboard is lower than a first preset threshold;
it can be understood that after the target server nodes needing to be dormant are screened out, the target time period in which the target server nodes are located when the load of the main board is lower than the first preset threshold needs to be determined, that is, the time period in which the target server nodes need to be dormant is determined.
S205: distributing the service to be processed of the target server node in the target time period to other server nodes;
s206: and sending a sleep instruction to the target server node at regular time according to the target time period so as to enable the target server node to stop all services.
In the embodiment of the application, the to-be-processed service of the target server node in the target time period can be distributed to other server nodes for processing, so that when the target time period is reached, the target server node can be sent with a sleep instruction at regular time, the target server node can enter a sleep mode, and power consumption and power cost consumed by the target server node can be saved.
It can be understood that, after the target server node enters the sleep mode, the sleep time may be monitored, and if it is monitored that the target time period is over, a wake-up service instruction may be sent to the target server node, so that the target server node exits the sleep mode.
The embodiment of the application discloses another energy-saving method for a server, and compared with the previous embodiment, the embodiment further describes and optimizes the technical scheme. Referring to fig. 3, specifically:
s301: monitoring the load condition of each server node in the multi-node server;
s302: determining a server node to be subjected to frequency reduction with the load exceeding a second preset threshold according to the load condition of each server node obtained through monitoring;
in the embodiment of the application, the load condition of each server node is monitored, and then the nodes with the loads exceeding the second preset threshold are screened out according to the load condition of each server node and serve as the server nodes to be subjected to frequency reduction. The second preset threshold may be set according to actual requirements in a specific implementation process, which is not limited in this embodiment.
S303: determining a low-load server node capable of receiving the service based on a load balancing strategy;
s304: and scheduling part of the to-be-processed services of the to-be-reduced frequency server node to the low-load server node for processing.
As a preferred embodiment, the present application further provides a load balancing function, that is, a task to be processed of a node with a higher load can be distributed to other server nodes with a lower load for processing, so as to reduce the pressure of the node with a higher load. In a specific implementation process, a server node with a lower load capacity, for example, a server node with a load capacity lower than a third preset threshold may be determined as a node that can receive a service, so as to schedule a task of a high-load node to a server node with a low load.
It should be noted that, when scheduling the to-be-processed service of the high-load node to the low-load server node, the total task amount that needs to be distributed and scheduled may be determined first, the server nodes whose load amounts are lower than the third preset threshold are screened out and arranged in the order from low to high according to the load amounts, and then the difference between the current load amount of the selected server node and the third preset threshold is calculated, and the distribution and scheduling of the to-be-processed task are performed based on the difference and the total task amount, for example, tasks may be relatively uniformly distributed to each low-load server node in proportion.
The server energy saving system provided by the embodiment of the present application is introduced through a specific implementation scenario. In particular, the following problems mainly exist in terms of energy consumption in consideration of the servers of the current data center: the existing server works in a high-performance mode to process tasks, so that the power consumption of the server is high in the working mode; the existing client cannot realize low-power design on the basis of the existing server; the existing power consumption control strategy is single and cannot meet the low power consumption control strategy of a client service end. An embodiment of the present application provides a server energy saving system, and as shown in fig. 4, the system may specifically include a four-subsatellite host system (four motherboard systems), a power consumption controller, a state monitor, a load balancing controller, and an energy consumption management module, so as to form a complete energy consumption management closed loop with monitoring, tuning, and controlling functions.
It should be noted that the power consumption controller is configured to implement a power consumption control policy of the four-subsatellite system, for example, limit the processor power consumption of each node according to a load condition, limit the processor frequency, limit the memory frequency, limit the network bandwidth, and limit the overall power consumption; the state monitor is used for monitoring the power consumption states of all parts of the current multi-node server system and the load of each mainboard node and storing the power consumption states and the load in real time; the load balancing controller is used for adjusting the power consumption of the four nodes of the four-subsatellite system until a balancing control strategy is implemented; and the energy consumption management module is used for interacting the data acquired by the power consumption controller, the condition monitoring monitor and the load balancer and adjusting an optimal power consumption regulation and control strategy.
According to the scheduling of the energy consumption management module, when a certain node of the four-subsatellite system needs to enter a sleep mode, the energy consumption management module sends all services to the mainboard node through the load balancing management module and the power consumption controller, and sends a corresponding sleep instruction through the control interface. And when the node receives the sleep command, the node enters a sleep mode. When the sleeping node needs to exit the sleeping mode, the energy consumption management module issues a wake-up service request to the sleeping node through the load balancing management module and the power consumption controller, and issues a wake-up instruction through the control interface. And the node of the four subsategories receiving the awakening instruction exits the sleep mode.
In the embodiment of the application, the energy consumption management module can realize automatic monitoring, automatic triggering and automatic tuning control according to the load operation condition, and the problem that the conventional server power consumption management system can only be in a high-performance working mode or the whole server can sleep is solved. For example, according to the monitored load condition of the four-subsatellite node, energy-saving operations such as dormancy and the like can be performed on a certain node, so that the problem of high power consumption caused by a server in a high-performance working mode is solved.
Further, as a preferred implementation manner, the system provided in the embodiment of the present application may adopt dual input in power module design, and both ac and dc can be supported and switched through an internal switch. If the current input is direct current, the energy conversion efficiency of the power supply module in the four-subsatellite can be improved. The automatic identification function of the change-over switch is switched to the direct current DC 380Vdc and DC 12Vdc lines, so that the power conversion efficiency in the power supply process is improved, the power consumption of the server is reduced, and the processing capacity of the server is improved.
In the following, a server energy saving device provided by an embodiment of the present application is introduced, and a server energy saving device described below and a server energy saving method described above may be referred to each other.
Referring to fig. 5, an energy saving device for a server according to an embodiment of the present application includes:
a load monitoring module 401, configured to monitor a load condition of each server node in a multi-node server;
a target determining module 402, configured to determine, according to the monitored load condition, a target server node that needs to be dormant;
a node dormancy module 403, configured to send a dormancy instruction to the target server node, so that the target server node stops all services and enters a dormancy mode.
For the specific implementation process of the modules 401 to 403, reference may be made to the corresponding content disclosed in the foregoing embodiments, and details are not repeated here.
On the basis of the foregoing embodiment, as a preferred implementation manner, the server energy saving device provided in the embodiment of the present application may further include:
the first determining module is used for determining the server nodes to be subjected to frequency reduction with the load exceeding a second preset threshold according to the load condition of each server node obtained through monitoring;
the second determining module is used for determining a low-load server node capable of receiving the service based on the load balancing strategy;
and the service scheduling module is used for scheduling part of the services to be processed of the server nodes to be subjected to frequency reduction to the low-load server nodes for processing.
The present application further provides an electronic device, and as shown in fig. 6, an electronic device provided in an embodiment of the present application includes:
a memory 100 for storing a computer program;
the processor 200, when executing the computer program, may implement the steps provided by the above embodiments.
Specifically, the memory 100 includes a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions, and the internal memory provides an environment for the operating system and the computer-readable instructions in the non-volatile storage medium to run. The processor 200 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments, and provides computing and controlling capability for the electronic device, and when executing the computer program stored in the memory 100, the server power saving method disclosed in any of the foregoing embodiments may be implemented.
On the basis of the above embodiment, as a preferred implementation, referring to fig. 7, the electronic device further includes:
and an input interface 300 connected to the processor 200, for acquiring computer programs, parameters and instructions imported from the outside, and storing the computer programs, parameters and instructions into the memory 100 under the control of the processor 200. The input interface 300 may be connected to an input device for receiving parameters or instructions manually input by a user. The input device may be a touch layer covered on a display screen, or a button, a track ball or a touch pad arranged on a terminal shell, or a keyboard, a touch pad or a mouse, etc.
And a display unit 400 connected to the processor 200 for displaying data processed by the processor 200 and for displaying a visualized user interface. The display unit 400 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like.
And a network port 500 connected to the processor 200 for performing communication connection with each external terminal device. The communication technology adopted by the communication connection can be a wired communication technology or a wireless communication technology, such as a mobile high definition link (MHL) technology, a Universal Serial Bus (USB), a High Definition Multimedia Interface (HDMI), a wireless fidelity (WiFi), a bluetooth communication technology, a low power consumption bluetooth communication technology, an ieee802.11 s-based communication technology, and the like.
Fig. 7 shows only an electronic device having components 100-500, and those skilled in the art will appreciate that the structure shown in fig. 7 does not constitute a limitation of the electronic device, and may include fewer or more components than shown, or some components in combination, or a different arrangement of components.
The present application also provides a computer-readable storage medium, which may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk. The storage medium stores thereon a computer program which, when executed by a processor, implements the server power saving method disclosed in any of the foregoing embodiments.
The application provides a plurality of server nodes to can monitor the load condition of each server node, so that the target server node in the server nodes can be determined to be dormant according to the load condition of each server node, the problems of high energy consumption and high cost caused by the fact that the server always works in a high-performance mode are avoided, more detailed energy-saving regulation and control requirements can be met, and the energy consumption of the server is reduced on the basis of reducing the cost of electric charges.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.