Movatterモバイル変換


[0]ホーム

URL:


CN111444015A - Server control method and device, computer equipment and storage medium - Google Patents

Server control method and device, computer equipment and storage medium
Download PDF

Info

Publication number
CN111444015A
CN111444015ACN202010215806.8ACN202010215806ACN111444015ACN 111444015 ACN111444015 ACN 111444015ACN 202010215806 ACN202010215806 ACN 202010215806ACN 111444015 ACN111444015 ACN 111444015A
Authority
CN
China
Prior art keywords
average
utilization rate
server
servers
equal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010215806.8A
Other languages
Chinese (zh)
Inventor
赫振军
周正
王杨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co LtdfiledCriticalBeijing QIYI Century Science and Technology Co Ltd
Priority to CN202010215806.8ApriorityCriticalpatent/CN111444015A/en
Publication of CN111444015ApublicationCriticalpatent/CN111444015A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The embodiment of the invention relates to a control method and a control device of a server, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring average resource utilization rate and average garbage recovery frequency corresponding to one or more servers; determining an expansion/contraction strategy corresponding to the server based on the average resource utilization rate, the average garbage recovery frequency and a preset expansion/contraction rule; based on the capacity expansion/reduction strategy, the number of the servers is controlled, the capacity expansion/reduction strategy of the servers is determined through the average resource utilization rate and the average garbage recovery frequency of the servers, the dynamic adjustment of the number of the servers is realized, the servers can efficiently process data requests of clients under the condition of no overload, and the service efficiency is improved; and the resource waste caused by too many idle servers can be avoided.

Description

