CN120295751A - Service resource adjustment method and server - Google Patents
Service resource adjustment method and server Download PDFInfo
- Publication number
- CN120295751A CN120295751A CN202510156898.XA CN202510156898A CN120295751A CN 120295751 A CN120295751 A CN 120295751A CN 202510156898 A CN202510156898 A CN 202510156898A CN 120295751 A CN120295751 A CN 120295751A
- Authority
- CN
- China
- Prior art keywords
- resource
- amount
- service
- target service
- server
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The application discloses a service resource adjustment method and a server, wherein the method is used for acquiring the resource usage amount of a target service in a server cluster at the current moment and at least one historical moment, determining the resource recommendation amount according to the resource usage amount of the target service at the current moment, determining resource adjustment information according to the ratio between the resource usage amount of the target service at the current moment and the resource allocation amount, increasing the resource allocation amount of the target service according to the resource recommendation amount and the residual resource amount of the server of the target service after providing resources for the service configured on the server under the condition that the resource adjustment information represents the increased resource amount, and restarting the target service under the condition that the resource adjustment information represents the reduced resource amount and the resource usage amount at the current moment is larger than the resource recommendation amount, and determining the resource recommendation amount to be the resource allocation amount of the restarted target service. By adopting the method, the resources of the service can be automatically adjusted, and the abnormal condition of the service is reduced.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a service resource adjustment method and a server.
Background
In a cloud platform cluster environment, for example, a container cloud cluster based on Kubernetes, service resources need to be frequently adjusted along with service development, for example, when the traffic scale is increased, the resource quantity needs to be increased, and when the traffic scale is decreased, the resource quantity needs to be reduced.
In the traditional service resource adjustment method, the old Pod instance needs to be deleted first and then the new Pod instance needs to be created, the creation process of the new Pod instance needs to go through a series of processes of scheduling, pulling mirror images, storing and mounting, creating a container, starting the container, passing health inspection and the like, service in the creation process may have request interruption, service continuity is affected, if the server resource is insufficient, the new Pod instance may not be scheduled, service stability is affected, and therefore, the traditional service resource adjustment method may cause the problem of abnormal service operation.
Disclosure of Invention
The application provides a service resource adjusting method and a server, which are used for solving the problem of abnormal service operation caused by service resource adjustment.
In a first aspect, some embodiments provide a service resource adjustment method, including:
Acquiring the resource usage amount of a target service in a server cluster at the current moment and at least one historical moment;
Determining a resource recommendation amount according to the resource usage amount of at least one historical moment;
determining resource adjustment information according to the ratio of the resource usage amount of the target service at the current moment to the resource allocation amount;
Under the condition that the resource adjustment information represents the increased resource quantity, the resource allocation quantity of the target service is increased according to the resource recommendation quantity and the residual resource quantity of the server where the target service is located after providing the resources for the service configured on the server;
and restarting the target service under the condition that the resource adjustment information represents the reduced resource quantity and the current resource usage quantity is larger than the resource recommendation quantity, and determining the resource recommendation quantity as the resource allocation quantity of the restarted target service.
The method for adjusting the service resources has the advantages that the resource recommended amount is determined according to the resource usage amount of the target service in the server cluster at the current moment and at least one historical moment, the resource recommended amount can reflect the historical resource usage situation of the target service, service resource adjustment is conducted based on the resource recommended amount, abnormal service operation caused by service resource adjustment is avoided, in addition, resource adjustment information is determined according to the ratio between the resource usage amount of the target service at the current moment and the resource allocated amount, when the resource adjustment information represents the increased resource amount, the resource allocated amount of the target service is increased according to the resource recommended amount and the residual resource amount of the target service after the resource is provided for the service configured by the server, the resource allocated amount of the target service is increased, the method for directly increasing the resource allocated amount when the resource amount is required to be increased is used, the service interruption problem caused by restarting the service is avoided, when the resource adjustment information represents the reduced resource amount and the resource usage amount at the current moment is larger than the resource recommended amount, the service operation abnormality caused by restarting the target service is avoided, the problem that the recommended service is not stable is solved when the resource allocation amount of the target service is required to be used is reduced, and the abnormal service problem caused by the service is avoided.
In a second aspect, some embodiments further provide a server comprising a processor, the processor comprising a resource recommendation service and a resource adjustment control service, wherein:
The resource recommendation service is used for acquiring the resource usage amount of the target service in the server cluster at the current moment and at least one historical moment;
The resource adjustment control service is used for determining resource adjustment information according to the ratio of the resource usage amount of the target service at the current moment to the resource allocation amount;
The resource adjustment control service is further used for increasing the resource allocation amount of the target service according to the resource recommendation amount and the residual resource amount of the server where the target service is located after providing the resources for the service configured on the server when the resource adjustment information represents the increased resource amount, restarting the target service when the resource adjustment information represents the decreased resource amount and the current time resource usage amount is larger than the resource recommendation amount, and determining the resource recommendation amount as the resource allocation amount of the restarted target service.
The server has the technical effects that some embodiments provide a server, the server comprises a processor, a resource recommendation service of the processor is used for determining the resource recommendation quantity according to the resource usage quantity of a target service in a server cluster at the current moment and at least one historical moment, the resource recommendation quantity can reflect the historical resource usage condition of the target service, service resource adjustment is carried out based on the resource recommendation quantity, service operation abnormity caused by service resource adjustment is avoided, meanwhile, a resource adjustment control service of the processor is used for determining resource adjustment information according to the ratio between the resource usage quantity of the target service at the current moment and the resource allocation quantity, the resource adjustment information characterizes the residual resource quantity of the target service after resources are provided for the service configured by the target service and the resource allocation quantity of the target service is increased under the condition that the resource recommendation quantity is increased, the resource allocation quantity of the target service is increased under the condition that the resource allocation quantity is required to be increased, the service interruption problem caused by restarting service is avoided, the resource adjustment control service is used for representing the situation that the resource adjustment information is reduced, the resource consumption of the target service is larger than the resource quantity at the current moment, the resource is not recommended under the condition that the resource adjustment is required to be restarted, the situation that the resource is not is required to be equal to the resource allocation quantity is avoided, and the problem of the target service is not is solved, and the problem that the resource is not regulated is solved under the condition that the resource adjustment is recommended is required to be the resource is required to be restarted is required to the service resource is required.
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 diagram illustrating data interaction between a display device and a server according to some embodiments of the present application;
FIG. 2 is a schematic flow chart of creating Pod examples according to some embodiments of the present application;
Fig. 3 is a flowchart illustrating a service resource adjustment method according to some embodiments of the present application;
FIG. 4 is a schematic diagram illustrating a server according to some embodiments of the present application;
FIG. 5 is a schematic flow chart of creating Pod examples according to other embodiments of the present application;
FIG. 6 is a schematic diagram of a sub-process of S400 according to some embodiments of the present application;
FIG. 7 is a schematic diagram of a sub-process of S200 according to some embodiments of the present application;
FIG. 8 is a schematic diagram of a sub-process of S100 according to some embodiments of the present application;
FIG. 9 is a flowchart illustrating a method for adjusting service resources according to other embodiments of the present application;
Fig. 10 is an internal structural diagram of a computer device according to some embodiments of the present application.
Detailed Description
Reference will now be made in detail to the embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The embodiments described in the examples below do not represent all embodiments consistent with the application. Merely exemplary of systems and methods consistent with aspects of the application as set forth in the claims.
It should be noted that the brief description of the terminology in the present application is for the purpose of facilitating understanding of the embodiments described below only and is not intended to limit the embodiments of the present application. Unless otherwise indicated, these terms should be construed in their ordinary and customary meaning.
The terms first, second, third and the like in the description and in the claims and in the above-described figures are used for distinguishing between similar or similar objects or entities and not necessarily for describing a particular sequential or chronological order, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements explicitly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware or/and software code that is capable of performing the function associated with that element.
In the present embodiment, the display device 200 generally refers to a device having screen display and data processing capabilities. For example, display device 200 includes, but is not limited to, a smart television, a mobile terminal, a computer, a monitor, an advertising screen, a wearable device, a virtual reality device, an augmented reality device, and the like.
Fig. 1 is a schematic diagram illustrating data interaction between a display device and a server according to some embodiments of the present application. As shown in fig. 1, the display device 200 communicates data with the server 400 through a variety of communication means. The display device 200 may be permitted to make communication connections via a Local Area Network (LAN), a Wireless Local Area Network (WLAN), and other networks.
As also shown in fig. 1, the user may operate the display device 200 through a touch operation, the mobile terminal 300, and the control device 100. For example, the control device 100 may be a remote control, a stylus, a handle, or the like.
The mobile terminal 300 may serve as a control device for performing man-machine interaction between a user and the display device 200. The mobile terminal 300 may also be used as a communication device for establishing a communication connection with the display device 200 for data interaction. In some embodiments, the mobile terminal 300 may install a software application with the display device 200, implement connection communication through a network communication protocol, and achieve the purpose of one-to-one control operation and data communication. The audio/video content displayed on the mobile terminal 300 can also be transmitted to the display device 200, so as to realize the synchronous display function.
The display device 200 may provide a broadcast receiving tv function, and may additionally provide an intelligent network tv function of a computer supporting function, including, but not limited to, a network tv, an intelligent tv, an Internet Protocol Tv (IPTV), etc.
In the rapid development of cloud computing and distributed systems, kubernetes is a mainstream container orchestration platform, and its resource management capability is mainly realized through Pod specification definition. In the traditional scheme, service resource adjustment needs to update a service, a Pod instance corresponding to the service needs to be deleted and a new instance needs to be created, and the creation process of the new Pod instance needs to go through a series of processes of scheduling, pulling a mirror image, storing and mounting, creating a container, starting the container, passing health inspection and the like. A schematic flow chart of creating a Pod instance is presented with reference to fig. 2. The user initiates an instance creation request through a request initiation module executing kubectl commands and authenticates through kuberconfig, passes Pod instance and server binding information to an interface service unit (for example, API SERVER) through a watch interface of a scheduling module, writes Pod instance and server binding information and the like into a storage unit etcd through the interface service unit, meanwhile, the scheduling module transmits Pod to a kubelet module of a corresponding server to operate, the kubelet module creates a Pod network by calling a first interface (for example, a CNI interface), creates a startup container through a second interface (for example, a CRI interface), and calls a third interface (for example, a CSI interface) to create a mount of a volume if a mount volume exists, so that the creation of the Pod instance is realized. As can be seen from fig. 2, there may be a service interruption during the update service, thereby affecting service continuity. In addition, newly creating a Pod during the update service requires re-pulling the mirror image, which can also create stress on the nodes and the mirror library. If the server resources are insufficient, the new Pod instance may not be scheduled, which affects service stability, and thus, the conventional service resource adjustment method may cause a problem of abnormal service operation.
Aiming at the problems, public cloud manufacturers provide the function of in-situ upgrading of Pod, namely, a user can adjust service resources according to requirements without restarting Pod, but the method needs to create resource types different from Kubernetes original resources, and how the user needs to use the in-situ upgrading capability and needs to reform the service into corresponding resource types. For a server cluster which already uses a large amount of Kubernetes native resources, a user needs to delete all services and then create services by using the resource types provided by public cloud manufacturers, so that the problem that the service resources are complicated to adjust and do not support the Kubernetes native resources exists.
In addition, kubernetes also provides the capability of Pod in-place updating of service resources, which can support service resource adjustment for services created by Kubernetes native resources. The method has the defects that 1, service resources only support one adjustment strategy, namely service resources are adjusted by restarting a container or service resources are adjusted without restarting the container, when the service resources are required to be increased, the service resources are required to be adjusted by restarting the container, the problem of service continuity is possibly caused by interruption of requests, and when the service resources are required to be reduced, the service resources are not required to be directly adjusted by restarting the container, the shortage of the service resources is possibly caused, and a new Pod instance can not be scheduled, so that service stability is possibly influenced. 2. The number of service resource adjustment does not have theoretical basis, and users can adjust service resources at will, so that service abnormality is likely to be caused.
Based on the above, the embodiment of the application provides a service resource adjustment method and a server, which are used for determining the resource recommendation amount according to the resource usage amount of a target service in a server cluster at the current moment and at least one historical moment, wherein the resource recommendation amount can reflect the historical resource usage condition of the target service, the service resource adjustment is performed based on the resource recommendation amount, which is beneficial to avoiding abnormal service operation caused by service resource adjustment, in addition, the resource adjustment information is determined according to the ratio between the resource usage amount of the target service at the current moment and the resource allocation amount, under the condition that the resource adjustment information represents the increased resource amount, the resource allocation amount of the target service is increased according to the resource recommendation amount and the residual resource amount of the server for providing resources for the service configured on the target service, the method for directly increasing the resource allocation amount under the condition that the resource amount needs to be increased is beneficial to avoiding service interruption caused by restarting the service, under the condition that the resource adjustment information represents the reduced resource amount and the resource usage amount at the current moment is larger than the resource recommendation amount, the target service is restarted, and the problem that the service is not suitable for the service allocation amount is avoided due to the fact that the service is unstable after the resource is restarted is required to be used.
Fig. 3 is a flowchart illustrating a service resource adjustment method according to some embodiments of the present application. In the embodiment of the application, the service resource adjustment method can be applied to a terminal or a server, can also be applied to a system comprising the terminal and the server, and is realized through interaction between the terminal and the server. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud computing service. The embodiment is exemplified by the method applied to the server, and includes the following steps S100 to S400, in which:
S100, obtaining the resource usage of the target service in the server cluster at the current moment and at least one historical moment.
The server cluster refers to a cloud platform server cluster, and may be a container cloud cluster based on Kubernetes, for example. The server cluster includes a plurality of servers, each of which can configure at least one service, each of which provides service resources for the respective configured service to support service operation. The services configured in the server are abstract layers in Kubernetes, defining a logical set and policies for accessing the services. The service allows access to a set of applications running on one or more Pod, and provides a stable access portal for Pod, i.e. access to Pod instances in the service is possible at any one server by accessing the portal address provided by the service. The container is a lightweight virtualization technology, and packages the application program and its dependencies in a separate running environment, which is a component of the Pod instance. The Pod instance is the smallest deployable and manageable unit in a Kubernetes-based container cloud cluster, which is a collection of closely related containers that share network and storage resources. The Pod instance is scheduled to run on a server, and one server can run multiple Pod instances.
The target service is a service in the server cluster, which needs to be monitored for resources. Resources that need to be monitored include, but are not limited to, memory and CPU. The resource usage refers to the amount of resources used by the target service at a particular time. At the same time, the service in the server cluster, which needs to monitor the resource, includes at least one service, and the application is illustrated by taking any target service in the server cluster, which needs to monitor the resource, as an example.
The current time refers to the time when the processor obtains the resource usage. For example, the processor may set, starting from a preset time, to determine a plurality of acquisition times with a preset time period, and when the current time is any acquisition time, acquire the resource usage amount of the target service at the current time and at least one historical time.
The historical time is earlier than the current time, and the processor can acquire the resource usage of the target service at all the historical times in a time period earlier than the current time, and flexibly select the resource usage of a plurality of the historical times according to the requirements. Or the processor may also pre-select the recording time, acquire the resource usage of the target service at the recording time, and use the resource usage acquired at each recording time as the resource usage of at least one historical time.
In some embodiments, fig. 4 is a schematic diagram illustrating the composition of a server according to some embodiments of the present application. The processor is configured to deploy a resource recommendation service 401, configured to obtain a resource usage amount of a target service in a server cluster at a current time and at least one historical time.
S200, determining a resource recommendation amount according to the resource usage amount of at least one historical moment.
The resource recommendation amount is used for adjusting the resources of the target service. The processor determines a resource recommendation based on the resource usage at the at least one historical time, the resource recommendation being capable of reflecting the resource usage of the target service at the at least one historical time. For example, the processor may take as the recommended amount of resources an average, median, mode, or the like of the resource usage amount at least at one historical time. Therefore, the resource recommendation quantity can be based on the resource use condition at the historical moment, and the service resource adjustment based on the resource recommendation quantity has extremely high rationality, and is beneficial to avoiding service abnormality compared with the random adjustment of the service resource by a user.
In some embodiments, referring to FIG. 4, the resource recommendation service 401 is responsible for determining a resource recommendation based on the resource usage at least one historical time.
S300, determining resource adjustment information according to the ratio of the resource usage amount of the target service at the current moment to the resource allocation amount.
Wherein the resource allocation amount refers to the amount of resources allocated by the server to the target service. The amount of resources allocated for each service in the server may be different, and since the processor may adjust the amount of resources allocated for each service, the processor should obtain the amount of resources allocated for the target service at the current time.
The ratio between the resource usage of the target service at the current time and the resource allocation is used to characterize the usage ratio of the resource in the allocation. The maximum value of the resource usage amount is the resource allocation amount.
The resource adjustment information is used to characterize whether the amount of resources needs to be adjusted, and when the amount of resources needs to be adjusted, the resource adjustment information may include any one of increasing the amount of resources and decreasing the amount of resources. For example, when the traffic scale increases, the resource adjustment information may be to increase the amount of resources, when the traffic scale decreases, the resource adjustment information may be to decrease the amount of resources, and when the traffic scale does not change, the resource adjustment information may be to keep the amount of resources unchanged.
In some embodiments, referring to fig. 4, the processor further includes a resource adjustment control service 402 for determining resource adjustment information according to a ratio between a resource usage amount and a resource allocation amount of the target service at a current time.
And S400, under the condition that the resource adjustment information represents the increased resource quantity, increasing the resource allocation quantity of the target service according to the resource recommendation quantity and the residual resource quantity of the server where the target service is located after providing the resources for the service configured on the server, and under the condition that the resource adjustment information represents the reduced resource quantity and the current time resource usage quantity is larger than the resource recommendation quantity, restarting the target service, and determining the resource recommendation quantity as the resource allocation quantity of the restarted target service.
In some embodiments, referring to fig. 4, the resource adjustment control service 402 is further configured to perform automatic resource adjustment, including increasing a resource allocation amount of the target service according to the resource recommendation amount and a remaining resource amount of a server where the target service is located after providing resources for the service configured on the server when the resource adjustment information indicates that the resource amount is increased, restarting the target service when the resource adjustment information indicates that the resource amount is reduced and the resource usage amount at the current time is greater than the resource recommendation amount, and determining the resource recommendation amount as the resource allocation amount of the restarted target service.
At least one service is configured in a server where the target service is located, and the server allocates resources for each service respectively. The amount of resource usage by each service is often less than the amount of resource allocation that the server provides for that service, and therefore there are typically some unused resources left in the server. The residual resource quantity corresponding to each service is the difference between the resource allocation quantity and the resource usage quantity of the service, and the processor sums the residual resource quantities corresponding to all the services in the server to obtain the residual resource quantity of the server where the target service is located after providing the resources for the service configured on the server.
Under the condition that the resource adjustment information represents the increase of the resource quantity, the processor can increase the resource allocation quantity of the target service according to the resource recommendation quantity and the residual resource quantity of the server where the target service is located after providing the resources for the service configured on the processor, and under the condition that the resource quantity needs to be increased, the resource allocation quantity of the target service is directly increased without restarting the service, so that the problems of service interruption, mirror image library pressure and the like caused by restarting the service are avoided, and the continuity of service operation is guaranteed; in addition, the adjustment of the resource allocation amount ensures the rationality of the resource adjustment according to the recommended amount of the resource and the residual amount of the resource, and avoids the problems of resource waste caused by excessive resource allocation or abnormal service operation caused by insufficient resource allocation.
The resource usage amount at the current moment is larger than the resource recommendation amount, which indicates that the target service needs to use more resources at the current moment, and if the resource allocation amount of the target service is directly reduced to the resource recommendation amount, the problem that the Pod instance cannot be scheduled may occur. Therefore, in the case where the resource adjustment information characterizes the increased resource amount, it is necessary to further consider whether or not the resource usage amount at the present time is greater than the recommended resource amount.
Under the condition that the resource adjustment information represents the reduced resource quantity and the current resource usage quantity is larger than the resource recommended quantity, the processor needs to restart the target service, and the resource recommended quantity is determined to be the resource allocation quantity of the restarted target service, so that service abnormality caused by directly adjusting the resource is avoided.
And restarting the target service, wherein the restarting is mainly performed on the Pod instance corresponding to the target service. Fig. 5 is a schematic flow chart of creating Pod examples according to other embodiments of the present application. The processor comprises a Pod instance creation module, and comprises a control unit (for example, VPA Conteoller), an interface service unit (for example, API SERVER), an aggregator (for example, METRICS SERVER), a history data storage unit, a Pod creation unit and the like, wherein the interface service unit is used for acquiring a Pod instance creation request through the aggregator, the request carries the number of resources required by the Pod instance, the history data storage unit is used for storing the request and the corresponding number of resources, the control unit responds to the Pod instance creation request, calculates a recommended quantity and sends the recommended quantity to the Pod creation unit, and the Pod creation unit is used for creating the Pod instance matched with the recommended quantity.
In the embodiment of the application, the resource recommended amount is determined according to the resource usage amount of the target service in the server cluster at the current moment and at least one historical moment, the resource recommended amount can reflect the historical resource usage condition of the target service, service resource adjustment is carried out based on the resource recommended amount, so that abnormal service operation caused by service resource adjustment is avoided, in addition, the resource adjustment information is determined according to the ratio between the resource usage amount of the target service at the current moment and the resource allocation amount, under the condition that the resource adjustment information represents the increased resource amount, the resource allocation amount of the target service is increased according to the resource recommended amount and the residual resource amount of the target service after the server provides resources for the service configured on the target service, the method for directly increasing the resource allocation amount under the condition that the resource amount needs to be increased is used for avoiding the service interruption problem caused by restarting the service, under the condition that the resource adjustment information represents the reduced resource amount and the resource usage amount at the current moment is larger than the resource recommended amount, the resource allocation amount of the target service is restarted, the resource of the target service after restarting is determined, and the problem of the target service after the restarting is required to be reduced is solved, so that the service problem caused by the abnormal service operation is avoided.
In some embodiments, as shown in fig. 6, increasing the resource allocation amount of the target service according to the resource recommendation amount and the remaining resource amount of the server where the target service is located after providing the resource for the service configured on the server includes:
s602, determining a resource adjustment amount according to the resource recommendation amount and the resource allocation amount;
S604, when the remaining resource amount of the server where the target service is located after providing the resource for the service configured on the server is not smaller than the resource adjustment amount, the resource allocation amount of the target service is increased to the resource recommendation amount.
The resource adjustment amount refers to an amount of resources that need to be adjusted to increase the current amount of resource allocation of the target service to the recommended amount of resources. The processor may take the difference between the recommended amount of resources and the allocated amount of resources as the resource adjustment amount.
The residual resource amount of the server of the target service after providing the resources for the service configured on the server is not less than the resource adjustment amount, and the residual resource amount of the server is enough to carry out resource adjustment on the target service.
For example, when the allocation amount of the resources of the target service at the current moment is 100, the usage amount of the resources is 90, the recommended amount of the resources is 120, and the remaining usage amount of the resources is 40, the allocation amount of the resources can be directly adjusted to 120, so that the normal operation of the service can be ensured.
In the embodiment of the application, the processor compares the residual resource quantity of the server with the resource adjustment quantity under the condition that the resource quantity needs to be increased, so that when the residual resource quantity is determined to be enough for the target service to carry out resource adjustment, the resource allocation quantity of the target service is directly increased to the resource recommendation quantity, the problem that the service is not required to be restarted, such as service interruption caused by the service restart, mirror image library pressure and the like, is beneficial to ensuring the continuity of service operation, and in addition, the adjustment of the resource allocation quantity is beneficial to avoiding the problem that the service operation is abnormal and the like caused by unreasonable resource allocation according to the resource recommendation quantity and the residual resource quantity.
In some embodiments, the service resource adjustment method further includes returning to the step of obtaining the resource usage amount of the target service in the server cluster at the current time and at least one historical time and continuing to execute the step until the updated resource adjustment information indicates that the resource amount is increased, and the updated residual resource amount is not less than the updated resource adjustment amount, and increasing the resource allocation amount of the target service to the updated resource recommendation amount when the residual resource amount of the target service after providing the resource for the service configured on the target service is less than the resource adjustment amount.
The server where the target service is located provides resources for the service configured on the server with the residual resource amount smaller than the resource adjustment amount, and the residual resource amount representing the server is insufficient for carrying out resource adjustment on the target service, so that the processor can wait for the next resource adjustment period, and in a new resource adjustment period, if the condition that the updated resource adjustment information represents increasing the resource amount and the updated residual resource amount is not smaller than the updated resource adjustment amount is met, the resource allocation amount of the target service is increased to the updated resource recommendation amount, and automatic adjustment of the resources is realized.
For example, if the allocation amount of the resource of the target service at the current time is 100, the resource usage amount is 90, the recommended resource amount is 120, and the remaining resource usage amount is 20, the target service needs to wait for the next resource adjustment period again, and if the remaining resource amount of the new resource adjustment period exceeds 30, the allocation amount of the resource can be adjusted to 120.
In the embodiment of the application, the processor waits for the next resource adjustment period without restarting the service under the condition that the resource amount needs to be increased, if the residual resource amount of the server is insufficient for carrying out resource adjustment on the target service, and simultaneously, the processor automatically adjusts the resource when the new resource adjustment period meets the resource adjustment condition, thereby being beneficial to ensuring the continuity of the service.
In some embodiments, the service resource adjustment method further comprises reducing the resource allocation amount of the target service to the resource recommendation amount in the case that the resource adjustment information characterizes the reduced resource amount and the resource usage amount at the current time is not greater than the resource recommendation amount.
The method comprises the steps that the resource consumption of a target service at the current moment is not larger than a resource recommended quantity, the fact that the target service needs to use a small quantity of resources at the current moment is indicated, if the resource distribution quantity of the target service is reduced to the resource recommended quantity, normal operation of the service is not affected, and therefore the processor reduces the resource distribution quantity of the target service to the resource recommended quantity under the condition that the resource adjustment information indicates that the resource quantity is reduced and the resource consumption of the target service at the current moment is not larger than the resource recommended quantity.
For example, the allocation amount of the resources of the target service at the current moment is 100, the usage amount of the resources is 15, the recommended amount of the resources is 40, and the allocation amount of the resources can be directly adjusted to 40, so that the normal operation of the service can be ensured.
In the embodiment of the application, the processor directly reduces the resource allocation amount of the target service to the resource recommended amount under the condition that the resource adjustment information represents the reduced resource amount and the resource usage amount at the current moment is not more than the resource recommended amount, so that the service is not required to be restarted, the normal operation of the service is not influenced, and the problems of service interruption, mirror library pressure and the like caused by restarting the service are avoided.
In some embodiments, as shown in fig. 7, determining the recommended amount of resources based on the amount of resource usage at the at least one historical time includes:
s702, sorting the resource usage amount of at least one historical moment according to the order of magnitude.
S704, determining a plurality of target resource usage amounts which are ordered within a preset range from the ordered plurality of resource usage amounts.
S706, a resource recommendation amount is determined based on the plurality of target resource usage amounts.
In order to ensure that the recommended resource amount can cover most of the resource usage amounts at the historical time, the embodiment of the application provides that the resource usage amounts at least at one historical time are ordered according to the size sequence, and a plurality of target resource usage amounts ordered within a preset range are selected from the ordered plurality of resource usage amounts. The preset range is a continuous position range, and can be flexibly selected according to actual requirements, for example, an intermediate position range (for example, a range of 5% to 95%), a position range close to a minimum value (for example, a range of 0 to 99%), a resource usage amount of a position range close to a maximum value (for example, a range of 1 to 100%), and the like can be selected.
The processor determines the recommended amount of the resource based on the plurality of target resource usage amounts, and may use an average value, a median, a mode, or the like of the plurality of target resource usage amounts as the recommended amount of the resource.
In the embodiment of the application, the processor sorts the resource usage amount of at least one historical moment according to the order of magnitude, and selects a plurality of target resource usage amounts sorted in a preset range from the resource usage amounts, thereby being beneficial to ensuring that the plurality of target resource usage amounts can cover most of the resource usage amounts of the historical moment, determining the resource recommendation amount based on the plurality of target resource usage amounts, ensuring that the resource recommendation amount can reflect the resource usage condition of the historical moment, and improving the rationality of resource adjustment based on the resource recommendation amount.
In some embodiments, determining the resource adjustment information based on a ratio between the amount of resource usage of the target service at the current time and the amount of resource allocation includes determining that the resource adjustment information characterizes a reduced amount of resource if the ratio between the amount of resource usage of the target service at the current time and the amount of resource allocation is less than a first preset ratio, determining that the resource adjustment information characterizes an increased amount of resource if the ratio between the amount of resource usage of the target service at the current time and the amount of resource allocation is greater than a second preset ratio, and the first preset ratio is less than the second preset ratio.
The ratio between the resource usage amount and the resource allocation amount of the target service at the same time is smaller than 1, the larger the ratio is, the more the resource usage is, the more the traffic rise is possible, and the smaller the ratio is, the less the resource usage is, the traffic drop is possible.
The processor presets a first preset proportion and a second preset proportion, both of which are smaller than 1, and the first preset proportion is smaller than the second preset proportion. For example, the first preset proportion may be 20% and the second preset proportion may be 80%.
The processor determines that the resource adjustment information characterizes the reduced resource amount when the ratio is less than a first preset ratio, and determines that the resource adjustment information characterizes the increased resource amount when the ratio is greater than a second preset ratio. For example, the ratio is 15%, the processor determines that the resource adjustment information characterizes a reduced amount of resources, the ratio is 90%, and the processor determines that the resource adjustment information characterizes an increased amount of resources.
In the embodiment of the application, the processor determines the resource adjustment information by comparing the ratio of the resource usage amount of the target service at the current moment to the resource allocation amount with the first preset ratio or the second preset ratio, wherein the ratio is smaller than the first preset ratio to indicate that the resource usage amount is less, the resource amount needs to be reduced, the ratio is larger than the second preset ratio to indicate that the resource usage amount is more, and the resource amount needs to be increased.
In some embodiments, as shown in fig. 8, obtaining the resource usage of the target service in the server cluster at the current time and at least one historical time includes:
S802, in response to a service resource monitoring request, determining target service and a monitoring time interval which need to be monitored in a server cluster;
S804, acquiring the resource usage of the target service at the current moment and at least one historical moment according to the monitoring time interval.
The processor may monitor the resource usage of the target service according to a preset monitoring time interval. The service resource monitoring request is a request initiated by a user to a server for monitoring a target service. In some embodiments, the service monitoring request carries a service identifier and a monitoring time interval of a target service to be monitored, and the processor determines the target service and the monitoring time interval to be monitored by analyzing the service monitoring request.
The processor obtains the resource usage of the target service at the current time and at least one historical time according to the monitoring time interval. The processor takes the moment of receiving the service resource monitoring request as the starting moment, determines a plurality of acquisition moments according to the monitoring time interval, and acquires the resource usage of the target service at the current moment and at least one historical moment when the current moment is any acquisition moment.
For example, the historical time may be a plurality of times within a week prior to the current time. The monitoring time interval may be 2 seconds.
In some embodiments, referring to fig. 4, the processor further includes a resource management service 403, configured to store at least one of a resource recommendation value, a resource usage amount, resource adjustment information, a resource allocation amount, and a remaining resource amount of a server where the target service is located after providing resources for a service configured on the server, into the database.
In some embodiments, the service resource monitoring request is used for indicating to monitor all services in the server cluster to obtain the resource usage of all services at the current time and at least one historical time, and the resource management service 403 is further used for summarizing and counting the resource usage of each service according to the subsystem dimension, the tenant dimension, the cluster dimension, the node dimension, and the like, where the resource usage includes at least one of a recommended value of the resource, the resource usage of each service at the current time, resource adjustment information, the resource allocation, and the remaining resource amount of the server where the service is located after providing the resource for the service configured on the server. The subsystem dimension refers to all services under the whole naming space, the tenant dimension refers to services corresponding to a single tenant, the cluster dimension refers to all services under the whole server cluster, and the node dimension refers to services corresponding to a single server.
In the embodiment of the application, the processor responds to the service resource monitoring request, monitors the resource usage based on the target service indicated by the service resource monitoring request and the monitoring time interval, and the service resource monitoring request can be initiated according to the user demand, thereby improving the flexibility of monitoring the target service.
In some embodiments, the service resource adjustment method further comprises adding the target service to the resource elevation work queue before increasing the resource allocation amount of the target service according to the resource recommendation amount and the residual resource amount of the server of the target service after providing the resources for the service configured on the server, and executing the step of increasing the resource allocation amount of the target service according to the resource recommendation amount and the residual resource amount of the server of the target service after providing the resources for the service configured on the server of the target service under the condition that the target service is taken out from the resource elevation work queue.
In some embodiments, the service resource adjustment method further comprises the steps of adding the target service to the resource reduction work queue before restarting the target service and determining the recommended amount of resources as the allocated amount of resources of the restarted target service, and executing the restarting of the target service and determining the recommended amount of resources as the allocated amount of resources of the restarted target service if the target service is fetched from the resource reduction work queue.
In the above embodiment, the target services needing to increase the resources and the target services needing to decrease the resources are respectively added to the corresponding work queues, so that the resource adjustment is performed on each service in the work queues in sequence.
The embodiment of the application also provides a server. The implementation of the solution provided by the server is similar to the implementation described in the above method, so the specific limitation in one or more server embodiments provided below may refer to the limitation of the service resource adjustment method hereinabove, and will not be repeated here.
In some embodiments, the server includes a processor for performing the above-described service resource adjustment method. Referring to fig. 4, the processor includes a resource recommendation service and a resource adjustment control service, wherein:
The resource recommendation service is used for acquiring the resource usage amount of the target service in the server cluster at the current moment and at least one historical moment;
The resource adjustment control service is used for determining resource adjustment information according to the ratio of the resource usage amount of the target service at the current moment to the resource allocation amount;
The resource adjustment control service is further used for increasing the resource allocation amount of the target service according to the resource recommendation amount and the residual resource amount of the server where the target service is located after providing the resources for the service configured on the server when the resource adjustment information represents the increased resource amount, restarting the target service when the resource adjustment information represents the decreased resource amount and the current time resource usage amount is larger than the resource recommendation amount, and determining the resource recommendation amount as the resource allocation amount of the restarted target service.
The server comprises a processor, wherein the resource recommendation service of the processor determines the resource recommendation quantity according to the resource use quantity of the target service in the server cluster at the current moment and at least one historical moment, the resource recommendation quantity can reflect the historical resource use condition of the target service, service resource adjustment is carried out based on the resource recommendation quantity, service operation abnormality caused by service resource adjustment is avoided, meanwhile, resource adjustment control service of the processor determines resource adjustment information according to the ratio between the resource use quantity of the target service at the current moment and the resource allocation quantity, the resource allocation quantity of the target service is increased according to the resource recommendation quantity and the residual resource quantity of the server of the target service after the resource is provided for the service allocated by the target service when the resource adjustment information represents the increase of the resource quantity, the resource allocation quantity of the target service is increased, the method for directly increasing the resource allocation quantity when the resource quantity is required to be increased is adopted is used, the problem of service interruption caused by restarting is avoided, in addition, the resource adjustment control service is restarted when the resource adjustment information represents the resource quantity is reduced and the resource use quantity at the current moment is larger than the recommended quantity, the resource adjustment information is used for restarting the target service, the resource consumption is not stable, and the problem of the service is avoided when the resource is not regulated when the recommended resource allocation quantity is required to be used for the target service is not to be stably allocated.
In some embodiments, the resource adjustment control service is further configured to determine a resource adjustment amount according to the resource recommendation amount and the resource allocation amount, and increase the resource allocation amount of the target service to the resource recommendation amount when a remaining resource amount of the server where the target service is located after providing the resource for the service configured on the server is not less than the resource adjustment amount.
In some embodiments, the resource adjustment control service is further configured to return to the step of obtaining the resource usage amount of the target service in the server cluster at the current time and at least one historical time and continue to execute until the updated resource adjustment information indicates that the resource amount is increased, and the updated remaining resource amount is not less than the updated resource adjustment amount, and increase the resource allocation amount of the target service to the updated resource recommendation amount, where the remaining resource amount of the target service after providing the resource for the service configured on the server is less than the resource adjustment amount.
In some embodiments, the resource adjustment control service is further configured to reduce the resource allocation amount of the target service to the resource recommendation amount if the resource adjustment information characterizes the reduced resource amount and the current time of use of the resource is not greater than the resource recommendation amount.
In some embodiments, the resource recommendation is determined according to the resource usage at the at least one historical time, and the resource recommendation service is further configured to rank the resource usage at the at least one historical time in order of magnitude, determine a plurality of target resource usage ranked within a preset range from among the plurality of ranked resource usage, and determine the resource recommendation based on the plurality of target resource usage.
In some embodiments, the resource adjustment information is determined according to a ratio between a resource usage amount and a resource allocation amount of the target service at the current time, and the resource adjustment control service is further configured to determine that the resource adjustment information characterizes the reduced resource amount if the ratio between the resource usage amount and the resource allocation amount of the target service at the current time is smaller than a first preset ratio, determine that the resource adjustment information characterizes the increased resource amount if the ratio between the resource usage amount and the resource allocation amount of the target service at the current time is larger than a second preset ratio, and the first preset ratio is smaller than the second preset ratio.
In some embodiments, the resource recommendation service is further configured to determine, in response to a service resource monitoring request, a target service and a monitoring time interval in the server cluster, where the target service needs to be monitored, and obtain, according to the monitoring time interval, a resource usage amount of the target service at the current time and at least one historical time.
In some embodiments, the server further comprises a resource management service, the resource management service is used for storing the resource usage amount and the resource recommendation amount of the target service at the current moment in a database, the resource adjustment control service is further used for inquiring the resource usage amount and the resource recommendation amount of the target service at the current moment in the database through the resource management service, increasing the resource allocation amount of the target service according to the resource recommendation amount and the residual resource amount of the server where the target service is located after providing resources for the service configured on the server when the resource adjustment information represents the increased resource amount, and restarting the target service when the resource adjustment information represents the decreased resource amount and the resource usage amount at the current moment is larger than the resource recommendation amount, and determining the resource recommendation amount to be the resource allocation amount of the restarted target service.
In some embodiments, the resource management service is further configured to add the target service to the resource-elevating work queue before increasing the resource allocation amount of the target service according to the resource recommendation amount and the remaining resource amount of the server where the target service is located after providing the resource for the service configured on the server, and the resource adjustment control service is further configured to perform the step of increasing the resource allocation amount of the target service according to the resource recommendation amount and the remaining resource amount of the server where the target service is located after providing the resource for the service configured on the server where the target service is located, in a case of taking the target service out of the resource-elevating work queue.
In some embodiments, the resource management service is further configured to add the target service to the resource reduction work queue before restarting the target service and determining the recommended amount of resources as the amount of resources allocated for the restarted target service, and the resource adjustment control service is further configured to execute the step of restarting the target service and determining the recommended amount of resources as the amount of resources allocated for the restarted target service if the target service is fetched from the resource reduction work queue.
Each of the services in the above processors may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
To describe the service resource adjustment method and the server in this embodiment in detail, the following description will be given with one of the most detailed embodiments:
The service resource adjustment method provided by the embodiment of the application is applied to the server, and the server can be a container cloud cluster based on Kubernetes. The server includes a processor including a resource recommendation service, a resource adjustment control service, and a resource management service. Fig. 9 is a flowchart illustrating a service resource adjustment method according to another embodiment of the application. The method comprises the following steps:
1. A resource recommendation service is deployed, the service is responsible for monitoring all services or target services in the cluster, and a resource recommendation value is calculated according to the resource usage of the service at the current moment and at least one historical moment (for example, the actual usage of CPU and memory resources of the service in the past week), and the resource recommendation value can cover the resource usage of the service at most of the historical moment (for example, the resource usage of 99% of the historical moment).
2. A resource management service is developed and deployed, which is responsible for storing resource recommendation values, resource usage amounts, and the like of service levels in a database table. And the method can also carry out summarization statistics on the resource use conditions of subsystem dimension, tenant dimension, cluster dimension, node dimension and the like.
3. And developing a resource adjustment control service which is mainly responsible for automatically adjusting resource configuration and supporting different resource adjustment information of service resource settings.
And 3.1, the resource adjustment control service support service sets different restarting information of the same resource, for example, the container is not restarted when the resource amount needs to be increased, and the container is restarted when the resource amount needs to be reduced. And judging whether the resource adjustment information is to increase the resource amount or decrease the resource amount by combining the resource using amount of the service at the current moment with the resource recommending amount, and matching the corresponding restarting information.
And 3.2, the resource adjustment control service calls an interface of the resource management service and is used for inquiring the service with the too low resource utilization rate or the too high resource utilization rate in the whole server cluster. And determining that the resource utilization rate of the target service is too high and determining that the resource adjustment information represents increasing the resource quantity under the condition that the ratio between the resource utilization rate of the target service at the current moment and the resource allocation quantity is larger than a second preset ratio. These services have wasted or insufficient resources, and require resource adjustment, which are added to the resource increasing work queue and the resource decreasing work queue, respectively.
And 3.3, the resource adjustment control service takes out the services from each work queue one by one for processing, combines the resource usage amount and the resource adjustment value of the service at the current moment, if the resource adjustment information represents the increased resource amount, the resource adjustment control service needs to judge whether the residual resource amount of the server where the service Pod is positioned meets the resource adjustment requirement or not, namely, if the residual resource amount of the server where the target service is positioned after providing the resources for the service configured on the server is not less than the resource adjustment amount, the resource allocation amount of the target service is increased to the resource recommended amount, if the resource allocation amount is not met, the service is skipped, the next service is continuously processed, and the service which is failed to be adjusted waits for the next processing period to be continuously processed. If the resource adjustment information represents the reduced resource quantity, the situation judgment is needed, if the resource usage quantity at the current moment is not more than the resource recommended quantity, the adjustment is directly carried out, and if the resource usage quantity at the current moment is more than the resource recommended quantity, the container is required to be restarted under the condition, and a container restarting strategy is required to be set when the service resource configuration is adjusted.
According to the service resource adjustment method and the server, the resource usage amount of the target service in the server cluster at the current moment and at least one historical moment is obtained, the resource recommendation amount is determined according to the resource usage amount of the target service at the at least one historical moment, the resource recommendation amount can reflect the historical resource usage situation of the target service, service resource adjustment is conducted based on the resource recommendation amount, abnormal service operation caused by service resource adjustment is avoided, in addition, resource adjustment information is determined according to the ratio between the resource usage amount of the target service at the current moment and the resource allocation amount, when the resource adjustment information represents the increased resource amount, the resource allocation amount of the target service is increased according to the resource recommendation amount and the residual resource amount of the target service after the target service is provided for the service configured on the server, the method for directly increasing the resource allocation amount when the resource amount is required to be increased is used, the service interruption problem caused by restarting the service is avoided, when the resource adjustment information represents the reduced resource amount and the resource usage amount at the current moment is larger than the resource recommendation amount, the service operation problem caused by restarting the target service is solved, the service abnormality is avoided when the resource allocation amount of the target service is required to be reduced, and the service abnormality caused by the service is avoided.
In one exemplary embodiment, a computer device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 10. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing the resource usage amount, the resource recommendation amount, the resource adjustment information and the like of the target service at the current moment and at least one historical moment. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a service resource adjustment method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 10 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, the processor performing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are both information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data are required to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile memory and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (RESISTIVE RANDOM ACCESS MEMORY, reRAM), magneto-resistive Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (PHASE CHANGE Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computation, an artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) processor, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the present application.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.
Claims (10)
1. A method for adjusting service resources, the method comprising:
Acquiring the resource usage amount of a target service in a server cluster at the current moment and at least one historical moment;
Determining a resource recommendation amount according to the resource usage amount of at least one historical moment;
determining resource adjustment information according to the ratio between the resource usage amount and the resource allocation amount of the target service at the current moment;
Under the condition that the resource adjustment information represents increasing the resource quantity, increasing the resource allocation quantity of the target service according to the resource recommendation quantity and the residual resource quantity of the server where the target service is located after providing resources for the service configured on the server;
and restarting the target service under the condition that the resource adjustment information represents the reduced resource quantity and the current resource usage quantity is larger than the resource recommended quantity, and determining the resource recommended quantity as the resource allocation quantity of the restarted target service.
2. The method according to claim 1, wherein increasing the resource allocation amount of the target service according to the resource recommendation amount and a remaining resource amount of the server where the target service is located after providing resources for the service configured on itself, comprises:
Determining a resource adjustment amount according to the resource recommendation amount and the resource allocation amount;
And increasing the resource allocation amount of the target service to the resource recommendation amount under the condition that the residual resource amount of the server of the target service after providing the resources for the service configured on the server is not smaller than the resource adjustment amount.
3. The method according to claim 2, wherein the method further comprises:
And returning to the step of acquiring the resource usage amount of the target service in the server cluster at the current moment and at least one historical moment and continuing to execute the step until the updated resource adjustment information represents the increased resource amount and the updated residual resource amount is not smaller than the updated resource adjustment amount, and increasing the resource allocation amount of the target service to the updated resource recommendation amount under the condition that the residual resource amount of the server providing the resources for the service configured on the server is smaller than the resource adjustment amount.
4. The method according to claim 1, wherein the method further comprises:
And reducing the resource allocation amount of the target service to the resource recommended amount under the condition that the resource adjustment information represents the reduced resource amount and the resource usage amount at the current moment is not more than the resource recommended amount.
5. The method of claim 1, wherein determining the recommended amount of resources based on the amount of resource usage at the at least one historical time comprises:
Sequencing the resource usage amount of at least one historical moment according to the order of magnitude;
determining a plurality of target resource usage amounts which are sequenced in a preset range from the sequenced plurality of resource usage amounts;
A resource recommendation amount is determined based on the plurality of target resource usage amounts.
6. The method of claim 1, wherein the determining the resource adjustment information according to the ratio between the resource usage amount and the resource allocation amount of the target service at the current time comprises:
Determining that the resource adjustment information characterizes the reduction of the resource quantity under the condition that the ratio between the resource usage amount and the resource allocation amount of the target service at the current moment is smaller than a first preset ratio;
and determining that the resource adjustment information characterizes the increased resource amount under the condition that the ratio between the resource usage amount and the resource allocation amount of the target service at the current moment is larger than a second preset ratio, wherein the first preset ratio is smaller than the second preset ratio.
7. The method of claim 1, wherein the obtaining the resource usage of the target service in the server cluster at the current time and at least one historical time comprises:
Responding to a service resource monitoring request, and determining target service and monitoring time interval which need to be monitored in a server cluster;
and acquiring the resource usage of the target service at the current moment and at least one historical moment according to the monitoring time interval.
8. The server is characterized by comprising a processor, wherein the processor comprises a resource recommendation service and a resource adjustment control service, and the server comprises a resource recommendation service and a resource adjustment control service, wherein:
the resource recommendation service is used for acquiring the resource usage amount of the target service in the server cluster at the current moment and at least one historical moment;
the resource adjustment control service is used for determining resource adjustment information according to the ratio of the resource usage amount of the target service at the current moment to the resource allocation amount;
The resource adjustment control service is further configured to increase a resource allocation amount of the target service according to the resource recommendation amount and a remaining resource amount of a server where the target service is located after providing resources for the service configured on the server when the resource adjustment information represents the increase of the resource amount, and restart the target service and determine the resource recommendation amount as the resource allocation amount of the restarted target service when the resource adjustment information represents the decrease of the resource amount and the current resource usage amount is greater than the resource recommendation amount.
9. The server according to claim 8, wherein the resource adjustment control service is further configured to determine a resource adjustment amount based on the resource recommendation amount and the resource allocation amount, and increase the resource allocation amount of the target service to the resource recommendation amount if a remaining resource amount of the server where the target service is located after providing the resource for the service configured on the server is not less than the resource adjustment amount.
10. The server of claim 9, wherein the resource adjustment control service is further configured to:
And returning to the step of acquiring the resource usage amount of the target service in the server cluster at the current moment and at least one historical moment and continuing to execute the step until the updated resource adjustment information represents the increased resource amount and the updated residual resource amount is not smaller than the updated resource adjustment amount, and increasing the resource allocation amount of the target service to the updated resource recommendation amount under the condition that the residual resource amount of the server providing the resources for the service configured on the server is smaller than the resource adjustment amount.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510156898.XA CN120295751A (en) | 2025-02-12 | 2025-02-12 | Service resource adjustment method and server |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510156898.XA CN120295751A (en) | 2025-02-12 | 2025-02-12 | Service resource adjustment method and server |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN120295751A true CN120295751A (en) | 2025-07-11 |
Family
ID=96274705
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202510156898.XA Pending CN120295751A (en) | 2025-02-12 | 2025-02-12 | Service resource adjustment method and server |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN120295751A (en) |
-
2025
- 2025-02-12 CN CN202510156898.XA patent/CN120295751A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11762693B1 (en) | Dynamically modifying program execution capacity | |
| CN111818159B (en) | Management method, device, equipment and storage medium of data processing node | |
| US10360083B2 (en) | Attributing causality to program execution capacity modifications | |
| US9971823B2 (en) | Dynamic replica failure detection and healing | |
| US9106589B2 (en) | Predicting long-term computing resource usage | |
| CN109150987B (en) | Two-layer container cluster elastic expansion method based on host layer and container layer | |
| CN100349415C (en) | Apparatus, system and method for autonomic control of grid system resource | |
| US8191070B2 (en) | Dynamic resource allocation | |
| CN104937584B (en) | Based on the quality of shared resource to the service quality of virtual machine and application program offer optimization through priority ranking | |
| US8887166B2 (en) | Resource allocation and modification using access patterns | |
| US8745218B1 (en) | Predictive governing of dynamic modification of program execution capacity | |
| CN110933178B (en) | Method for adjusting node configuration in cluster system and server | |
| CN111078404B (en) | Computing resource determining method and device, electronic equipment and medium | |
| US10555145B1 (en) | Learned configuration of modification policies for program execution capacity | |
| CN111324471B (en) | Service adjustment method, device, equipment and storage medium | |
| CN112698952A (en) | Unified management method and device for computing resources, computer equipment and storage medium | |
| CN114924888A (en) | Resource allocation method, data processing method, device, equipment and storage medium | |
| CN108881379B (en) | Method and device for data synchronization between server clusters | |
| CN112631680A (en) | Micro-service container scheduling system, method, device and computer equipment | |
| CN113204368A (en) | Application processing method, server and storage medium | |
| CN115514818A (en) | Resource configuration method and resource scheduling method for edge cloud | |
| CN119003175A (en) | Application service load balancing method, device, computer equipment, readable storage medium and program product for software development process | |
| CN120295751A (en) | Service resource adjustment method and server | |
| CN111625344B (en) | Resource scheduling system, method and device in application system | |
| CN118260031A (en) | Node resource determination method, container scheduling method, device 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 |