CN117240858A - Resource allocation method and device, storage medium and electronic equipment - Google Patents

Resource allocation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN117240858A
CN117240858A CN202210632942.6A CN202210632942A CN117240858A CN 117240858 A CN117240858 A CN 117240858A CN 202210632942 A CN202210632942 A CN 202210632942A CN 117240858 A CN117240858 A CN 117240858A
Authority
CN
China
Prior art keywords
service pressure
level
resource
server cluster
pressure level
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
CN202210632942.6A
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.)
3600 Technology Group Co ltd
Original Assignee
3600 Technology Group 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 3600 Technology Group Co ltd filed Critical 3600 Technology Group Co ltd
Priority to CN202210632942.6A priority Critical patent/CN117240858A/en
Publication of CN117240858A publication Critical patent/CN117240858A/en
Pending legal-status Critical Current

Links

Landscapes

  • Hardware Redundancy (AREA)

Abstract

The application discloses a resource allocation method, a device, a storage medium and electronic equipment, wherein the method comprises the following steps: the method comprises the steps of obtaining an online service pressure value of a server cluster, determining a service pressure level of the server cluster based on the online service pressure value, wherein the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, the online service pressure value of the third service pressure level is higher than that of the second service pressure level, and is higher than that of the first service pressure level, and based on at least one of the machine resource utilization rate of the server cluster and the service pressure level, the resource proportion of offline service is adjusted, so that resources of the server cluster can be reasonably scheduled, the resource waste of the server cluster in the low-valley period of online service is reduced, and the resource utilization rate is improved.

Description