Server control method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of internet, in particular to a server control method and device, computer equipment and a storage medium.
Background
In the internet field, a server needs to respond to and process a large number of client requests at any time, so that the existing server may not be able to respond to and process the client requests in time, and at this time, the server needs to be manually added for many times for capacity expansion, however, because the manual work cannot determine when the server needs to be increased or decreased and the number of the servers needs to be increased or decreased, the service performance is deteriorated, and the system is unstable.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a method and an apparatus for controlling a server, a computer device, and a storage medium to solve the above technical problems or some of the technical problems.
In a first aspect, an embodiment of the present invention provides a method for controlling a server, including:
acquiring average resource utilization rate and average garbage recovery frequency corresponding to one or more servers;
determining an expansion/contraction strategy corresponding to the server based on the average resource utilization rate, the average garbage recovery frequency and a preset expansion/contraction rule;
and controlling the number of the servers based on the capacity expansion/reduction strategy.
In one possible embodiment, the method further comprises:
the average resource utilization rate includes a Central Processing Unit (CPU) utilization rate, a memory utilization rate, and an Input/Output (I/O) utilization rate;
if the proportion of the average CPU utilization rate to the average resource utilization rate of the server is greater than or equal to a first threshold value, the average memory utilization rate to the average memory utilization rate is greater than or equal to a second threshold value, the average I/O utilization rate to the average I/O utilization rate is greater than or equal to a third threshold value, and the average garbage collection frequency is greater than or equal to a fourth threshold value is greater than or equal to a fifth threshold value, determining to expand the capacity of the server;
and in a set time, if the average CPU utilization rate, the average memory utilization rate, the average I/O utilization rate and the average garbage collection frequency in the average resource utilization rates of the server are smaller than a first threshold, a second threshold and a fourth threshold, determining to reduce the capacity of the server.
In one possible embodiment, the method further comprises:
and if the average CPU utilization rate in the average resource utilization rate of the server is greater than or equal to a first threshold value, determining to expand the server.
In one possible embodiment, the method further comprises:
if the capacity of the server is determined to be expanded, determining configuration information corresponding to any one server from one or more servers;
according to the configuration information, one server is gradually added to one or more servers, so that the occupation ratio of the average CPU utilization rate in the average resource utilization rates of the servers to be greater than or equal to a first threshold value, the average memory utilization rate to be greater than or equal to a second threshold value, the average I/O utilization rate to be greater than or equal to a third threshold value and the average garbage collection frequency to be greater than or equal to a fourth threshold value is smaller than a fifth threshold value, and the average CPU utilization rate to be smaller than the first threshold value.
In one possible embodiment, the method further comprises:
if the capacity reduction of the servers is determined, one server is gradually reduced from the plurality of servers, so that the occupation ratio of the average CPU utilization rate of the average resource utilization rates of the servers, which is greater than or equal to a first threshold value, the average memory utilization rate of the servers, which is greater than or equal to a second threshold value, the average I/O utilization rate of the servers, which is greater than or equal to a third threshold value, and the average garbage collection frequency of the servers, which is greater than or equal to a fourth threshold value, is smaller than a fifth threshold value, the average CPU utilization rate is smaller than the first threshold value, the average memory utilization rate is smaller than the second threshold value, the average I/O utilization rate of the servers, which is smaller than the third threshold value, and the occupation ratio of the average garbage collection frequency of the servers, which.
In one possible embodiment, the method further comprises:
if the server is determined to be subjected to capacity reduction, controlling the number of the servers subjected to capacity reduction to be larger than or equal to the initial number of the servers;
the initial number is the number of the server before capacity expansion is performed.
In one possible embodiment, the method further comprises:
if the capacity of the server is determined, configuring one or more servers to a server cluster formed by one or more current servers according to mirror image information configuring the current server to form a new server cluster, so that the average CPU utilization rate in the average resource utilization rate in the new server cluster is greater than or equal to a first threshold, the average memory utilization rate is greater than or equal to a second threshold, the average I/O utilization rate is greater than or equal to a third threshold, the occupation ratio of the average garbage recycling frequency which is greater than or equal to a fourth threshold is less than a fifth threshold, and the average CPU utilization rate is less than the first threshold.
In a second aspect, an embodiment of the present invention provides a control apparatus for a server, including:
the acquisition module is used for acquiring the average resource information resource utilization rate and the average garbage recovery frequency corresponding to one or more servers;
the determining module is used for determining the capacity expansion/reduction strategy corresponding to the server based on the average resource utilization rate, the average garbage recovery frequency and a preset capacity expansion/reduction rule;
and the control module is used for controlling the number of the servers based on the capacity expansion/reduction strategy.
In a third aspect, an embodiment of the present invention provides a computer device, including: a processor and a memory, the processor being configured to execute a control program of the server stored in the memory to implement the control method of the server according to any one of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a storage medium, including: the storage medium stores one or more programs executable by one or more processors to implement the control method of the server according to any one of the first aspects.
According to the control scheme of the server provided by the embodiment of the invention, the average resource utilization rate and the average garbage recovery frequency corresponding to one or more servers are obtained; determining an expansion/contraction strategy corresponding to the server based on the average resource utilization rate, the average garbage recovery frequency and a preset expansion/contraction rule; controlling the number of the servers based on the capacity expansion/contraction strategy; the capacity expansion/reduction strategy of the server is determined through the capacity expansion/reduction rule preset by the system, the number of the servers is controlled, the dynamic adjustment of the number of the servers can be realized, the server can efficiently process the data request of the client under the condition of no overload, and the service efficiency is improved; and the resource waste caused by too many idle servers can be avoided.
Drawings
Fig. 1 is an application scenario diagram of a control method of a server according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a control method of a server according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of another server control method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a control device of a server according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
For the convenience of understanding of the embodiments of the present invention, the following description will be further explained with reference to specific embodiments, which are not to be construed as limiting the embodiments of the present invention.
Fig. 1 is an application scenario diagram of a control method for a server according to an embodiment of the present invention, and as shown in fig. 1, the application scenario specifically includes: the system comprises at least one client, at least one server and a monitoring system. The client sends a (HyperText Transfer Protocol, HTTP) request to the server, and the server returns a processing result of the request to the client; the monitoring system prestores the capacity expansion/reduction rules of the server, is responsible for monitoring the running state of the server, acquiring the average resource utilization rate and the average garbage recovery frequency of the server, and judging whether the server needs to expand/reduce the capacity according to the average resource utilization rate and the average garbage recovery frequency of the server so as to meet the requirement for processing the client request.
Further, the average resource usage of the server may include:
average Central Processing Unit (CPU) utilization, average memory utilization, and average Input/Output (I/O) utilization.
The following describes a control method of a server in detail with a monitoring system as an execution subject of the present solution.
Fig. 2 is a schematic flowchart of a control method of a server according to an embodiment of the present invention, and as shown in fig. 2, the method specifically includes:
and S21, acquiring the average resource utilization rate and the average garbage collection frequency corresponding to one or more servers.
In the embodiment of the invention, the monitoring system sends a data acquisition request to the server, and the server responds to the data acquisition request and returns the average resource utilization rate and the average garbage collection frequency information of the server to the monitoring system.
The average resource usage of the server may include: average CPU utilization, average memory utilization, and average I/O utilization.
And S22, determining the capacity expansion/reduction strategy corresponding to the server based on the average resource utilization rate, the average garbage collection frequency and a preset capacity expansion/reduction rule.
In the embodiment of the invention, a capacity expansion rule and a capacity reduction rule are preset, and the number of the servers is controlled according to the rules.
Further, judging whether the current server meets an expansion/contraction rule or not according to the obtained average resource utilization rate and the average garbage recycling frequency of the server, and if the current server meets the expansion rule, determining an expansion strategy (increasing the number of servers) corresponding to the server; and if the current server meets the capacity reduction rule, determining a capacity reduction strategy corresponding to the server (reducing the number of the servers).
In an alternative of the embodiment of the present invention, different conditions are correspondingly set for the capacity expansion rule and the capacity reduction rule, and the conditions may be determined according to the average resource utilization rate and the average garbage collection frequency of the server.
For example, when the average resource usage includes resource usage information (CPU average usage, memory average usage, or I/O average usage), a first threshold corresponding to CPU average usage (e.g., 80%) is set, a second threshold corresponding to memory average usage (e.g., 80%) is set, and a third threshold corresponding to I/O average usage (e.g., 80%) is set; a fourth threshold (e.g., 80/s) corresponding to the average garbage collection frequency is set.
Determining conditions corresponding to the conditions meeting the capacity expansion rule based on the above steps includes: the average CPU utilization rate is greater than or equal to a first threshold, the average memory utilization rate is greater than or equal to a second threshold, the average I/O utilization rate is greater than or equal to a third threshold, and the average garbage recycling frequency is greater than or equal to a fourth threshold;
further, determining that the condition corresponding to the contraction and capacity rule is met includes: the average utilization rate of the CPU is smaller than a first threshold value, the average utilization rate of the memory is smaller than a second threshold value, the average utilization rate of the I/O is smaller than a third threshold value, and the average garbage recycling frequency is smaller than a fourth threshold value.
And S23, controlling the number of the servers based on the capacity expansion/reduction strategy.
In the embodiment of the invention, if the capacity expansion strategy corresponding to the server is determined, the number of the servers is increased so as to meet the requirement of processing the client request and improve the service efficiency; and if the capacity reduction strategy corresponding to the server is determined, reducing the number of the servers so as to avoid resource waste.
According to the control method of the server, provided by the embodiment of the invention, the average resource utilization rate and the average garbage recovery frequency of the server are monitored, the capacity expansion/reduction strategy met by the server is judged according to the average resource utilization rate and the average garbage recovery frequency, and the number of the servers is controlled according to the capacity expansion/reduction strategy, so that the dynamic adjustment of the number of the servers is realized, the server can efficiently process the data request of the client under the condition of not overload, and the service efficiency is improved; and the resource waste caused by too many idle servers can be avoided.
Fig. 3 is a schematic flowchart of another method for controlling a server according to an embodiment of the present invention, and as shown in fig. 3, the method specifically includes:
and S31, acquiring the average resource utilization rate and the average garbage collection frequency corresponding to one or more servers.
In the embodiment of the invention, a server receives and processes HTTP requests of a client, in the processing process, the number of the HTTP requests can occupy different average resource utilization rates and average garbage recovery frequencies of the server, an agent is deployed on each server in advance, the average resource utilization rate and the average garbage recovery frequency information of the server are collected in real time/at regular time through the agent, and a monitoring system sends the requests to the agent to obtain the average resource utilization rate and the average garbage recovery frequency information corresponding to the server.
For example, a timer is set in the monitoring system, and a request is sent to the agent at intervals of a set time, so as to obtain the average resource utilization rate and the average garbage collection frequency corresponding to the server.
Further, the average resource usage rate and the average garbage collection frequency obtained from the agent may be stored in the local memory of the monitoring system.
The average resource usage by the server includes: average CPU utilization, average memory utilization, and average I/O utilization.
For example, the average resource usage rate and the average garbage collection frequency acquired at different times may be:
9:00 the average utilization rate of CPU of the server is 10%, the average utilization rate of memory is 30%, the average utilization rate of I/O is 30% and the average garbage collection frequency is 20/s; 9:10, the average utilization rate of the CPU of the server is 30%, the average utilization rate of the memory is 30%, the average utilization rate of the I/O is 50% and the average garbage collection frequency is 50/s; the average CPU utilization rate of the 10:00 server is 60%, the average memory utilization rate is 60%, the average I/O utilization rate is 70% or the average garbage collection frequency is 100/s.
S32, if the ratio of the average CPU utilization rate to the average resource utilization rate of the server to the average memory utilization rate is greater than or equal to a first threshold, the average I/O utilization rate to the average I/O utilization rate is greater than or equal to a third threshold, and the average garbage collection frequency is greater than or equal to a fourth threshold is greater than or equal to a fifth threshold, determining to expand the capacity of the server.
In the embodiment of the present invention, the average resource utilization includes resource utilization information (CPU average utilization, memory average utilization, and I/O average utilization), and a first threshold (e.g., 60%) corresponding to the CPU average utilization, a second threshold (e.g., 60%) corresponding to the memory average utilization, and a third threshold (e.g., 70%) corresponding to the I/O average utilization are set; setting a fourth threshold (for example, 100/s) corresponding to the average garbage recycling frequency; the four parameters are at the fifth threshold (e.g., 75%) corresponding to the percentage of the normal range.
Determining conditions corresponding to the conditions meeting the capacity expansion rule based on the above steps includes:
the average CPU utilization rate, the average memory utilization rate, the average I/O utilization rate and the average garbage collection frequency meet the condition that the occupation ratio of the average CPU utilization rate is greater than or equal to a first threshold value, the average memory utilization rate is greater than or equal to a second threshold value, the average I/O utilization rate is greater than or equal to a third threshold value and the average garbage collection frequency is greater than or equal to a fourth threshold value is greater than or equal to a fifth threshold value;
for example, if the average CPU utilization is greater than or equal to 60%, the average memory utilization is greater than or equal to 60%, the average I/O utilization is greater than or equal to 70%, and the average garbage collection frequency is less than 100/s, the percentage of the average CPU utilization greater than or equal to the first threshold, the average memory utilization greater than or equal to the second threshold, the average I/O utilization greater than or equal to the third threshold, and the average garbage collection frequency greater than or equal to the fourth threshold is 75%, and the server meets the conditions corresponding to the capacity expansion rule.
For another example, if the average CPU utilization is less than 60%, the average memory utilization is less than 60%, the average I/O utilization is greater than or equal to 70%, and the average garbage collection frequency is greater than or equal to 100/s, the occupation ratio that the average CPU utilization is greater than or equal to the first threshold, the average memory utilization is greater than or equal to the second threshold, the average I/O utilization is greater than or equal to the third threshold, and the average garbage collection frequency is greater than or equal to the fourth threshold is 50%, then the server does not meet the condition corresponding to the capacity expansion rule.
Or,
the average CPU utilization rate is greater than or equal to a first threshold value.
For example, if the average CPU utilization is greater than or equal to 60%, the server meets the condition corresponding to the capacity expansion rule.
Further, determining that the condition corresponding to the contraction and capacity rule is met includes:
the average utilization rate of the CPU is smaller than a first threshold value, the average utilization rate of the memory is smaller than a second threshold value, the average utilization rate of the I/O is smaller than a third threshold value, and the average garbage recycling frequency is smaller than a fourth threshold value.
And S33, if the capacity of the server is determined to be expanded, determining the configuration information corresponding to any one of the servers from one or more servers.
In this embodiment of the present invention, a server is randomly selected from one or more servers, and hardware configuration information of the server is obtained, where the hardware configuration information is used to configure a server with the same configuration as the selected server, and the configuration information may include: the size or bandwidth of the CPU core, memory, etc.
In an alternative of the embodiment of the present invention, when the server expands the capacity, the HTTP requests of the client are subjected to the current limiting processing, specifically including limiting the number of the HTTP requests of the client, and returning a specific current limiting error code to the rejected requests.
And S34, according to the configuration information, gradually adding one server to one or more servers, so that the occupation ratio of the average CPU utilization rate in the average resource utilization rates of the servers is greater than or equal to a first threshold, the average memory utilization rate is greater than or equal to a second threshold, the average I/O utilization rate is greater than or equal to a third threshold, and the average garbage collection frequency is greater than or equal to a fourth threshold is less than a fifth threshold, and the average CPU utilization rate is less than the first threshold. In the embodiment of the invention, one server is reconfigured according to the configuration information, and the configured server is added to one or more existing servers.
The specific addition mode can be as follows: and gradually adding one server to one or more servers, and judging whether the average resource utilization rate and the average garbage collection frequency meet the condition of continuous capacity expansion once every time until parameters in the average resource utilization rate and the average garbage collection frequency of the servers meet the conditions that the average CPU utilization rate is greater than or equal to a first threshold value, the average memory utilization rate is greater than or equal to a second threshold value, the occupation ratio of the average I/O utilization rate is greater than or equal to a third threshold value and the average garbage collection frequency is greater than or equal to a fourth threshold value is less than a fifth threshold value, and the average CPU utilization rate is less than the first threshold value.
For example, after determining that the number of servers needs to be increased, the existing server a1 and server a2 first add a server A3 with the same configuration information according to the configuration information of the server a1 or the server a2, add the server A3 to the server a1 and the server a2, and then the monitoring system determines whether the number of servers needs to be increased according to the latest collected average resource utilization rate and average garbage collection frequency of all servers including the server A3, and if so, add a server a4 with the same configuration information according to the configuration information of the server a1, the server a2, or the server A3 until the ratio of the average resource utilization rate of the servers and the average garbage collection frequency satisfies that the average utilization rate of the CPU is greater than or equal to a first threshold, the average memory utilization rate is greater than or equal to a second threshold, the average I/O utilization rate is greater than or equal to a third threshold, and the average garbage collection frequency is greater than or equal to a fourth threshold and is less than a fifth threshold, and the ratio is The average CPU utilization rate is less than a first threshold.
In an alternative of the embodiment of the present invention, a plurality of servers may be added to one or more of the servers simultaneously according to the average resource usage rate and the average garbage collection frequency of the servers, and the number of the servers added simultaneously may be determined according to the average resource usage rate and the average garbage collection frequency of the servers.
For example, the first threshold value is set in advance to 60% and it is set in advance to increase one server for every 10% exceeding the first threshold value, simply by the CPU average usage judgment. When the average resource utilization rate of the servers and the average CPU utilization rate in the average garbage collection frequency collected by the monitoring system are 90%, the first threshold value is exceeded by 30%, and 3 servers are required to be added at one time.
In an alternative of the embodiment of the present invention, if it is determined to expand the servers, one or more servers are configured to a server cluster formed by one or more current servers according to mirror image information configuring the current server to form a new server cluster, so that an occupation ratio of an average CPU utilization rate in the average resource utilization rates in the new server cluster, which is greater than or equal to a first threshold, an average memory utilization rate, which is greater than or equal to a second threshold, an average I/O utilization rate, which is greater than or equal to a third threshold, and an average garbage collection frequency, which is greater than or equal to a fourth threshold, is smaller than a fifth threshold, and the average CPU utilization rate is smaller than the first threshold.
For example, the memory of the preconfigured server is 5G, the average memory usage rate is increased due to the increase of data requests of the clients, the server needs to be expanded, and in order to avoid the instability of the system caused by multiple expansion of the server, 3 servers with 5G memories can be configured in a mirror image manner to be added to one or more current servers to form a new server cluster, so as to optimize the existing server.
S35, in a set time, if the average CPU utilization rate is smaller than a first threshold, the average memory utilization rate is smaller than a second threshold, the average I/O utilization rate is smaller than a third threshold and the average garbage collection frequency is smaller than a fourth threshold in the average resource utilization rates of the servers, determining to perform capacity reduction on the servers.
In an alternative of the embodiment of the present invention, if the server has already been capacity-expanded, after the server runs for a set time, it is determined whether the server needs to perform capacity reduction.
For example, the existing server cluster has already been expanded and stably operates for a set time period, and the monitoring system collects the average resource utilization rate and the average garbage collection frequency of the latest server, and according to the conditions corresponding to the contraction and expansion rule: the average CPU utilization rate is smaller than a first threshold, the average memory utilization rate is smaller than a second threshold, the average I/O utilization rate is smaller than a third threshold, and the average garbage collection frequency is smaller than a fourth threshold, whether the collected average resource utilization rate and the average garbage collection frequency of the latest server meet the capacity reduction condition is judged, and if yes, the number of the servers needs to be reduced.
S36, if it is determined to perform capacity reduction on the servers, successively reducing one server from the plurality of servers, so that an occupation ratio of the average CPU utilization rate of the average resource utilization rates of the servers, which is greater than or equal to a first threshold, the average memory utilization rate of the servers, which is greater than or equal to a second threshold, the average I/O utilization rate of the servers, which is greater than or equal to a third threshold, and the average garbage collection frequency of the servers, which is greater than or equal to a fourth threshold, is smaller than a fifth threshold, and the average CPU utilization rate is smaller than the first threshold, the average memory utilization rate of the servers is smaller than the second threshold, the average I/O utilization rate of the servers is smaller than the third threshold, and the occupation ratio of the average garbage collection frequency of the servers, which is smaller than the fourth.
In this embodiment, the presetting of the capacity reduction condition may specifically include:
the average CPU utilization rate, the average memory utilization rate, the average I/O utilization rate and the average garbage collection frequency meet the conditions that the average CPU utilization rate is greater than or equal to a first threshold value, the average memory utilization rate is greater than or equal to a second threshold value, the average I/O utilization rate is greater than or equal to a third threshold value and the average garbage collection frequency is greater than or equal to a fourth threshold value, wherein the proportion of the average CPU utilization rate, the average memory utilization rate, the average I/O utilization rate and the average garbage.
The specific reduction method may be: and successively reducing one server, and after the server continues to stably run for a preset time period every time, judging whether the average resource utilization rate and the average garbage recovery frequency of the latest server meet the condition of continuing capacity reduction again until the parameters in the average resource utilization rate and the average garbage recovery frequency of the server meet the condition of capacity reduction.
For example, there are four preconfigured servers including: a1, A2, A3 and A4, the server needs to be expanded by judging the average resource utilization rate and the average garbage collection frequency of the server, and the number of the expanded servers is 6, which comprises: a1, A2, A3, A4, A5 (newly added) and A6 (newly added), after the server stably runs for a period of time, the capacity reduction is needed by judging the average resource utilization rate and the average garbage recovery frequency of the server, and 5 servers after the capacity reduction comprise: a1, a2, A3, a4 and a5 (new); or, there are 5 servers after the capacity reduction, including: a2, A3, a4, a5 (new) and a6 (new).
In an alternative of the embodiment of the present invention, if it is determined to perform capacity reduction on the servers, controlling the number of the servers after capacity reduction to be greater than or equal to the initial number of the servers; the initial number is the number of the server before capacity expansion is performed.
According to the control method of the server, provided by the embodiment of the invention, the average resource utilization rate and the average garbage recovery frequency of the server are monitored, the capacity expansion/reduction strategy met by the server is judged according to the average resource utilization rate and the average garbage recovery frequency, the number of the servers is controlled according to the capacity expansion/reduction strategy, the dynamic adjustment of the number of the servers is realized, when the number of the servers is increased, the server can efficiently process the data request of the client under the condition of no overload, and the service efficiency is improved; when the number of the servers is reduced, the resource waste caused by excessive idle servers can be avoided.
Fig. 4 is a schematic structural diagram of a control device of a server according to an embodiment of the present invention, which specifically includes:
an obtaining module 401, configured to obtain an average resource utilization rate and an average garbage collection frequency corresponding to one or more servers;
a determining module 402, configured to determine, based on the average resource usage rate, the average garbage collection frequency, and a preset capacity expansion/reduction rule, a capacity expansion/reduction policy corresponding to the server;
a control module 403, configured to control the number of servers based on the capacity expansion/reduction policy.
In a possible implementation manner, the determining module is specifically configured to determine the average resource usage rate includes a Central Processing Unit (CPU) average usage rate, a memory average usage rate, and an Input/Output (I/O) average usage rate; if the proportion of the average CPU utilization rate to the average resource utilization rate of the server is greater than or equal to a first threshold value, the average memory utilization rate to the average memory utilization rate is greater than or equal to a second threshold value, the average I/O utilization rate to the average I/O utilization rate is greater than or equal to a third threshold value, and the average garbage collection frequency is greater than or equal to a fourth threshold value is greater than or equal to a fifth threshold value, determining to expand the capacity of the server; and in a set time, if the average CPU utilization rate, the average memory utilization rate, the average I/O utilization rate and the average garbage collection frequency in the average resource utilization rates of the server are smaller than a first threshold, a second threshold and a fourth threshold, determining to reduce the capacity of the server.
In a possible implementation manner, the determining module is further configured to determine to expand the server if the average CPU utilization rate in the average resource utilization rates of the server is greater than or equal to a first threshold.
In a possible implementation manner, the determining module is further configured to determine, if it is determined to expand the servers, configuration information corresponding to any one of the servers from one or more of the servers.
In a possible implementation manner, the control module is specifically configured to gradually add one server to one or more servers according to the configuration information, so that an occupation ratio of the average CPU utilization rate of the average resource utilization rates of the servers, which is greater than or equal to a first threshold, the average memory utilization rate, which is greater than or equal to a second threshold, the average I/O utilization rate, which is greater than or equal to a third threshold, and the average garbage collection frequency, which is greater than or equal to a fourth threshold, is less than a fifth threshold, and the average CPU utilization rate is less than the first threshold.
In a possible implementation manner, the control module is further configured to successively reduce one server from the plurality of servers if it is determined to scale down the server, so that an occupation ratio of the average CPU utilization rate of the average resource utilization rates of the servers, which is greater than or equal to a first threshold, the average memory utilization rate of the servers, which is greater than or equal to a second threshold, the average I/O utilization rate of the servers, which is greater than or equal to a third threshold, and the average garbage collection frequency of the servers, which is greater than or equal to a fourth threshold, is smaller than a fifth threshold, the average CPU utilization rate of the servers is smaller than the first threshold, the average memory utilization rate of the servers is smaller than the second threshold, the average I/O utilization rate of the servers is smaller than the third threshold, and the occupation ratio of the average garbage collection frequency of the servers, which is smaller than the fourth threshold.
In a possible embodiment, the control module is further configured to control the number of the servers after the capacity reduction to be greater than or equal to the initial number of the servers if it is determined that the capacity reduction is performed on the servers; the initial number is the number of the server before capacity expansion is performed.
In a possible implementation manner, the control module is further configured to configure one or more servers to a server cluster formed by one or more current servers according to mirror image information configuring the current server to form a new server cluster if it is determined to expand the servers, so that an occupation ratio of an average CPU utilization rate in the average resource utilization rates of the new server cluster, which is greater than or equal to a first threshold, an average memory utilization rate, which is greater than or equal to a second threshold, an average I/O utilization rate, which is greater than or equal to a third threshold, and an average garbage collection frequency, which is greater than or equal to a fourth threshold, is smaller than a fifth threshold, and the average CPU utilization rate is smaller than the first threshold.
The control device of the server provided in this embodiment may be the control device of the server shown in fig. 4, and may perform all the steps of the control method of the server shown in fig. 2 to 3, so as to achieve the technical effect of the control method of the server shown in fig. 2 to 3, and please refer to the description related to fig. 2 to 3 for brevity, which is not described herein again.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention, where thecomputer device 500 shown in fig. 5 includes: at least oneprocessor 501,memory 502, at least onenetwork interface 504, andother user interfaces 503. The various components in thecomputer device 500 are coupled together by abus system 505. It is understood that thebus system 505 is used to enable connection communications between these components. Thebus system 505 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled asbus system 505 in FIG. 5.
Theuser interface 503 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, trackball, touch pad, or touch screen, among others.
It is to be understood that thememory 502 in embodiments of the present invention may be either volatile memory or non-volatile memory, or may include both volatile and non-volatile memory, wherein non-volatile memory may be Read-only memory (ROM), programmable Read-only memory (programmable ROM), erasable programmable Read-only memory (EPROM ), electrically erasable programmable Read-only memory (EEPROM), or flash memory volatile memory may be Random Access Memory (RAM), which serves as external cache memory, by way of example and not limitation, many forms of RAM are available, such as static random access memory (staticiram, SRAM), dynamic random access memory (dynamicdram, SDRAM), synchronous dynamic random access memory (syncronous, SDRAM), double data rate synchronous dynamic random access memory (doubtatatare SDRAM, ddrsrssram), Enhanced synchronous dynamic random access memory (Enhanced DRAM, Enhanced SDRAM), synchronous DRAM, or SDRAM 3535L, which are intended to include, but not be limited to, and any other types of RAM suitable for direct access.
In some embodiments,memory 502 stores elements, executable units or data structures, or a subset thereof, or an expanded set thereof as follows: anoperating system 5021 andapplication programs 5022.
Theoperating system 5021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. Theapplication 5022 includes various applications, such as a media player (MediaPlayer), a Browser (Browser), and the like, for implementing various application services. The program for implementing the method according to the embodiment of the present invention may be included in theapplication program 5022.
In the embodiment of the present invention, by calling a program or an instruction stored in thememory 502, specifically, a program or an instruction stored in theapplication 5022, theprocessor 501 is configured to execute the method steps provided by the method embodiments, for example, including:
acquiring average resource utilization rate and average garbage recovery frequency corresponding to one or more servers; determining an expansion/contraction strategy corresponding to the server based on the average resource utilization rate, the average garbage recovery frequency and a preset expansion/contraction rule; and controlling the number of the servers based on the capacity expansion/reduction strategy.
In one possible embodiment, the average resource usage includes a Central Processing Unit (CPU) average usage, a memory average usage, and an Input/Output (I/O) average usage; if the proportion of the average CPU utilization rate to the average resource utilization rate of the server is greater than or equal to a first threshold value, the average memory utilization rate to the average memory utilization rate is greater than or equal to a second threshold value, the average I/O utilization rate to the average I/O utilization rate is greater than or equal to a third threshold value, and the average garbage collection frequency is greater than or equal to a fourth threshold value is greater than or equal to a fifth threshold value, determining to expand the capacity of the server; and in a set time, if the average CPU utilization rate, the average memory utilization rate, the average I/O utilization rate and the average garbage collection frequency in the average resource utilization rates of the server are smaller than a first threshold, a second threshold and a fourth threshold, determining to reduce the capacity of the server.
In a possible implementation manner, if the average CPU utilization in the average resource utilization of the server is greater than or equal to a first threshold, it is determined to expand the server.
In a possible embodiment, if it is determined that the capacity of the server is expanded, configuration information corresponding to any one of the servers is determined from one or more of the servers; according to the configuration information, one server is gradually added to one or more servers, so that the occupation ratio of the average CPU utilization rate in the average resource utilization rates of the servers to be greater than or equal to a first threshold value, the average memory utilization rate to be greater than or equal to a second threshold value, the average I/O utilization rate to be greater than or equal to a third threshold value and the average garbage collection frequency to be greater than or equal to a fourth threshold value is smaller than a fifth threshold value, and the average CPU utilization rate to be smaller than the first threshold value.
In a possible embodiment, if it is determined to scale down the servers, one server is successively reduced from the plurality of servers, so that an occupation ratio of the average CPU utilization rate of the average resource utilization rates of the servers, which is greater than or equal to a first threshold, the average memory utilization rate of the servers, which is greater than or equal to a second threshold, the average I/O utilization rate of the servers, which is greater than or equal to a third threshold, and the average garbage collection frequency of the servers, which is greater than or equal to a fourth threshold, is smaller than a fifth threshold, and the occupation ratio of the average CPU utilization rate of the servers, which is smaller than the first threshold, the average memory utilization rate of the servers, which is smaller than the second threshold, the average I/O utilization rate of the servers, which is smaller than the third threshold, and the average garbage collection frequency of the servers.
In a possible implementation manner, if the server is determined to be subjected to capacity reduction, controlling the number of the servers subjected to capacity reduction to be larger than or equal to the initial number of the servers; the initial number is the number of the server before capacity expansion is performed.
In a possible implementation manner, if it is determined to expand the servers, one or more servers are configured to a server cluster formed by one or more current servers according to mirror image information configuring the current servers to form a new server cluster, so that an occupation ratio of the average CPU utilization rate in the average resource utilization rates in the new server cluster is greater than or equal to a first threshold, the average memory utilization rate is greater than or equal to a second threshold, the average I/O utilization rate is greater than or equal to a third threshold, and the average garbage collection frequency is greater than or equal to a fourth threshold is less than a fifth threshold, and the average CPU utilization rate is less than the first threshold.
The method disclosed by the above-mentioned embodiments of the present invention may be applied to theprocessor 501, or implemented by theprocessor 501. Theprocessor 501 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in theprocessor 501. Theprocessor 501 may be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software elements in the decoding processor. The software elements may be located in ram, flash, rom, prom, or eprom, registers, among other storage media that are well known in the art. The storage medium is located in thememory 502, and theprocessor 501 reads the information in thememory 502 and completes the steps of the method in combination with the hardware.
For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), digital signal processing devices (DSPDevices), Programmable logic devices (P L D), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The computer device provided in this embodiment may be the computer device shown in fig. 5, and may perform all the steps of the control method of the server shown in fig. 2 to 3, so as to achieve the technical effect of the control method of the server shown in fig. 2 to 3, and please refer to the related description of fig. 2 to 3 for brevity, which is not described herein again.
The embodiment of the invention also provides a storage medium (computer readable storage medium). The storage medium herein stores one or more programs. Among others, the storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk; the memory may also comprise a combination of memories of the kind described above.
When one or more programs in the storage medium are executable by one or more processors, the control method of the server executed on the computer device side as described above is realized.
The processor is configured to execute a computer program stored in the memory to implement the following steps of a control method of a server executed on the computer device side:
acquiring average resource utilization rate and average garbage recovery frequency corresponding to one or more servers; determining an expansion/contraction strategy corresponding to the server based on the average resource utilization rate, the average garbage recovery frequency and a preset expansion/contraction rule; and controlling the number of the servers based on the capacity expansion/reduction strategy.
In one possible embodiment, the average resource usage includes a Central Processing Unit (CPU) average usage, a memory average usage, and an Input/Output (I/O) average usage; if the proportion of the average CPU utilization rate to the average resource utilization rate of the server is greater than or equal to a first threshold value, the average memory utilization rate to the average memory utilization rate is greater than or equal to a second threshold value, the average I/O utilization rate to the average I/O utilization rate is greater than or equal to a third threshold value, and the average garbage collection frequency is greater than or equal to a fourth threshold value is greater than or equal to a fifth threshold value, determining to expand the capacity of the server; and in a set time, if the average CPU utilization rate, the average memory utilization rate, the average I/O utilization rate and the average garbage collection frequency in the average resource utilization rates of the server are smaller than a first threshold, a second threshold and a fourth threshold, determining to reduce the capacity of the server.
In a possible implementation manner, if the average CPU utilization in the average resource utilization of the server is greater than or equal to a first threshold, it is determined to expand the server.
In a possible embodiment, if it is determined that the capacity of the server is expanded, configuration information corresponding to any one of the servers is determined from one or more of the servers; according to the configuration information, one server is gradually added to one or more servers, so that the occupation ratio of the average CPU utilization rate in the average resource utilization rates of the servers to be greater than or equal to a first threshold value, the average memory utilization rate to be greater than or equal to a second threshold value, the average I/O utilization rate to be greater than or equal to a third threshold value and the average garbage collection frequency to be greater than or equal to a fourth threshold value is smaller than a fifth threshold value, and the average CPU utilization rate to be smaller than the first threshold value.
In a possible embodiment, if it is determined to scale down the servers, one server is successively reduced from the plurality of servers, so that an occupation ratio of the average CPU utilization rate of the average resource utilization rates of the servers, which is greater than or equal to a first threshold, the average memory utilization rate of the servers, which is greater than or equal to a second threshold, the average I/O utilization rate of the servers, which is greater than or equal to a third threshold, and the average garbage collection frequency of the servers, which is greater than or equal to a fourth threshold, is smaller than a fifth threshold, and the occupation ratio of the average CPU utilization rate of the servers, which is smaller than the first threshold, the average memory utilization rate of the servers, which is smaller than the second threshold, the average I/O utilization rate of the servers, which is smaller than the third threshold, and the average garbage collection frequency of the servers.
In a possible implementation manner, if the server is determined to be subjected to capacity reduction, controlling the number of the servers subjected to capacity reduction to be larger than or equal to the initial number of the servers; the initial number is the number of the server before capacity expansion is performed.
In a possible implementation manner, if it is determined to expand the servers, one or more servers are configured to a server cluster formed by one or more current servers according to mirror image information configuring the current servers to form a new server cluster, so that an occupation ratio of the average CPU utilization rate in the average resource utilization rates in the new server cluster is greater than or equal to a first threshold, the average memory utilization rate is greater than or equal to a second threshold, the average I/O utilization rate is greater than or equal to a third threshold, and the average garbage collection frequency is greater than or equal to a fourth threshold is less than a fifth threshold, and the average CPU utilization rate is less than the first threshold.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, a software module executed by a processor, or a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

