CN113190343A - Application instance control method, device, equipment and system - Google Patents

Application instance control method, device, equipment and system Download PDF

Info

Publication number
CN113190343A
CN113190343A CN202010038302.3A CN202010038302A CN113190343A CN 113190343 A CN113190343 A CN 113190343A CN 202010038302 A CN202010038302 A CN 202010038302A CN 113190343 A CN113190343 A CN 113190343A
Authority
CN
China
Prior art keywords
application
instance
application instance
target
network request
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
CN202010038302.3A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010038302.3A priority Critical patent/CN113190343A/en
Publication of CN113190343A publication Critical patent/CN113190343A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing

Abstract

The embodiment of the application provides a control method, a device, equipment and a system of an application instance, wherein the method comprises the following steps: determining all application instances needing to release a target application, wherein the current application instance of the target application is a first application instance; control creating a second application instance of the target application and releasing the first application instance to control the second application instance to respond to network requests of the target application, the resource specification of the second application instance being different from the resource specification of the first application instance. The method and the device avoid the problem of slow response to the network request caused by recreating the application example when the network request of the application is received, shorten the response time of the network request and realize the timely response of the network request.

Description

Application instance control method, device, equipment and system
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a system for controlling an application instance.
Background
A Serverless (Serverless) platform is a latest emerging service software platform at present, and for an application developer in Serverless, transactions related to a server, such as server purchasing, application operating environment configuration, load balancing, log collection, system monitoring and the like, do not need to be concerned any more, and the transactions are handed to the Serverless platform as a whole, and what the application developer needs to do is to write application codes only to realize service logic.
In general, a Cloud Service Consumer device (CSC) may send a network request for an application to a Cloud platform, which may respond to the network request by an application instance of the application to provide a Service to a Cloud server Consumer device. Moreover, the cloud platform can increase the number of application instances when the network requests of the application increase, and can reduce the number of application instances when the network requests of the application decrease, so that the automatic scaling of the application instances is realized. And when the network request of the application is not received within a period of time, the cloud platform releases all application instances of the application in order to reduce cost.
However, in the above manner, after all application instances of the application are released, when a network request of the application is received, the application instance needs to be re-created, so that there is a problem that a response to the network request is slow.
Disclosure of Invention
Embodiments of the present application provide a method, an apparatus, a device, and a system for controlling an application instance, so as to solve the problem in the prior art that after all application instances of an application are released, when a network request of the application is received, the application instance needs to be created again, so that a response to the network request is slow.
In a first aspect, an embodiment of the present application provides a method for controlling an application instance, including:
determining all application instances needing to release a target application, wherein the current application instance of the target application is a first application instance;
creating a second application instance of the target application, controlling the second application instance to respond to the network request of the target application and releasing the first application instance, wherein the resource specification of the second application instance is different from that of the first application instance.
In a second aspect, an embodiment of the present application provides a method for controlling an application instance, which is applied to a cloud service consumption device, and includes:
generating a network request of a target application under the condition that a cloud platform is required to provide a service for the target application;
sending the network request of the target application to the cloud platform;
the sending of the target application network request can trigger the cloud platform to determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance, so that the cloud platform controls to create a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance.
In a third aspect, an embodiment of the present application provides a control apparatus for an application instance, including:
the device comprises a determining module, a judging module and a releasing module, wherein the determining module is used for determining all application instances needing to release a target application, and the current application instance of the target application is a first application instance;
the control module is used for creating a second application instance of the target application, controlling the second application instance to respond to the network request of the target application and releasing the first application instance, wherein the resource specification of the second application instance is different from that of the first application instance.
In a fourth aspect, an embodiment of the present application provides a control apparatus for an application example, including:
the system comprises a generation module, a service module and a service module, wherein the generation module is used for generating a network request of a target application under the condition that a cloud platform is required to provide a service for the target application;
the sending module is used for sending the network request of the target application to the cloud platform;
the sending of the target application network request can trigger the cloud platform to determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance, so that the cloud platform controls to create a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance.
In a fifth aspect, an embodiment of the present application provides a control apparatus for an application example, including: a memory, a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of the first aspects above.
In a sixth aspect, an embodiment of the present application provides a control device for an application example, including: a memory, a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of the second aspects above.
In a seventh aspect, an embodiment of the present application provides a control system for an application instance, including: the control device of the application example of any one of the fifth aspect, and the control device of the application example of any one of the sixth aspect.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, the computer program comprising at least one code, which is executable by a computer to control the computer to perform the method according to any one of the first aspect.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program, the computer program comprising at least one code, which is executable by a computer to control the computer to perform the method according to any one of the second aspect.
Embodiments of the present application also provide a computer program, which is used to implement the method according to any one of the first aspect when the computer program is executed by a computer.
Embodiments of the present application also provide a computer program, which is used to implement the method according to any one of the second aspect when the computer program is executed by a computer.
According to the method, the device, the equipment and the system for controlling the application example, under the condition that all application examples of the target application are determined to be released, the current application example (namely the first application example) of the target application is controlled to be released, the second application example of the target application, which is different from the resource specification of the first application example, is controlled to be created, so that the second application example responds to the network request of the target application, when all embodiments of the target application are determined to be released, the second application example with different resource specification is created to wait for responding to the network request of the target application, so that the second application example can directly respond to the network request when the network request of the target application is received again, the problem of slow response to the network request caused by re-creating the application example when the network request of the target application is received is solved, the response time of the network request is shortened, and the timely response of the network request is realized. Also, since the resource specification of the second application instance is different from the resource specification of the first application instance, the flexibility for waiting for an application instance to respond to a network request can be improved compared to reserving a minimum number of first application instances.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic view of an application scenario according to an embodiment of the present application;
2-3C are schematic diagrams of cloud platforms provided by embodiments of the present application;
fig. 4 is a schematic flowchart of a control method of an application example according to an embodiment of the present application;
fig. 5 is a schematic flowchart of a control method of an application example according to another embodiment of the present application;
fig. 6 is a schematic diagram of a cloud platform provided in an embodiment of the present application;
FIG. 7 is a flowchart illustrating a control method for an application example according to another embodiment of the present application;
fig. 8 is a schematic structural diagram of a control device of an application example according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a control device of an application example according to another embodiment of the present application;
fig. 10 is a schematic structural diagram of a control device of an application example according to yet another embodiment of the present application;
fig. 11 is a schematic structural diagram of a control device of an application example according to yet another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a" and "an" typically include at least two, but do not exclude the presence of at least one.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
In addition, the sequence of steps in each method embodiment described below is only an example and is not strictly limited.
The control method of the application example provided by the embodiment of the application can be applied to an application scenario shown in fig. 1, and as shown in fig. 1, the application scenario may include a cloud platform 11 and a cloud service consuming device 12 that are implemented based on a serverless, and the cloud platform 11 and the cloud service consuming device 12 are connected through network communication.
The cloud service consuming device 12 may be a user of the cloud platform 11, and needs to provide services for the cloud platform 11. One cloud service consuming device 12 may use services of one or more applications provided by the cloud platform 11. When the cloud service consuming device 12 uses an application service provided by the cloud platform 11, the cloud service consuming device 12 may send a network request of the application to the cloud platform 11 according to a requirement, and after receiving the network request of the application, the cloud platform 11 may respond to the network request through an application instance of the application, thereby enabling the cloud platform 11 to provide the application service to the cloud service consuming device. It should be noted that the specific type of the network request is not limited in this application, and may be, for example, a data storage request, an authentication request, and the like.
As shown in fig. 2, the cloud platform 11 may include a request forwarding apparatus 11A and a control apparatus 11B of an application instance. The request forwarding device 11A is configured to receive a network request sent by the cloud service consuming apparatus 12 through a network, determine an application corresponding to the network request, and forward the network request to an application instance of the application corresponding to the network request for response. The control device 11B of the application instance is used for controlling the creation and release of the application instance, specifically, the control device of the application instance can control the increase of the number of the application instances when the network request of the application increases, and can control the decrease of the number of the application instances when the network request of the application decreases. The request forwarding device may be, for example, a gateway, and the control device of the application instance may include the host where the application instance is located, or may include other devices besides the host where the application instance is located.
It should be noted that, for convenience of distinction, in the embodiment of the present application, the application example in the normal scaling scenario shown in fig. 2 is referred to as a first application example. It is understood that the number of the first application instances of an application may be multiple, the multiple first application instances are identical, specifically, perform the same function, and have the same instance specification, for example, the instance specification is 2 processor cores (core) +4g of memory.
It should be noted that, in fig. 2, the number of applications is 2 as an example, and it is understood that the number of applications may be greater than 2.
Typically, when the cloud platform 11 determines that a network request of an application has not been received within a period of time, the cloud platform 11 releases all application instances of the application in order to reduce costs. Thereafter, when the cloud platform 12 receives the network request of the application, the application instance of the application needs to be created again, so that the cloud service consuming device 12 can be provided with the service in response to the network request of the application. However, since it takes a certain time from the creation of the application instance to the time when the application instance can respond to the network request, and a certain delay is caused to the processing of the network request, there is a problem that the response to the network request is slow. On the basis of fig. 2, when a network request of the application 1 is not received within a period of time, the result of releasing all implementations of the application by the cloud platform 11 may be as shown in fig. 3A.
Alternatively, to solve the problem of slow response to the network request, the cloud platform 11 does not release all application instances of an application when it is determined that the network request of the application is not received within a period of time, but keeps a minimum number of application instances, so that when the network request of the application is received again by the cloud platform, the application can respond in time. However, this method has a problem of high cost. On the basis of fig. 2, when a network request of the application 2 is not received within a period of time, the result of the cloud platform 11 retaining 1 application instance of the application 2 is shown in fig. 3B.
According to the control method of the application instance provided by the embodiment of the application, all application instances needing to be released are determined, the current application instance of the target application is the first application instance, the second application instance of the target application is controlled to be created and released, so that the second application instance is controlled to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance. On the basis of fig. 2, when the network request of the application 2 is not received within a period of time, the result of the cloud platform 11 releasing all application instances of the application 2 and creating a second application instance is shown in fig. 3C.
In fig. 2 to 3C, thin solid lines indicate data planes, and thick solid lines indicate control planes.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Fig. 4 is a flowchart illustrating a control method of an application instance according to an embodiment of the present application, where an execution subject of the embodiment may be the cloud platform 11 in fig. 1, and specifically may be executed by a control device of the application instance in the cloud platform 11. As shown in fig. 4, the method of this embodiment may include:
step 401, determining all application instances needing to release the target application, where the current application instance of the target application is the first application instance.
In this step, the specific algorithm for determining whether all application instances of the target application need to be released can be flexibly implemented. Illustratively, step 401 may specifically include: judging whether a network request of a target application is received within a latest preset time length; and if the network request of the target application is not received within the latest preset time length, determining that all application instances of the target application need to be released. Further, if the network request of the target application is received within the latest preset time period, it is determined that all embodiments of the target application do not need to be released. For example, when the number of network requests of the target application received within the last 1 minute is 0, it may be determined that all application instances of the target application need to be released. When the number of network requests of the target application received within the last 1 minute is greater than 0, it may be determined that all application instances of the target application do not need to be released.
Assuming that the target application currently has 3 application instances when it is determined that all application instances of the target application need to be released, the 3 application instances may be understood as a first application instance of the target application, which is a different application instance than a second application instance described below.
It should be noted that the embodiments of the present application are directed to specific processing when all embodiments of a target application need to be released are determined. Upon determining that all application instances of the target application do not need to be released, step 402 need not be performed and may end.
Step 402, controlling to create a second application instance of the target application and release the first application instance, so as to control the second application instance to respond to the network request of the target application, wherein the resource specification of the second application instance is different from the resource specification of the first application instance.
In this step, there may be no restriction on the order between the first application instance for controlling the release of the application and the second application instance for controlling the creation of the application. The network request can be responded to the maximum extent in a timely manner by controlling the creation of the second application instance before and the release of the first application instance after. By controlling the first application instance to be released before and the second application instance to be created after, recycling of resources for deploying the first application instance is facilitated to be completed as soon as possible.
It should be noted that, the controlling of the second application instance in response to the network request of the application may be performed by the control device providing the application instance, or may be performed by another device or apparatus besides the control device of the application instance, which is not limited in this application.
The specific way that the resource specification of the second application instance is different from the resource specification of the first application instance can be flexibly realized according to requirements. The resource specification of an application instance may refer to how much of the resources the application instance needs to use. The resource may be, for example, a software resource such as a memory and a processor core, or may be, for example, a hardware resource such as a processor chip, or may be, for example, an electrical energy resource.
In the embodiment, by controlling the release of the current application instance (i.e. the first application instance) of the target application and controlling the creation of the second application instance of the target application, which has a resource specification different from that of the first application instance, under the condition that all application instances of the target application are determined to be required to be released, the resource specification of the second application instance is different from that of the first application instance, when all embodiments of the target application are determined to be required to be released, the second application instance with a different resource specification is created for responding to the network request of the target application, so that the second application instance can directly respond to the network request when the network request of the target application is received again, the problem that the response to the network request is slow when the network request of the target application is received again is avoided, and the response time length of the network request is shortened, and timely response of the network request is realized. Also, since the resource specification of the second application instance is different from the resource specification of the first application instance, the flexibility for waiting for an application instance to respond to a network request can be improved compared to reserving a minimum number of first application instances.
Based on the embodiment shown in fig. 4, for example, the resource specification of the second application instance is different from the resource specification of the first application instance, and includes one or more of the following: the instance specification of the second application instance is lower than the instance specification of the first application instance, the power of a processor chip deploying the second application instance is lower than the power of a processor chip deploying the first application instance, or the resource deploying the first application instance is an exclusive resource which does not need to be mutually preempted with other application instances and the resource deploying the second application instance is a over-sell resource which needs to be mutually preempted with other application instances. Based on this, the resource specification of the second application instance can be lower than that of the first application instance, and compared with the first application instance which is reserved with the minimum number in the related technology, the cost of the cloud platform is saved.
Illustratively, the instance specification may include a processor core count specification, a memory size specification, and the like. For example, the instance specification of the first application instance may be 2 processor cores +4g memory, and the instance specification of the second application instance may be 0.5 processor cores +4g memory. For example, the instance specification of the first application instance may be 2 processor cores +4g memory, and the instance specification of the second application instance may be 1 processor core +2g memory.
The specific way in which the instance specification of the second application instance is lower than the instance specification of the first application instance can be flexibly implemented. By having the processor core number specification of the second application instance lower than the first application instance, processor core resources may be reduced. By having the memory size specification of the second application instance lower than the first application instance, memory resources may be reduced.
The determination of the instance specification of the second application instance can be flexibly implemented. For example, the instance specification of the second application instance may be set by a user, or the instance specification of the second application instance may be automatically determined by the cloud platform according to a preset downgrade policy based on the instance specification of the first application instance. The instance specification of the second application instance is automatically determined by the control device of the application instance according to the instance specification of the first application instance and the preset downgrade strategy, so that the flexibility of determining the instance specification of the second application instance by the cloud platform is improved. Wherein the de-sizing policy may be, for example, a few percent reduction for the processor core, or a few percent reduction for the processor core. It should be noted that, the determination method of the instance specification of the first application instance is not limited in the present application, and may be configured by a user, for example.
Because the power of the processor chips is different, the power consumption of the processor chips is different, so that the second application examples can be deployed on the processor chip with lower power by deploying the processor chip of the second application example with lower power than the processor chip of the first application example, which is beneficial to saving the power consumption and reducing the cost.
For example, the instruction systems of the first application instance and the second application instance are different, and the instruction system of the second application instance is different from the instruction system of the first application instance, so that the range of selecting a processor chip with lower power for the second application instance can be expanded, which is beneficial to improving the flexibility of hardware implementation of deploying the first application instance and the second application instance on processing chips with different powers. The instruction system of the first application instance may be, for example, an intel (intel) instruction set, and the instruction system of the second application instance may be, for example, an Advanced reduced instruction set Machine (ARM) instruction set, so that a processor chip different from the one where the first application instance is deployed is an intel chip, and the ARM chip can be selected for deploying the second application instance.
It should be noted that, for the scenario that the resource of the first application instance is an exclusive resource and the resource of the second application instance is an over-selling resource, the instance specification of the second application instance may be the same as the instance specification of the first application instance.
Wherein, the following explanation is made for the resource deploying the application instance being an exclusive resource: assuming that the resource of the application instance a is an exclusive resource, the instance specification of the application instance a is 2 processor cores, and the number of the processor cores of one server is 32, the server can deploy 16 application instances a at most, each application instance a exclusively shares 2 processor cores, and the 16 application instances a do not mutually preempt the resource.
In the actual operation process of the application example, the resource usage of the application example often cannot reach the resource quantity agreed by the example specification, so that resource waste is caused, and in order to improve the resource utilization rate, a concept of over-selling is introduced, namely the sum of the resources agreed by the example specifications of all the application examples on the server exceeds the resource quantity owned by the server. In the process of over-selling, the situation of resource contention by different application examples can occur, which is also caused by the nature of over-selling, and the resource which can be occupied by one application example to the maximum extent is the resource quantity agreed by the example specification.
Wherein, the following explanation is made for the resource for deploying the application instance being the over-selling resource: assuming that the resource of the application instance b is a over-selling resource, the instance specification of the application instance b is 2 processor cores, and the number of the processor cores of one server is 32, the server can deploy more than 16 application instances b at most, for example, 32 application instances b can be deployed, the resources of the 32 application instances b are mutually preempted, and one application instance b can occupy 2 processor cores at most.
It can be seen that, since the resource of the second application instance is a over-selling resource, compared with the resource of the first application instance which is an exclusive resource, the resource utilization rate can be improved, and thus the resource specification of the application instance is reduced.
Based on the embodiment shown in fig. 4, for example, the controlling to create the second application instance of the target application may specifically include: and allocating resources for a second application instance of the target application, and controlling the second application instance to run in the resources allocated for the second application instance. Specifically, the resource allocated to the second application instance may be selected from the resource pool according to resource allocation information of the second application instance, where the resource allocation information includes related information for allocating the resource to the second application instance, such as an instance specification of the second application instance, a processor chip of the second application instance, and the like.
Based on the embodiment shown in fig. 4, for example, the controlling the second application instance to respond to the network request of the target application may specifically include: when the second application instance is determined to be capable of processing the network request of the target application, adding the second application instance to the instance list of the target application, so that the request forwarding device can forward the network request of the target application to the second application instance according to the instance list. The example list of the target application is used for requesting the forwarding device to forward the received network request of the target application, so that the application example of the target application can receive the network request of the target application and respond. It will be appreciated that upon release of the first application instance, the first application instance may be deleted from the list of instances of the target application.
On the basis of the embodiment shown in fig. 4, the number of the second application instances is 1, for example. The number of the second application examples is 1, so that the cost can be reduced to the greatest extent.
Fig. 5 is a flowchart illustrating a control method of an application instance according to another embodiment of the present application, and this embodiment mainly describes an alternative implementation manner after releasing a first application instance and creating a second application instance based on the foregoing embodiment. As shown in fig. 5, the method of this embodiment may include:
step 501, determining all application instances needing to release a target application, wherein the current application instance of the target application is a first application instance.
It should be noted that step 501 is similar to step 401, and is not described herein again.
Step 502, controlling to create a second application instance of the target application and release the first application instance, so as to control the second application instance to respond to the network request of the target application, wherein the resource specification of the second application instance is different from the resource specification of the first application instance.
It should be noted that step 502 is similar to step 402, and is not described herein again.
Step 503, determining whether a preset condition is satisfied.
In this step, the resource specification of the second application instance is different from that of the first application instance, and the processing capability of the second application instance is different from that of the first application instance. And when the preset condition is not met, the first application instance does not need to be created again.
The preset condition is used for predicting whether a large number of network requests of the target application are required to respond. Meeting the preset condition, the network request of a large amount of target applications is predicted to be required to respond according to the representation; and if the preset condition is not met, the network request which predicts that a large amount of target applications will not need to be responded can be represented. The preset conditions can be flexibly realized according to requirements. For example, the preset condition may include any one of the following: receiving the network requests of the target application, wherein the number of the received network requests of the target application is greater than a number threshold, the network requests of the target application are received, and the time length from the receiving time is greater than a time length threshold, or the load of the second application instance is greater than a load threshold, and the like.
Step 504, if the preset condition is met, controlling to create the first application instance so as to control the first application instance to respond to the network request of the target application.
It should be noted that the specific manner for controlling the creation of the first application instance and controlling the first application instance to respond to the network request is similar to the specific manner for controlling the creation of the second application instance and controlling the second application instance to respond to the network request, and is not described herein again.
Optionally, after step 504, the method may further include: and when the first application instance can respond to the network request of the target application, controlling the second application instance not to respond to the network request of the target application. Illustratively, the second application instance may no longer respond to the network request of the target application by deleting the second application instance from the instance list. It should be noted that for the network request that the second application instance is responding to, the response may be continued by the second application instance until the response is completed.
By controlling the second application instance not to respond to the network request of the target application any more, the network request of the target application is responded by the first application instance under the normal expansion and contraction capacity scene. Because the processing capacity of the second application instance is different from that of the first application instance, the second application instance is controlled not to respond to the network request when the first application instance can respond to the network request, so that the special scenes that the application instances with different processing capacities all respond to the network request can be avoided, the special implementation aiming at the special scenes is avoided, and the simplified implementation is facilitated.
For example, the controlling that the second application instance no longer responds to the network request of the target application may specifically include: controlling release of the second application instance. By controlling and releasing the second application instance, the resources for deploying the second application instance can be recycled, and the utilization rate of the resources is improved.
In this embodiment, whether a preset condition is met is judged, and if the preset condition is met, the first application instance is controlled to be created to control the first application instance to respond to the network request of the target application, so that on the basis that the second application instance can respond to the network request of the target application, when it is predicted that a large number of network requests of the target application will need to respond, the first application instance with the processing capability capable of meeting the requirement is controlled to respond to the network request, and the problem that the cloud platform cannot respond to the network request in time due to the fact that the processing capability of the second application instance is limited and the number of network requests is large is avoided.
Specifically, a specific process of processing the network request by the cloud platform may be as shown in fig. 6, for example. Referring to fig. 6, in a normal scaling scenario, a request forwarding device forwards a network request of a target application to a first application instance, and a control device of the application instance may automatically scale the first application instance according to a requirement in response to the network request by the first application instance, where a small square represents one application instance of the target application, and the first application instance is numbered 1, 2, 3, 4, 5, … …, and the unnumbered second application instance is numbered. When determining that all application instances of the target application need to be released, the control device of the application instance controls the first application instance to be released and controls the second application instance to be created, and the request forwarding device forwards the network request of the target application to the second application instance, and the second application instance responds to the network request. In fig. 6, a solid line indicates a flow in a normal expansion capacity scene, a broken line indicates a flow in a special scene of an abnormal expansion capacity, a thin solid line and a thin broken line indicate a data plane, and a thick solid line and a thick broken line indicate a control plane.
Fig. 7 is a flowchart illustrating a control method of an application example according to another embodiment of the present application, where an execution subject of the embodiment may be the cloud service consuming device 12 in fig. 1. As shown in fig. 7, the method of this embodiment may include:
step 701, generating a network request of a target application under the condition that a cloud platform is required to provide a service for the target application;
step 702, sending the network request of the target application to the cloud platform;
the sending of the target application network request can trigger the cloud platform to determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance, so that the cloud platform controls to create a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance.
It should be noted that, for the specific way in which the cloud platform determines that all application instances of the target application need to be released, and controls to create the second application instance of the target application and release the first application instance, reference may be made to the related description of the foregoing embodiments, and details are not described here again.
In this embodiment, a cloud service consuming device generates a network request of a target application under the condition that a cloud platform is required to provide a service for the target application, and sends the network request of the target application to the cloud platform; wherein the sending of the target application network request can trigger the cloud platform to determine that all application instances of the target application need to be released, enabling the cloud platform to control releasing a current application instance (namely a first application instance) of a target application and to control creating a second application instance with different resource specifications from the first application instance under the condition that all application instances for releasing the target application are determined to be satisfied, so as to control the second application instance to respond to a network request of the target application, therefore, when the network request of the target application is received again, the second application instance can directly respond to the network request, the problem of slow response to the network request caused by recreating the application instance when the network request of the target application is received is avoided, the response time of the network request is shortened, and the timely response of the network request is realized.
Fig. 8 is a schematic structural diagram of a control device of an application example according to an embodiment of the present application; referring to fig. 8, the present embodiment provides a control device of an application example, which may execute the control method of the application example shown in fig. 4 to 5, specifically, the control device of the application example may include:
a determining module 81, configured to determine all application instances that need to release a target application, where a current application instance of the target application is a first application instance;
a control module 82, configured to control creating a second application instance of the target application and releasing the first application instance, so as to control the second application instance to respond to a network request of the target application, where a resource specification of the second application instance is different from a resource specification of the first application instance.
Optionally, the resource specification of the second application instance is different from the resource specification of the first application instance, and the resource specification of the second application instance includes one or more of the following: the instance specification of the second application instance is different from the instance specification of the first application instance, the power of a processor chip deploying the second application instance is lower than the power of a processor chip deploying one of the first application instances, or the resource deploying the first application instance is an exclusive resource which does not need to be mutually preempted with other application instances and the resource deploying the second application instance is a over-sell resource which needs to be mutually preempted with other application instances.
Optionally, the determining module 81 is further configured to determine, according to the instance specification of the first application instance, an instance specification of the second application instance according to a preset specification reduction policy.
Optionally, the instruction systems of the first application instance and the second application instance are different.
Optionally, the control module 82 is configured to control creation of a second application instance of the target application, and specifically includes:
and allocating resources for a second application instance of the target application, and controlling the second application instance to run in the resources allocated for the second application instance.
Optionally, the control module 82 is configured to control the second application instance to respond to the network request of the target application, and specifically includes:
when the second application instance is determined to be capable of processing the network request of the target application, adding the second application instance to the instance list of the target application, so that the request forwarding device can forward the network request of the target application to the second application instance according to the instance list.
Optionally, the apparatus further includes a determining module, configured to determine whether a preset condition is met;
the control module 82 is further configured to control creating the first application instance if a preset condition is met, so as to control the first application instance to respond to the network request of the target application.
Optionally, the preset condition includes any one of the following: receiving the network requests of the target application, wherein the number of the received network requests of the target application is greater than a number threshold, the time length from the receiving time to the network requests of the target application is greater than a time length threshold, or the load of the second application instance is greater than a load threshold.
Optionally, the control module 82 is further configured to control the second application instance to no longer respond to the network request of the target application when the first application instance can respond to the network request of the target application.
Optionally, the control module 82 is configured to control the second application instance to no longer respond to the network request of the target application, and specifically includes: controlling release of the second application instance.
Optionally, the number of the second application instances is 1.
The apparatus shown in fig. 8 can perform the method of the embodiment shown in fig. 4-5, and the detailed description of this embodiment can refer to the related description of the embodiment shown in fig. 4-5. The implementation process and technical effect of the technical solution refer to the descriptions in the embodiments shown in fig. 4 to 5, and are not described herein again.
In one possible implementation, the physical structure of the control device of the application example shown in fig. 8 may be as shown in fig. 9. Referring to fig. 9, the control device of this application example may include: a processor 91 and a memory 92. Wherein the memory 92 is used for storing a program for supporting the control device of the application instance to execute the control method of the application instance provided in the embodiments shown in fig. 4-6, and the processor 91 is configured for executing the program stored in the memory 92.
The program comprises one or more computer instructions which, when executed by the processor 91, are capable of performing the steps of:
determining all application instances needing to release a target application, wherein the current application instance of the target application is a first application instance;
control creating a second application instance of the target application and releasing the first application instance to control the second application instance to respond to network requests of the target application, the resource specification of the second application instance being different from the resource specification of the first application instance.
Optionally, the processor 91 is further configured to perform all or part of the steps in the embodiments shown in fig. 4 to 5.
The control device of the application instance may further include a communication interface 93, which is used for the control device of the application instance to communicate with other devices or a communication network.
Fig. 10 is a schematic structural diagram of a control device of an application example according to yet another embodiment of the present application; referring to fig. 10, the present embodiment provides a control device of an application example, which may execute the control method of the application example shown in fig. 10, specifically, the control device of the application example may include:
the generation module 101 is configured to generate a network request of a target application when a cloud platform is required to provide a service for the target application;
a sending module 102, configured to send the network request of the target application to the cloud platform;
the sending of the target application network request can trigger the cloud platform to determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance, so that the cloud platform controls to create a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance.
The apparatus shown in fig. 10 can perform the method of the embodiment shown in fig. 7, and reference may be made to the related description of the embodiment shown in fig. 7 for a part of this embodiment that is not described in detail. The implementation process and technical effect of the technical solution are described in the embodiment shown in fig. 7, and are not described herein again.
In one possible implementation, the physical structure of the control device of the application example shown in fig. 10 may be as shown in fig. 11. Referring to fig. 11, the control device of this application example may include: a processor 111 and a memory 112. Wherein the memory 112 is used for storing a program for supporting the control device of the application instance to execute the control method of the application instance provided in the embodiment shown in fig. 7, and the processor 111 is configured to execute the program stored in the memory 112.
The program comprises one or more computer instructions, wherein the one or more computer instructions, when executed by the processor 111, are capable of performing the steps of:
generating a network request of a target application under the condition that a cloud platform is required to provide a service for the target application;
sending the network request of the target application to the cloud platform;
the sending of the target application network request can trigger the cloud platform to determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance, so that the cloud platform controls to create a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance.
Optionally, the processor 111 is further configured to perform all or part of the steps in the foregoing embodiment shown in fig. 7.
The control device of the application instance may further include a communication interface 113, which is used for the control device of the application instance to communicate with other devices or a communication network.
In addition, an embodiment of the present application provides a control system for an application instance, including: the control device of the application example shown in fig. 9, and the control device of the application example shown in fig. 11.
In addition, the present application provides a computer storage medium for storing computer software instructions for a computer device, which includes a program for executing the control method of the application example in the method embodiments shown in fig. 4 to 5.
The embodiment of the present application provides a computer storage medium for storing computer software instructions for a computer device, which includes a program for executing the control method of the application example in the method embodiment shown in fig. 7.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that the embodiments can be implemented by adding necessary general hardware platform, and of course, can also be implemented by a combination of hardware and software. With this understanding in mind, the above-described technical solutions and/or portions thereof that contribute to the conventional art may be embodied in the form of a computer program product, which may be embodied on one or more computer-usable storage media having computer-usable program code embodied therein (including but not limited to disk storage, CD-ROM, optical storage, etc.).
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (17)