Resource allocation method and device, storage medium and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for allocating resources, a storage medium, and an electronic device.
Background
Currently, when a server cluster is established by many internet companies, in order to meet the service peak demand, the number of servers is more redundant, and the online service access volume presents a very obvious peak-to-low gap, usually the daytime and the midday are peak periods of the online service access volume, and the evening is the valley period of the online service access volume. During the off-peak period, the machine resource utilization of the server is less than 10%, so that the resource waste of the server cluster is serious during the off-peak period.
In order to reduce resource waste of the server cluster and improve resource utilization, reasonable scheduling of resources is required.
Disclosure of Invention
The resource allocation method, the device, the storage medium and the electronic equipment provided by the embodiment of the application can reasonably schedule the resources of the server cluster, reduce the resource waste of the server cluster in the off-line service period and improve the resource utilization rate. The technical scheme is as follows:
in a first aspect, a method for allocating resources provided by an embodiment of the present application includes:
acquiring an online service pressure value of a server cluster;
determining a service pressure level of the server cluster based on the online service pressure value, the service pressure level comprising a first service pressure level, a second service pressure level, and a third service pressure level, an online service pressure value of the third service pressure level being higher than an online service pressure value of the second service pressure level and higher than an online service pressure value of the first service pressure level;
And adjusting the resource proportion of the offline service based on at least one of the information of the machine resource utilization rate of the server cluster and the service pressure level.
In a second aspect, an embodiment of the present application provides a resource allocation apparatus, where the apparatus includes:
the parameter acquisition module is used for acquiring an online service pressure value of the server cluster;
a pressure determining module, configured to determine a service pressure level of the server cluster based on the online service pressure value, where the service pressure level includes a first service pressure level, a second service pressure level, and a third service pressure level, and an online service pressure value of the third service pressure level is higher than an online service pressure value of the second service pressure level and is higher than an online service pressure value of the first service pressure level;
and the resource adjusting module is used for adjusting the resource proportion of the offline service based on at least one of the machine resource utilization rate of the server cluster and the service pressure level.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-described method steps.
In a fourth aspect, an embodiment of the present application provides an electronic device, which may include: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
In one or more embodiments of the present application, firstly, an online service pressure value of a server cluster is obtained, then, a service pressure level of the server cluster is determined based on the online service pressure value, the service pressure level includes a first service pressure level, a second service pressure level and a third service pressure level, the online service pressure value of the third service pressure level is higher than the online service pressure value of the second service pressure level and is higher than the online service pressure value of the first service pressure level, and finally, the resource proportion of offline service is adjusted based on at least one of the machine resource utilization rate and the service pressure level of the server cluster, so that reasonable scheduling of server cluster resources is realized, waste of online service low-valley server cluster resources is reduced, and the utilization rate of resources is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a resource allocation method according to an embodiment of the present application;
fig. 2 is a flow chart of a resource allocation method according to an embodiment of the present application;
fig. 3 is a schematic flow chart of a resource allocation method according to an embodiment of the present application;
fig. 4 is a flow chart of a resource allocation method according to an embodiment of the present application;
fig. 5 is a flow chart of a resource allocation method according to an embodiment of the present application;
FIG. 6 is a flowchart of resource allocation according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a resource allocation device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a resource adjustment module according to an embodiment of the present application;
fig. 9 is a block diagram showing the structure of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the description of the present application, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present application, it should be noted that, unless expressly specified and limited otherwise, "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus. The specific meaning of the above terms in the present application will be understood in specific cases by those of ordinary skill in the art. Furthermore, in the description of the present application, unless otherwise indicated, "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a exists alone, A and B exist together, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship.
Currently, when a server cluster is established by many internet companies, in order to meet the service peak demand, the number of servers is more redundant, and the online service access volume presents a very obvious peak-to-low gap, usually the daytime and the midday are peak periods of the online service access volume, and the evening is the valley period of the online service access volume. During the off-peak period, the machine resource utilization of the server is less than 10%, so that the resource waste of the server cluster is serious during the off-peak period. In order to reduce resource waste of the server cluster and improve resource utilization, reasonable scheduling of resources is required.
In the prior art, a server cluster processes an offline task, and mostly allocates a fixed resource to process the offline task in a fixed time period, so that dynamic adjustment of the resource according to the online service pressure of the server cluster cannot be achieved.
Based on the above, the application provides a resource allocation method, during the operation of a server cluster, an online service pressure value of the server cluster is obtained in real time, then a service pressure level of the server cluster is determined based on the online service pressure value, the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, the online service pressure value of the third service pressure level is higher than the online service pressure value of the first service pressure level, the online service pressure value of the third service pressure level is higher than the online service pressure value of the second service pressure level, and finally the resource proportion of offline service is adjusted according to at least one of the machine resource utilization rate and the service pressure level of the server cluster, so that reasonable scheduling of server cluster resources is realized, waste of server cluster resources in the online service low-valley period is reduced, and the resource utilization rate is improved.
The following is a detailed description of specific embodiments. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application as detailed in the accompanying claims. The flow diagrams depicted in the figures are exemplary only and are not necessarily to be taken in the order shown. For example, some steps are juxtaposed and there is no strict order of logic, so the actual order of execution is variable.
Fig. 1 is a schematic flow chart of a resource allocation method according to an embodiment of the present application. In a specific embodiment, the resource allocation method may be applied to a resource allocation apparatus or an electronic device configured with the resource allocation apparatus. The specific flow of the present embodiment will be described below taking an execution subject as an electronic device as an example. The following details about the flow shown in fig. 1, the resource allocation method specifically may include the following steps:
s102, acquiring an online service pressure value of a server cluster;
in particular, online service pressure values for a server cluster are obtained during server operation.
The online service pressure value reflects the pressure condition of the server cluster when processing online service requests, and can be generally expressed by data such as query number per second (Queries Per Second, QPS), transaction number per second (Transactions Per Second, TPS) and the like, wherein QPS is the number of query requests processed by the server cluster per second, TPS is the number of transactions processed by the server cluster per second, and the larger the value of QPS and TPS is, the larger the online service pressure of the server cluster is.
In one embodiment, the QPS corresponding to a server cluster may be taken as the online service pressure value for that server cluster.
S104, determining a service pressure level of the server cluster based on the online service pressure value, wherein the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, and the online service pressure value of the third service pressure level is higher than that of the second service pressure level and higher than that of the first service pressure level;
specifically, after the online service pressure value of the server cluster is obtained, the service pressure level of the server cluster may be divided into three levels according to the online service pressure value: the system comprises a first service pressure level, a second service pressure level and a third service pressure level, wherein the online service pressure value of the third service pressure level is higher than that of the second service pressure level and is higher than that of the first service pressure level.
In one embodiment, a first preset pressure threshold and a second preset pressure threshold may be preset according to an online service pressure value, where the first preset pressure threshold is smaller than the second preset pressure threshold, and when the online service pressure value is smaller than the first preset pressure threshold, it is determined that the online service pressure value is at a first service pressure level, that is, the current service pressure level of the server cluster is the first service pressure level; when the online service pressure value is smaller than a second preset pressure threshold and larger than or equal to the first preset pressure threshold, determining that the online service pressure value is at a second service pressure level, namely the current service pressure level of the server cluster is the second service pressure level; and when the online service pressure value is greater than or equal to a second preset pressure threshold value, determining that the online service pressure value is at a third service pressure level, namely, the current service pressure level of the server cluster is the third service pressure level.
And S106, adjusting the resource proportion of the offline service based on at least one of the utilization rate of the machine resources of the server cluster and the service pressure level.
Specifically, the resource proportion of the offline service is dynamically adjusted according to the service pressure level of the server cluster and by matching with the machine resource utilization rate. When the server pressure level of the server cluster is higher, that is, the pressure of the server cluster for processing the online service is heavier, the resource allocation allocated to the offline service is lower, and when the server pressure level of the server cluster is lower, that is, the pressure of the server cluster for processing the online service is lighter, the resource allocation allocated to the offline service is relatively higher.
For example, when the service pressure level of the server cluster is the third service pressure level, the resource allocation of the server cluster to the offline service is 10%, when the service pressure level of the server cluster is the second service pressure level, the resource allocation of the server cluster to the offline service is 30%, and when the service pressure level of the server cluster is the first service pressure level, the resource allocation of the server cluster to the offline service is 50%.
When the machine resource utilization rate of the server cluster is low, the resource proportion of the offline service can be properly increased, and when the machine resource utilization rate of the server cluster is low, the resource proportion of the offline service can be properly reduced.
The mechanical resource usage of the server cluster may be obtained during the running of the server, where the machine resource usage is used to identify the resource usage of the server cluster, for example, for a server cluster with 100 cores of a central processing unit (Central Processing Unit, CPU), the number of cores of its working state is 50 at a time, and the machine resource usage of the server cluster is 50%.
In one embodiment, the machine resource usage of the server cluster may be determined by obtaining machine usage parameters of the server cluster, which may include processor usage, memory usage, one-minute load, input/output interface usage, etc., and then setting different weights for the machine usage parameters for weighted summation.
In one embodiment, a corresponding resource usage level may be set for a machine resource usage of the server, a resource usage threshold may be preset, a resource usage level of the server cluster is determined according to the machine resource usage, if the machine resource usage is less than the preset resource usage threshold, the server cluster is determined to be a first resource usage level, and if the machine resource usage is greater than or equal to the preset resource usage threshold, the server cluster is determined to be a second resource usage level. Machine resource usage is used to represent the current machine's resource usage, and services that use machine resources include both online and offline services.
Further, the resource proportion of the offline service can be adjusted according to the combination of the service pressure level and the resource use level of the server cluster. Specifically, the following three cases can be classified.
In the first case, when the service pressure level of the server cluster is the first service pressure level, further judging the resource usage level of the server cluster, if the resource usage level is the first resource usage level, the resource proportion of the offline service can be adjusted to be the maximum usable resource, and if the resource usage level is the second resource usage level, the resource proportion of the offline service is kept unchanged.
In the second case, when the service pressure level of the server cluster is the second service pressure level, the resource usage level of the server cluster is further determined, if the resource usage level is the first resource usage level, the resource proportion of the offline service can be adjusted to be the minimum usable resource, and if the resource usage level is the second resource usage level, the offline service is killed or suspended.
In one embodiment, when the service pressure level of the server cluster is the third service pressure level, which indicates that the online service pressure of the server cluster is heavy, the offline service is directly subjected to killing or suspending.
In the embodiment of the application, the online service pressure value of the server cluster is obtained in real time, then the service pressure level of the server cluster is determined based on the online service pressure value, the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, the online service pressure value of the third service pressure level is higher than the online service pressure value of the first service pressure level, the online service pressure value of the third service pressure level is higher than the online service pressure value of the second service pressure level, and finally the resource proportion of offline service is adjusted according to at least one of the machine resource utilization rate of the server and the service pressure level, so that reasonable scheduling of server cluster resources is realized, waste of server cluster resources in the online service valley period is reduced, and the resource utilization rate is improved.
In one embodiment, the machine resource utilization may be determined based on machine utilization parameters of the server cluster and the online service pressure value may be determined based on a query rate per second of the server cluster. Fig. 2 is a schematic flow chart of a resource allocation method according to an embodiment of the present application. As shown in fig. 2, the resource allocation method may include the steps of:
s202, acquiring the use parameters of each machine of the server cluster, wherein the use parameters of the machine comprise at least one of processor use rate, memory use rate, one-minute load and input/output interface use rate;
processor utilization refers to the condition of processor resources occupied by a server cluster during operation, with higher processor utilization indicating higher processor resources occupied, and lower processor utilization indicating lower processor resources occupied. For example, a server cluster contains 100 processor cores, and 50 processor cores are put into operation during operation, so that the processor utilization of the server cluster is 50%.
Memory utilization refers to the condition of memory resources occupied by a server cluster during operation. For example, a server cluster is provided with 100GB of running memory, and 80GB of memory is occupied during running, so that the memory usage of the server cluster is 80%.
The one-minute load refers to the number of task processes processed by the server cluster in one minute, and can represent the load condition of the server cluster.
The utilization rate of the input/output interface refers to the conditions of data reading and data writing of the server cluster, and can also represent the load condition of the server cluster, and when the data reading and data writing of the server cluster are more, the utilization rate of the input/output interface is higher at the moment, and the load of the server cluster is heavier.
S204, carrying out weighted summation on the use parameters of each machine according to a preset weight value to obtain the use rate of machine resources;
the machine use parameters can reflect the machine resource use condition of the server cluster from different aspects, and after the machine use parameters such as the processor use rate, the memory use rate, the one-minute load, the input/output interface use rate and the like are obtained, the corresponding weight value is preset for each machine use parameter, and the machine use parameters are weighted and summed according to the preset weight value to obtain the machine resource use rate of the server cluster.
S206, acquiring the query number rate per second of the server cluster;
s208, taking the query number rate per second as an online service pressure value of the server cluster;
In step S206 to step S208, the query number per second rate (Queries Per Second, QPS) of the server cluster is acquired, and the QPS value is used as the online service pressure value of the server cluster.
The QPS is the number of query requests processed per second by the server cluster, and the larger the QPS value, the greater the online service pressure of the server cluster.
S210, determining a service pressure level of the server cluster based on the online service pressure value, wherein the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, and the online service pressure value of the third service pressure level is higher than that of the second service pressure level and higher than that of the first service pressure level;
specifically, a first preset pressure threshold value and a second preset pressure threshold value are preset according to an online service pressure value, wherein the first preset pressure threshold value is smaller than the second preset pressure threshold value, and when the online service pressure value is smaller than the first preset pressure threshold value, the online service pressure value is determined to be at a first service pressure level, namely the current service pressure level of the server cluster is the first service pressure level; when the online service pressure value is smaller than a second preset pressure threshold and larger than or equal to the first preset pressure threshold, determining that the online service pressure value is at a second service pressure level, namely the current service pressure level of the server cluster is the second service pressure level; and when the online service pressure value is greater than or equal to a second preset pressure threshold value, determining that the online service pressure value is at a third service pressure level, namely, the current service pressure level of the server cluster is the third service pressure level.
For example, the first preset pressure threshold is 100, the second preset pressure threshold is 1000, the QPS value is taken as an online service pressure value, when the online service pressure value is in a range of 0-100, the server cluster is determined to be a first online service pressure level, when the online service pressure value is in a range of 100-1000, the server cluster is determined to be a second online service pressure level, and when the online service pressure value exceeds 1000, the server cluster is determined to be a third online service pressure level.
S212, determining a resource utilization level of the server cluster based on the machine resource utilization rate, wherein the resource utilization level comprises a first resource utilization level and a second resource utilization level, and the machine resource utilization rate of the second resource utilization level is higher than the first resource utilization level;
specifically, a resource utilization rate threshold is preset, the resource utilization level of the server cluster is determined according to the machine resource utilization rate, if the machine resource utilization rate is smaller than the preset resource utilization rate threshold, the server cluster is determined to be a first resource utilization level, and if the machine resource utilization rate is greater than or equal to the preset resource utilization rate threshold, the server cluster is determined to be a second resource utilization level.
For example, the preset resource usage threshold is 60%, when the resource usage of the server cluster is less than 60%, the server cluster is determined to be at a first resource usage level, and when the resource usage of the server cluster is greater than 60%, the server cluster is determined to be at a second resource usage level.
And S214, adjusting the resource proportion of the offline service based on the resource use level and the service pressure level.
In one embodiment, when the service pressure level is determined to be the first service pressure level, the resource usage level of the server cluster is further determined, if the resource usage level is the first resource usage level, the resource ratio of the offline service is adjusted to be the maximum usable resource, and if the resource usage level is the second resource usage level, the resource ratio of the offline service is kept unchanged.
It should be understood that the service pressure level only represents the load pressure of the server cluster on processing the online service, when the service pressure level is the first service pressure level, it indicates that the online service access amount is smaller at this time, the server cluster can use less resources to easily cope with processing the online service, and the resource usage level is determined according to the machine resource usage rate of the server cluster, so that the online service is included, and the offline service is also included. Therefore, when the service pressure level is the first service pressure level and the resource utilization level is the first resource utilization level, the server cluster is indicated to face smaller online service pressure, and meanwhile, the machine resource utilization rate is lower, more resources can be separated to process offline service on the basis of not affecting the online service, for example, the resource proportion of the offline service is adjusted to be the maximum available resource; when the service pressure level is the first service pressure level and the resource use level is the second service pressure level, the first service pressure level indicates that the online service pressure faced by the server cluster is smaller, and the second resource use level indicates that the machine resource use rate of the server cluster is higher, at this time, the online service is stable due to the fact that the offline service pressure is larger, and the online service can be maintained by using fewer resources because the online service pressure is smaller, and at this time, the resource proportion of the current offline service is kept unchanged.
The maximum available resources refer to the maximum resources that the server cluster can allocate to offline services without affecting the online services. For example, a server cluster includes 100 CPU cores, where an online service occupies 20 CPU cores to maintain the online service, so that a standby resource margin of 20 CPU cores can be reserved for the online service, and the remaining 60 CPU cores are all used for offline service, where 60 CPU cores are the maximum available resources for offline service.
In one embodiment, when the service pressure level is determined to be the second service pressure level, the resource usage level of the server cluster is further determined, if the resource usage level is the first resource usage level, the resource proportion of the offline service is adjusted to be the minimum usable resource, and if the resource usage level is the second resource usage level, the offline service is killed or suspended.
The minimum usable resource refers to a minimum resource that can satisfy the basic operation of the offline service.
When the service pressure level is the second service pressure level and the resource utilization level is the first resource utilization level, the online service pressure faced by the server cluster is indicated to be in a normal condition, meanwhile, the machine resource utilization rate is lower, and partial resources can be separated to maintain the basic operation of offline service on the basis of not influencing the online service, for example, the resource proportion of the offline service is adjusted to be the minimum usable resource; when the service pressure level is the second service pressure level and the resource usage level is the second resource usage level, the first service pressure level indicates that the online service pressure faced by the server cluster is normal, and the second resource usage level indicates that the machine resource usage rate of the server cluster is higher, which is probably caused by the higher pressure of the offline service, at this time, in order to avoid that the offline service affects the online service of normal operation, the process which can be killed in the offline service is killed, and the process which cannot be killed is suspended, so as to minimize the resources occupied by the offline service.
In one embodiment, upon determining that the service pressure level is the third service pressure level, the offline service is subjected to a kill process or a suspend process.
When the service pressure level is the third service pressure level, the server cluster is indicated to have larger on-line service pressure, and in order to avoid that the off-line service affects the on-line service of normal operation, the process which can be killed in the off-line service is killed, and the process which cannot be killed is suspended, so that the resources occupied by the off-line service are minimized.
In the embodiment of the application, the query number rate per second is obtained as the online service pressure value of the server cluster, the machine resource utilization rate of the server cluster is obtained by adopting a mode of weighting and summing a plurality of mechanical utilization parameters, so that the value of the machine resource utilization rate is more accurate, then the service pressure level of the server cluster is determined according to the online service pressure value, the resource utilization level of the server cluster is determined according to the machine resource utilization rate, and finally the dynamic adjustment of the offline service resource proportion is realized by integrating the service pressure level and the resource utilization level, thereby realizing reasonable scheduling of the server cluster resources, reducing the waste of the server cluster resources in the low-valley period of online service and improving the resource utilization rate.
Fig. 3 is a schematic flow chart of a resource allocation method according to an embodiment of the present application. As shown in fig. 3, the resource allocation method may include the steps of:
s302, acquiring an online service pressure value of a server cluster;
in particular, step S302 is described in detail in step S102 of another embodiment, which is not described herein.
S304, determining a service pressure level of the server cluster based on the online service pressure value, wherein the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, and the online service pressure value of the third service pressure level is higher than that of the second service pressure level and higher than that of the first service pressure level;
in particular, step S304 is described in detail in step S210 of another embodiment, which is not described herein.
S306, obtaining the machine resource utilization rate of the server cluster;
and obtaining each machine use parameter of the server cluster, wherein the machine use parameters comprise at least one of processor use rate, memory use rate, one-minute load and input/output interface use rate, and carrying out weighted summation on each machine use parameter according to a preset weight value to obtain machine resource use rate.
In particular, step S306 is described in detail in step S202 and step S204 in another embodiment, and is not described here in detail.
S308, determining a resource utilization level of the server cluster based on the machine resource utilization rate, wherein the resource utilization level comprises a first resource utilization level and a second resource utilization level, and the machine resource utilization rate of the second resource utilization level is higher than the first resource utilization level;
in particular, step S308 is described in detail in step S212 of another embodiment, which is not described herein.
S310, judging the resource use level of the server cluster when the service pressure level is determined to be the first service pressure level;
the service pressure level only represents the load pressure of the server cluster on processing the online service, when the service pressure level is the first service pressure level, the server cluster is indicated to have less access to the online service at the moment, less resources can be used by the server cluster to easily deal with processing the online service, and the resource use level is determined according to the machine resource use rate of the server cluster, so that the online service is contained, and the offline service is also contained.
Specifically, when the service pressure level of the server cluster is the first service pressure level, it indicates that the service pressure of the server cluster facing the online service is smaller, and the sign operation of the online service can be maintained by using fewer resources, so that the resource use level of the current server cluster is further judged.
S312, if the resource utilization level is the first resource utilization level, the resource proportion of the offline service is adjusted to be the maximum available resource;
specifically, after determining that the service pressure level of the server cluster is the first service pressure level, if the detected resource usage level is the first resource usage level, it indicates that the machine resource usage rate of the server cluster is low, and more resources are idle, at this time, more resources are separated to process offline service on the basis of not affecting online service, and the offline service resource proportion is adjusted to be the maximum usable resource.
The maximum available resources refer to the maximum resources that the server cluster can allocate to offline services without affecting the online services.
In this embodiment, the maximum available resource may be the remaining available resource of the server cluster after a certain spare resource margin is reserved for the resource occupied by the user when the online service normally operates. The maximum usable resources are customized by users aiming at different server clusters, the total amount of resources of the different server clusters is different, the occupied resources are different when the online service normally operates, and the corresponding maximum usable resources are also different. For example, in a certain server cluster, during a period when the online service access amount is normal (neither in the valley period of the online access amount nor in the peak period of the online access amount), the machine resource usage rate is 30%, and after a standby resource margin of 20% is reserved for the online service, the maximum usable resource of the offline service is 50%, that is, the occupied resource of the offline service cannot be set to exceed the maximum usable resource by 50%.
In one embodiment, adjusting the offline service resource formulation to the maximum available resource may be a gradient adjustment of the offline service resource formulation increase.
In one embodiment, if the machine resource usage rate of the server cluster is about to exceed the preset resource usage rate threshold in the process of gradient adjustment of the offline service resource allocation rate increase, i.e. the resource usage level of the server cluster is about to span from the first resource usage level to the second resource usage level, at this time, the offline service resource allocation rate stops being adjusted to continue to increase. For example, before the offline service resource allocation is adjusted, the machine resource usage rate of the server cluster is 35%, where the offline service accounts for 20% of the machine resource usage rate, the online service accounts for 15% of the machine resource usage rate, the preset resource usage threshold is 60%, and when the offline service resource allocation is adjusted to 45% in the gradient adjustment process, the total machine resource usage rate of the server cluster reaches 60%, and at this time, the offline service resource allocation is stopped to be adjusted, and the offline service machine resource usage rate is kept to be 45%.
And S314, if the resource use level is the second resource use level, keeping the resource ratio of the offline service unchanged.
Specifically, when the service pressure level is the first service pressure level and the resource usage level is the second resource usage level, the first service pressure level indicates that the online service pressure faced by the server cluster is smaller, and the second resource usage level indicates that the machine resource usage rate of the server cluster is higher, which may be caused by that the offline service pressure is higher, and because the online service pressure is smaller, the online service can be maintained to be stable by using fewer resources, and at the moment, the resource proportion of the current offline service is kept unchanged.
For example, at a certain moment, the machine resource usage rate of the server cluster is 70% (wherein, the machine resource usage rate of the offline service accounts for 45% and the machine resource usage rate of the online service accounts for 25%) and is greater than the preset resource usage threshold value of 60%, and at this time, the machine resource usage rate of the offline service is kept unchanged at 45%.
In the embodiment of the application, the machine resource utilization rate of the server cluster is obtained in real time, the online service pressure value of the server cluster is obtained, then the service pressure level of the server cluster is determined based on the online service pressure value, the resource utilization level of the server cluster is determined based on the machine resource utilization rate, when the service pressure level is the first service pressure level and the resource utilization level is the first resource utilization level, the resource proportion of offline service is adjusted to be the maximum usable resource, when the service pressure level is the first service pressure level and the resource utilization level is the second resource utilization level, the resource proportion of offline service is kept unchanged, and the waste of the server cluster resources in the low-valley period of online service is reduced and the resource utilization rate is improved on the basis of ensuring that the online service is not influenced.
Fig. 4 is a schematic flow chart of a resource allocation method according to an embodiment of the present application. As shown in fig. 4, the resource allocation method may include the steps of:
s402, acquiring an online service pressure value of a server cluster;
in particular, step S402 is described in detail in step S102 in another embodiment, and is not described herein.
S404, determining a service pressure level of the server cluster based on the online service pressure value, wherein the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, and the online service pressure value of the third service pressure level is higher than that of the second service pressure level and higher than that of the first service pressure level;
in particular, step S404 is described in detail in step S210 in another embodiment, which is not described herein.
S406, obtaining the machine resource utilization rate of the server cluster;
in particular, step S406 is described in detail in step S202 and step S204 in another embodiment, and is not described herein.
S408, determining a resource utilization level of the server cluster based on the machine resource utilization, wherein the resource utilization level comprises a first resource utilization level and a second resource utilization level, and the machine resource utilization of the second resource utilization level is higher than the first resource utilization level;
In particular, step S408 is described in detail in step S212 of another embodiment, which is not described herein.
S410, judging the resource use level of the server cluster when the service pressure level is determined to be the second service pressure level;
the service pressure level only represents the load pressure of the server cluster on processing the online service, when the service pressure level is the second service pressure level, the service pressure level indicates that the online service access amount is general at the moment, the server cluster does not have too large service pressure, and the resource use level is determined according to the machine resource use rate of the server cluster, so that the online service is contained, and the offline service is also contained.
Specifically, when the service pressure level of the server cluster is the second service pressure level, the resource usage level of the current server cluster is further determined.
S412, if the resource usage level is the first resource usage level, the resource ratio of the offline service is adjusted to be the minimum usable resource;
the minimum available resources are the minimum resources that maintain basic operation of the offline service.
Specifically, after determining that the service pressure level is the second service pressure level, if it is determined that the resource usage level of the server cluster is the first resource usage level, it indicates that the resource usage rate of the server cluster is not high, because the service pressure level of the server cluster processing the online service is the second service pressure level, in order to avoid that the offline service affects the operation of the online service, the resource proportion of the offline service is adjusted to be the minimum available resource.
If the resource usage level is the second resource usage level, the offline service is killed or suspended in S414.
Specifically, after determining that the service pressure level is the second service pressure level, if it is determined that the resource usage level of the server cluster is the second resource usage level, which indicates that the resource usage rate of the server cluster is higher, in this case, in order to avoid that the offline service affects the operation of the online service, the running killable offline service is killed, and the offline service having a larger process loss after the killing is suspended, so as to provide as much resource as possible to the online service.
In the embodiment of the application, the machine resource utilization rate of the server cluster and the online service pressure value of the server cluster are obtained in real time, then the service pressure level of the server cluster is determined based on the online service pressure value, the resource utilization level of the server cluster is determined based on the machine resource utilization rate, when the service pressure level is the second service pressure level and the resource utilization level is the first resource utilization level, the resource ratio of the offline service is adjusted to be the minimum usable resource, when the service pressure level is the second service pressure level and the resource utilization level is the second resource utilization level, the offline service is killed or suspended, the operation of the online service is fully ensured not to be influenced, the waste of the resources of the online service server cluster in the low valley period is reduced as much as possible on the basis of ensuring the online service not to be influenced, and the resource utilization rate is improved.
Fig. 5 is a schematic flow chart of a resource allocation method according to an embodiment of the present application. As shown in fig. 5, the resource allocation method may include the steps of:
s502, acquiring an online service pressure value of a server cluster;
in particular, step S402 is described in detail in step S102 in another embodiment, and is not described herein.
S504, determining a service pressure level of the server cluster based on the online service pressure value, wherein the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, and the online service pressure value of the third service pressure level is higher than that of the second service pressure level and higher than that of the first service pressure level;
in particular, step S304 is described in detail in step S210 of another embodiment, which is not described herein.
And S506, when the service pressure level is determined to be the third service pressure level, performing killing processing or suspending processing on the offline service.
Specifically, when the service pressure level of the server cluster is the second service pressure level, it indicates that the pressure of processing the online service by the server cluster is larger at this time, in order to ensure the operation of the online service, the running killable offline service is killed, and the offline service with larger process loss after the killing is suspended, so as to provide as much resources as possible for the online service.
In the embodiment of the application, the online service pressure value of the server cluster is obtained in real time, then the service pressure level of the server cluster is determined based on the online service pressure value, the resource use level of the server cluster is determined based on the machine resource use rate, and when the service pressure level is the second service pressure level, the offline service is killed or suspended, so that the running of the online service is fully ensured not to be influenced.
Referring to fig. 6, a flowchart of resource allocation is provided in an embodiment of the present application. As shown in fig. 6, the resource allocation method may include the steps of:
s1, acquiring a machine resource utilization rate and determining a resource utilization level;
s2, acquiring an online service pressure value and determining a service pressure level;
firstly, acquiring the machine resource utilization rate and the online service pressure value of a server cluster, determining the resource utilization level of the server cluster according to the machine resource utilization rate, and determining the service pressure level of the server cluster based on the online service pressure value.
S3, determining a first service pressure level;
when it is determined that the service pressure level of the server cluster is the first service pressure level, step S6 is performed.
S4, determining a second service pressure level;
when it is determined that the service pressure level of the server cluster is the second service pressure level, step S7 is performed.
S5, determining a third service pressure level;
when it is determined that the service pressure level of the server cluster is the third service pressure level, step S8 is performed.
S6, judging the resource use level;
when the resource use level of the server cluster is determined to be the first resource use level, executing step S8; when it is determined that the resource usage level of the server cluster is the second resource usage level, step S9 is performed.
When it is determined that the resource usage level of the server cluster is the first resource usage level, step S10 is performed; when it is determined that the resource usage level of the server cluster is the second resource usage level, step S11 is performed.
S7, adjusting to the maximum available resources;
and when the service pressure level of the server cluster is the first service pressure level and the resource use level is the first resource use level, adjusting the resource proportion of the offline service to be the maximum usable resource.
S8, keeping unchanged;
when the service pressure level of the server cluster is the first service pressure level and the resource use level is the second resource use level, the current resource proportion of the offline service is kept unchanged.
S9, adjusting to the minimum usable resource;
and when the service pressure level of the server cluster is the second service pressure level and the resource use level is the first resource use level, adjusting the resource proportion of the offline service to be the minimum usable resource.
And S10, performing killing processing or suspending processing on the offline service.
When the service pressure level of the server cluster is the second service pressure level and the resource use level is the first resource use level, or the service pressure level of the server cluster is the third service pressure level, in order to ensure that the offline service does not influence the normal operation of the online service, the resource proportion of the offline service is adjusted to be the minimum usable resource.
In the embodiment of the application, the machine resource utilization rate of the server cluster and the online service pressure value of the server cluster are obtained in real time, then the service pressure level of the server cluster is determined based on the online service pressure value, the resource utilization level of the server cluster is determined based on the machine resource utilization rate, and finally the resource proportion of offline service is adjusted according to the resource utilization level and the service pressure level, so that reasonable scheduling of the server cluster resource is realized, the waste of the server cluster resource in the low valley period of the online service is reduced, and the resource utilization rate is improved.
The resource allocation device provided in the embodiment of the present application will be described in detail with reference to fig. 7. It should be noted that, the resource allocation device of fig. 7 is used to execute the method of the embodiments of fig. 1, 2, 3, 4, 5 and 6, and only the relevant parts of the embodiments of the present application are shown for convenience of explanation, and specific technical details are not disclosed, please refer to the embodiments of fig. 1, 2, 3, 4, 5 and 6.
Fig. 7 is a schematic structural diagram of a resource allocation device according to an embodiment of the present application. As shown in fig. 7, the resource allocation device 1 may be implemented as all or part of a terminal device by software, hardware or a combination of both. According to some embodiments, the resource allocation device 1 includes a parameter acquisition module 11, a pressure determination module 12, and a resource adjustment module 13, and specifically includes:
the parameter obtaining module 11 is configured to obtain an online service pressure value of the server cluster;
a pressure determining module 12, configured to determine a service pressure level of the server cluster based on the online service pressure value, where the service pressure level includes a first service pressure level, a second service pressure level, and a third service pressure level, and an online service pressure value of the third service pressure level is higher than an online service pressure value of the second service pressure level and is higher than an online service pressure value of the first service pressure level;
And the resource adjusting module 13 is configured to adjust a resource proportion of the offline service based on at least one of the machine resource utilization rate of the server cluster and the service pressure level.
Optionally, the parameter obtaining module 11 is further configured to:
acquiring the query number rate per second of the server cluster;
and taking the query per second rate as an online service pressure value of the server cluster.
Optionally, the pressure determining module 12 is specifically configured to:
if the online service pressure value is smaller than a first preset pressure threshold value, determining that the service pressure level of the server cluster is a first service pressure level;
if the online service pressure value is greater than or equal to a first preset pressure threshold value and less than a second preset pressure threshold value, determining that the service pressure level of the server cluster is a second service pressure level;
and if the online service pressure value is greater than or equal to a second preset pressure threshold value, determining that the service pressure level of the server cluster is a third service pressure level.
Optionally, please refer to fig. 8, which is a schematic structural diagram of a resource adjustment module according to an embodiment of the present application. As shown in fig. 8, the resource adjustment module 13 includes:
A machine resource obtaining unit 131, configured to obtain a machine resource usage rate of the server cluster;
a resource level determination unit 132 configured to determine a resource usage level of the server cluster based on the machine resource usage rate, the resource usage level including a first resource usage level and a second resource usage level, the machine resource usage rate of the second resource usage level being higher than the first resource usage level;
and a resource proportioning adjustment unit 133, configured to adjust a resource proportioning of the offline service based on the resource usage level and the service pressure level.
Optionally, the machine resource obtaining unit 131 is specifically configured to:
obtaining machine use parameters of a server cluster, wherein the machine use parameters comprise at least one of processor use rate, memory use rate, one-minute load and input/output interface use rate;
and carrying out weighted summation on the using parameters of each machine according to a preset weight value to obtain the using rate of machine resources.
Optionally, the resource level determining unit 132 is specifically configured to:
if the machine resource utilization rate is smaller than a preset resource utilization rate threshold value, determining that the server cluster is at a first resource utilization level;
And if the machine resource utilization rate is greater than or equal to a preset resource utilization rate threshold, determining that the server cluster is at a second resource utilization level.
Optionally, the resource proportioning adjustment unit 133 is specifically configured to:
when the service pressure level is determined to be the first service pressure level, judging the resource use level of the server cluster;
if the resource use level is the first resource use level, the resource proportion of the offline service is adjusted to be the maximum usable resource;
and if the resource use level is the second resource use level, keeping the resource ratio of the offline service unchanged.
Optionally, the resource proportioning adjustment unit 133 is further configured to:
when the service pressure level is determined to be the second service pressure level, judging the resource use level of the server cluster;
if the resource use level is the first resource use level, the resource proportion of the offline service is adjusted to be the minimum usable resource;
and if the resource use level is the second resource use level, performing killing processing or suspending processing on the offline service.
Optionally, the resource adjustment module 13 is further configured to:
and when the service pressure level is determined to be the third service pressure level, performing killing processing or suspending processing on the offline service.
In the embodiment of the application, the online service pressure value of the server cluster is obtained in real time, then the service pressure level of the server cluster is determined based on the online service pressure value, the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, the online service pressure value of the third service pressure level is higher than the online service pressure value of the second service pressure level and is higher than the online service pressure value of the first service pressure level, and finally the resource proportion of offline service is adjusted according to at least one of the machine resource utilization rate of the server cluster and the service pressure level, so that reasonable scheduling of server cluster resources is realized, waste of server cluster resources in the low-valley period of online service is reduced, and the resource utilization rate is improved.
It should be noted that, when the resource allocation device provided in the foregoing embodiment performs the resource allocation method, only the division of the foregoing functional modules is used as an example, and in practical application, the foregoing functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the resource allocation device and the resource allocation method provided in the foregoing embodiments belong to the same concept, which embody detailed implementation procedures in the method embodiments, and are not described herein again.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and executed by the processor to perform the resource allocation method according to the embodiment shown in fig. 1 to fig. 6, and a specific execution process may refer to a specific description of the embodiment shown in fig. 1 to fig. 6, which is not repeated herein.
The present application further provides a computer program product, where at least one instruction is stored, where the at least one instruction is loaded by the processor and executed by the processor to perform the resource allocation method according to the embodiment shown in fig. 1 to fig. 6, and the specific execution process may refer to the specific description of the embodiment shown in fig. 1 to fig. 6, which is not repeated herein.
Referring to fig. 9, a block diagram of an electronic device according to an exemplary embodiment of the present application is shown. The electronic device of the present application may include one or more of the following components: processor 110, memory 120, input device 130, output device 140, and bus 150. The processor 110, the memory 120, the input device 130, and the output device 140 may be connected by a bus 150.
Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall electronic device using various interfaces and lines, performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and invoking data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 110 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user page, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 110 and may be implemented solely by a single communication chip.
The Memory 120 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (ROM). Optionally, the memory 120 includes a Non-transitory computer readable medium (Non-Transitory Computer-Readable Storage Medium). Memory 120 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, which may be an Android (Android) system, including an Android system-based deep development system, an IOS system developed by apple corporation, including an IOS system-based deep development system, or other systems, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like.
Memory 120 may be divided into an operating system space in which the operating system runs and a user space in which native and third party applications run. In order to ensure that different third party application programs can achieve better operation effects, the operating system allocates corresponding system resources for the different third party application programs. However, the requirements of different application scenarios in the same third party application program on system resources are different, for example, under the local resource loading scenario, the third party application program has higher requirement on the disk reading speed; in the animation rendering scene, the third party application program has higher requirements on the GPU performance. The operating system and the third party application program are mutually independent, and the operating system often cannot timely sense the current application scene of the third party application program, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third party application program.
In order to enable the operating system to distinguish specific application scenes of the third-party application program, data communication between the third-party application program and the operating system needs to be communicated, so that the operating system can acquire current scene information of the third-party application program at any time, and targeted system resource adaptation is performed based on the current scene.
The input device 130 is configured to receive input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used to output instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens.
The touch display screen may be designed as a full screen, a curved screen, or a contoured screen. The touch display screen may also be designed as a combination of a full screen and a curved screen, and the combination of a special-shaped screen and a curved screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configuration of the electronic device shown in the above-described figures does not constitute a limitation of the electronic device, and the electronic device may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components. For example, the electronic device further includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (Wireless Fidelity, wiFi) module, a power supply, and a bluetooth module, which are not described herein.
In the electronic device shown in fig. 9, the processor 110 may be configured to invoke the resource allocation program stored in the memory 120 and execute to implement the resource allocation method according to the embodiments of the method of the present application.
In the embodiment of the application, the online service pressure value of the server cluster is obtained in real time, then the service pressure level of the server cluster is determined based on the online service pressure value, the service pressure level comprises a first service pressure level, a second service pressure level and a third service pressure level, the online service pressure value of the third service pressure level is higher than the online service pressure value of the second service pressure level and is higher than the online service pressure value of the first service pressure level, and finally the resource proportion of offline service is adjusted according to at least one of the machine resource utilization rate of the server cluster and the service pressure level, so that reasonable scheduling of server cluster resources is realized, waste of server cluster resources in the low-valley period of online service is reduced, and the resource utilization rate is improved.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (12)