if the capacity reduction of the servers is determined, one server is gradually reduced from the plurality of servers, so that the occupation ratio of the average CPU utilization rate of the average resource utilization rates of the servers, which is greater than or equal to a first threshold value, the average memory utilization rate of the servers, which is greater than or equal to a second threshold value, the average I/O utilization rate of the servers, which is greater than or equal to a third threshold value, and the average garbage collection frequency of the servers, which is greater than or equal to a fourth threshold value, is smaller than a fifth threshold value, the average CPU utilization rate is smaller than the first threshold value, the average memory utilization rate is smaller than the second threshold value, the average I/O utilization rate of the servers, which is smaller than the third threshold value, and the occupation ratio of the average garbage collection frequency of the servers, which.
CN202010215806.8A2020-03-242020-03-24Server control method and device, computer equipment and storage mediumPendingCN111444015A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010215806.8ACN111444015A (en)2020-03-242020-03-24Server control method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010215806.8ACN111444015A (en)2020-03-242020-03-24Server control method and device, computer equipment and storage medium

Publications (1)

Publication NumberPublication Date
CN111444015Atrue CN111444015A (en)2020-07-24

Family

ID=71629664

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010215806.8APendingCN111444015A (en)2020-03-242020-03-24Server control method and device, computer equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN111444015A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111881004A (en)*2020-09-272020-11-03苏宁金融科技(南京)有限公司Hardware resource control method, device, equipment and storage medium
CN112543354A (en)*2020-11-272021-03-23鹏城实验室Service-aware distributed video cluster efficient scaling method and system
CN112650695A (en)*2020-12-302021-04-13北京奇艺世纪科技有限公司Cache management method and device of application server
CN114064284A (en)*2021-11-232022-02-18北京百度网讯科技有限公司 Cloud server resource configuration method, device, electronic device and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109669758A (en)*2018-09-112019-04-23深圳平安财富宝投资咨询有限公司Concocting method, device, equipment and the storage medium of server resource
CN110413585A (en)*2019-07-292019-11-05中国工商银行股份有限公司Log processing equipment, method, electronic equipment and computer readable storage medium
CN110677459A (en)*2019-09-022020-01-10金蝶软件(中国)有限公司Resource adjusting method and device, computer equipment and computer storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109669758A (en)*2018-09-112019-04-23深圳平安财富宝投资咨询有限公司Concocting method, device, equipment and the storage medium of server resource
CN110413585A (en)*2019-07-292019-11-05中国工商银行股份有限公司Log processing equipment, method, electronic equipment and computer readable storage medium
CN110677459A (en)*2019-09-022020-01-10金蝶软件(中国)有限公司Resource adjusting method and device, computer equipment and computer storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111881004A (en)*2020-09-272020-11-03苏宁金融科技(南京)有限公司Hardware resource control method, device, equipment and storage medium
CN112543354A (en)*2020-11-272021-03-23鹏城实验室Service-aware distributed video cluster efficient scaling method and system
CN112650695A (en)*2020-12-302021-04-13北京奇艺世纪科技有限公司Cache management method and device of application server
CN112650695B (en)*2020-12-302023-09-05北京奇艺世纪科技有限公司Cache management method and device of application server
CN114064284A (en)*2021-11-232022-02-18北京百度网讯科技有限公司 Cloud server resource configuration method, device, electronic device and medium
CN114064284B (en)*2021-11-232024-06-07北京百度网讯科技有限公司 Cloud server resource configuration method, device, electronic device and medium

Similar Documents

PublicationPublication DateTitle
CN111444015A (en)Server control method and device, computer equipment and storage medium
JP6882511B2 (en) Methods, devices and systems for blockchain consensus
EP3335120B1 (en)Method and system for resource scheduling
CN107291546B (en) A resource scheduling method and device
JP7167174B2 (en) Dynamic Grant Batch Processing in Distributed Storage Networks
CN111104227B (en)Resource control method and device of K8s platform and related components
CN113590709B (en)Industrial database cluster system and data access method thereof
EP3185148B1 (en)Resource coordination method, device, and system for database cluster
EP2898412B1 (en)Adaptive service timeouts
CN111538572B (en) Task processing method, device, scheduling server and medium
CN110308985B (en)Cloud exclusive server resource management method, device, equipment and storage medium
CN105656810B (en)Method and device for updating application program
CN109032805A (en)A kind of scalable appearance method, apparatus of elasticity, server and storage medium
CN111431741A (en)Service online method, system, computer device and storage medium
CN111010303A (en)Server control method and device
CN111400039A (en)Control method and device of cloud platform, cloud platform system and electronic equipment
CN111930493A (en) NodeManager state management method, device and computing device in cluster
CN114490078A (en)Dynamic capacity reduction and expansion method, device and equipment for micro-service
CN109428926B (en)Method and device for scheduling task nodes
CN107402851B (en) A data recovery control method and device
CN113268329B (en)Request scheduling method, device and storage medium
CN109992392A (en) A resource deployment method, device and resource server
CN115278786A (en)Service access method, device, electronic equipment and storage medium
CN114020468A (en)Elastic expansion method and device of algorithm container based on GPU (graphics processing Unit) index and application of elastic expansion method and device
CN115599564A (en)Task execution method and device and task execution system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20200724


[8]ページ先頭

©2009-2025 Movatter.jp