1. A control method of an application instance is applied to a cloud platform, and is characterized by comprising the following steps:
determining all application instances needing to release a target application, wherein the current application instance of the target application is a first application instance;
control creating a second application instance of the target application and releasing the first application instance to control the second application instance to respond to network requests of the target application, the resource specification of the second application instance being different from the resource specification of the first application instance.
2. The method of claim 1, wherein the resource specification of the second application instance being different from the resource specification of the first application instance comprises one or more of:
the instance specification of the second application instance is lower than the instance specification of the first application instance, the power of a processor chip deploying the second application instance is lower than the power of a processor chip deploying the first application instance, or the resource deploying the first application instance is an exclusive resource which does not need to be mutually preempted with other application instances and the resource deploying the second application instance is a over-sell resource which needs to be mutually preempted with other application instances.
3. The method of claim 2, further comprising:
and determining the instance specification of the second application instance according to a preset reduction strategy according to the instance specification of the first application instance.
4. The method of claim 2, wherein the instruction hierarchy of the first application instance and the second application instance are different.
5. The method of claim 1, wherein the controlling creating the second application instance of the target application comprises:
and allocating resources for a second application instance of the target application, and controlling the second application instance to run in the resources allocated for the second application instance.
6. The method of claim 1, wherein said controlling the second application instance to respond to the network request of the target application comprises:
when the second application instance is determined to be capable of processing the network request of the target application, adding the second application instance to the instance list of the target application, so that the request forwarding device can forward the network request of the target application to the second application instance according to the instance list.
7. The method according to any one of claims 1-6, further comprising:
judging whether a preset condition is met;
and if the preset condition is met, controlling to create the first application instance so as to control the first application instance to respond to the network request of the target application.
8. The method of claim 7, wherein the preset condition comprises any one of: receiving the network requests of the target application, wherein the number of the received network requests of the target application is greater than a number threshold, the time length from the receiving time to the network requests of the target application is greater than a time length threshold, or the load of the second application instance is greater than a load threshold.
9. The method of claim 7, further comprising:
and when the first application instance can respond to the network request of the target application, controlling the second application instance not to respond to the network request of the target application.
10. The method of claim 9, wherein the controlling the second application instance to no longer respond to the network request of the target application comprises: controlling release of the second application instance.
11. The method according to any of claims 1-6, wherein the number of second application instances is 1.
12. A control method of an application instance is applied to a cloud service consumption device, and is characterized by comprising the following steps:
generating a network request of a target application under the condition that a cloud platform is required to provide a service for the target application;
sending the network request of the target application to the cloud platform;
the sending of the target application network request can trigger the cloud platform to determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance, so that the cloud platform controls to create a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance.
13. A control apparatus of an application example, comprising:
the device comprises a determining module, a judging module and a releasing module, wherein the determining module is used for determining all application instances needing to release a target application, and the current application instance of the target application is a first application instance;
and the control module is used for controlling the creation of a second application instance of the target application and the release of the first application instance so as to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance.
14. A control apparatus of an application example, comprising:
the system comprises a generation module, a service module and a service module, wherein the generation module is used for generating a network request of a target application under the condition that a cloud platform is required to provide a service for the target application;
the sending module is used for sending the network request of the target application to the cloud platform;
the sending of the target application network request can trigger the cloud platform to determine that all application instances of a target application need to be released, wherein the current application instance of the target application is a first application instance, so that the cloud platform controls to create a second application instance of the target application and release the first application instance to control the second application instance to respond to the network request of the target application, and the resource specification of the second application instance is different from that of the first application instance.
15. A control apparatus of an application example, comprising: a memory, a processor; wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any of claims 1 to 11.
16. A control apparatus of an application example, comprising: a memory, a processor; wherein the memory is to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of claim 12.
17. A control system for an application instance, comprising: control means for an application instance as claimed in claim 14 and claim 15.
CN202010038302.3A 2020-01-14 2020-01-14 Application instance control method, device, equipment and system Pending CN113190343A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010038302.3A CN113190343A (en) 2020-01-14 2020-01-14 Application instance control method, device, equipment and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010038302.3A CN113190343A (en) 2020-01-14 2020-01-14 Application instance control method, device, equipment and system