1. A method of resource allocation, the method comprising:
acquiring an online service pressure value of a server cluster;
determining a service pressure level of the server cluster based on the online service pressure value, the service pressure level comprising a first service pressure level, a second service pressure level, and a third service pressure level, an online service pressure value of the third service pressure level being higher than an online service pressure value of the second service pressure level and higher than an online service pressure value of the first service pressure level;
and adjusting the resource proportion of the offline service based on at least one of the information of the machine resource utilization rate of the server cluster and the service pressure level.
2. The method of claim 1, wherein the obtaining the online service pressure value for the server cluster comprises:
acquiring the query number rate per second of the server cluster;
and taking the query per second rate as an online service pressure value of the server cluster.
3. The method of claim 1, wherein the determining a service pressure level for the server cluster based on the online service pressure value, the service pressure level comprising a first service pressure level, a second service pressure level, and a third service pressure level, an online service pressure value for the third service pressure level being higher than an online service pressure value for the second service pressure level being higher than an online service pressure value for the first service pressure level, comprises:
if the online service pressure value is smaller than a first preset pressure threshold value, determining that the service pressure level of the server cluster is a first service pressure level;
if the online service pressure value is greater than or equal to a first preset pressure threshold value and less than a second preset pressure threshold value, determining that the service pressure level of the server cluster is a second service pressure level;
and if the online service pressure value is greater than or equal to a second preset pressure threshold value, determining that the service pressure level of the server cluster is a third service pressure level.
4. The method of claim 1, wherein adjusting the resource allocation of the offline service based on at least one of the server cluster's machine resource usage and the service pressure level comprises:
Acquiring the utilization rate of machine resources of a server cluster;
determining a resource usage level of the server cluster based on the machine resource usage, the resource usage level comprising a first resource usage level and a second resource usage level, the machine resource usage of the second resource usage level being higher than the first resource usage level;
and adjusting the resource proportion of the offline service based on the resource use level and the service pressure level.
5. The method of claim 4, wherein the obtaining the machine resource usage of the server cluster comprises:
obtaining machine use parameters of a server cluster, wherein the machine use parameters comprise at least one of processor use rate, memory use rate, one-minute load and input/output interface use rate;
and carrying out weighted summation on the using parameters of each machine according to a preset weight value to obtain the using rate of machine resources.
6. The method of claim 5, wherein the determining a resource usage level of the server cluster based on the machine resource usage, the resource usage level comprising a first resource usage level and a second resource usage level, the second resource usage level having a machine resource usage higher than the first resource usage level, comprises:
If the machine resource utilization rate is smaller than a preset resource utilization rate threshold value, determining that the server cluster is at a first resource utilization level;
and if the machine resource utilization rate is greater than or equal to a preset resource utilization rate threshold, determining that the server cluster is at a second resource utilization level.
7. The method of claim 5, wherein said adjusting the resource proportioning of offline services based on said resource usage level and said service pressure level comprises:
when the service pressure level is determined to be the first service pressure level, judging the resource use level of the server cluster;
if the resource use level is the first resource use level, the resource proportion of the offline service is adjusted to be the maximum usable resource;
and if the resource use level is the second resource use level, keeping the resource ratio of the offline service unchanged.
8. The method of claim 7, wherein the method further comprises:
when the service pressure level is determined to be the second service pressure level, judging the resource use level of the server cluster;
if the resource use level is the first resource use level, the resource proportion of the offline service is adjusted to be the minimum usable resource;
And if the resource use level is the second resource use level, performing killing processing or suspending processing on the offline service.
9. The method of claim 1, wherein adjusting the resource allocation of the offline service based on at least one of the server cluster's machine resource usage and the service pressure level comprises:
and when the service pressure level is determined to be the third service pressure level, performing killing processing or suspending processing on the offline service.
10. A resource allocation apparatus, the apparatus comprising:
the parameter acquisition module is used for acquiring an online service pressure value of the server cluster;
a pressure determining module, configured to determine a service pressure level of the server cluster based on the online service pressure value, where the service pressure level includes a first service pressure level, a second service pressure level, and a third service pressure level, and an online service pressure value of the third service pressure level is higher than an online service pressure value of the second service pressure level and is higher than an online service pressure value of the first service pressure level;
and the resource adjusting module is used for adjusting the resource proportion of the offline service based on at least one of the machine resource utilization rate of the server cluster and the service pressure level.
11. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1 to 9.
12. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of the method according to any one of claims 1-9.
CN202210632942.6A 2022-06-07 2022-06-07 Resource allocation method and device, storage medium and electronic equipment Pending CN117240858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210632942.6A CN117240858A (en) 2022-06-07 2022-06-07 Resource allocation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210632942.6A CN117240858A (en) 2022-06-07 2022-06-07 Resource allocation method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN117240858A true CN117240858A (en) 2023-12-15