Publications (1)

Publication Number Publication Date
CN113190343A true CN113190343A (en) 2021-07-30

Family

ID=76972327

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010038302.3A Pending CN113190343A (en) 2020-01-14 2020-01-14 Application instance control method, device, equipment and system

Country Status (1)

Country Link
CN (1) CN113190343A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918093A (en) * 2021-09-26 2022-01-11 福建天泉教育科技有限公司 Capacity reduction optimization method and terminal
CN114356558A (en) * 2021-12-21 2022-04-15 北京穿杨科技有限公司 Capacity reduction processing method and device based on cluster

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918093A (en) * 2021-09-26 2022-01-11 福建天泉教育科技有限公司 Capacity reduction optimization method and terminal
CN113918093B (en) * 2021-09-26 2023-11-03 福建天泉教育科技有限公司 Capacity reduction optimization method and terminal
CN114356558A (en) * 2021-12-21 2022-04-15 北京穿杨科技有限公司 Capacity reduction processing method and device based on cluster
CN114356558B (en) * 2021-12-21 2022-11-18 北京穿杨科技有限公司 Capacity reduction processing method and device based on cluster

Similar Documents

Publication Publication Date Title
CN108965485B (en) Container resource management method and device and cloud platform
CN103473142B (en) Virtual machine migration method under a kind of cloud computing operating system and device
CN112269641B (en) Scheduling method, scheduling device, electronic equipment and storage medium
TW201818261A (en) Application capacity enlargement method, apparatus and system
US20140165061A1 (en) Statistical packing of resource requirements in data centers
CN113190343A (en) Application instance control method, device, equipment and system
US10423217B1 (en) Dynamic power capping of multi-server nodes in a chassis based on real-time resource utilization
EP3993346A1 (en) Method and device for distributed data storage
CN110750336B (en) OpenStack virtual machine memory hot-expanding method
CN114189482A (en) Control method, device and system for cluster resources
CN111459681B (en) Dynamic elastic telescoping method based on micro-service load
CN115277598B (en) Method and device for scheduling computing power resources and computer readable storage medium
CN110377664B (en) Data synchronization method, device, server and storage medium
CN114546587A (en) Capacity expansion and reduction method of online image recognition service and related device
CN104281587A (en) Connection establishing method and device
CN111143071A (en) Cache partition management method, system and related components based on MCS system
CN111177160A (en) Service updating method, device, server and medium
CN112291326B (en) Load balancing method, load balancing device, storage medium and electronic equipment
CN115048186A (en) Method and device for processing expansion and contraction of service container, storage medium and electronic equipment
CN114968482A (en) Server-free processing method and device and network equipment
CN115878309A (en) Resource allocation method, device, processing core, equipment and computer readable medium
CN109391663B (en) Access request processing method and device
CN111327663A (en) Bastion machine distribution method and equipment
CN113051143A (en) Detection method, device, equipment and storage medium for service load balancing server
CN112231057A (en) Information processing method, device and system

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