Family

ID=89081315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210632942.6A Pending CN117240858A (en) 2022-06-07 2022-06-07 Resource allocation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN117240858A (en)

Similar Documents

Publication Publication Date Title
EP3754490B1 (en) User interface rendering method and apparatus, and terminal
CN107357405B (en) Power consumption control method and related equipment
CN112380020A (en) Computing power resource allocation method, device, equipment and storage medium
CN115562843B (en) Container cluster computational power scheduling method and related device
CN108306874B (en) Service interface access current limiting method and device
WO2014194704A1 (en) A grouping processing method and system
CN110703944B (en) Touch data processing method and device, terminal and storage medium
CN110704182A (en) Deep learning resource scheduling method and device and terminal equipment
CN111338803B (en) Thread processing method and device
CN104202305A (en) Transcoding processing method and device, server
CN108965364B (en) Resource allocation method, device and system
CN114035947A (en) Method, device, equipment and system for dynamically allocating resources
CN116721007B (en) Task control method, system and device, electronic equipment and storage medium
CN117240858A (en) Resource allocation method and device, storage medium and electronic equipment
CN112068965A (en) Data processing method and device, electronic equipment and readable storage medium
CN109039944B (en) Data packet distribution method, device and equipment
CN110545332A (en) Server cluster balancing method and system
CN114466365B (en) Spectrum resource acquisition method, spectrum resource acquisition device and computer readable storage medium
CN117632457A (en) Method and related device for scheduling accelerator
CN113468442A (en) Resource bit flow distribution method, computing device and computer storage medium
CN114596012A (en) Method, system, apparatus and medium for resource scheduling
US9479579B2 (en) Grouping processing method and system
CN114116231A (en) Data loading method and device, computer equipment and storage medium
CN111459634A (en) Task scheduling method, device, terminal and storage medium
CN112685006A (en) Process management method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination