CN117435302A - Container capacity adjustment method, device, electronic equipment and storage medium - Google Patents

Container capacity adjustment method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117435302A
CN117435302A CN202311398305.8A CN202311398305A CN117435302A CN 117435302 A CN117435302 A CN 117435302A CN 202311398305 A CN202311398305 A CN 202311398305A CN 117435302 A CN117435302 A CN 117435302A
Authority
CN
China
Prior art keywords
trigger
container
load
capacity
event
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
CN202311398305.8A
Other languages
Chinese (zh)
Inventor
郗佳林
贺鹏
韩天玥
李广聚
朱常波
谢继刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Unicom Digital Technology Co Ltd
China Unicom Western Innovation Research Institute Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Unicom Digital Technology Co Ltd
China Unicom Western Innovation Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd, Unicom Digital Technology Co Ltd, China Unicom Western Innovation Research Institute Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202311398305.8A priority Critical patent/CN117435302A/en
Publication of CN117435302A publication Critical patent/CN117435302A/en
Pending legal-status Critical Current

Links

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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • 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
    • 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/5016Allocation 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 the resource being the memory
    • 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/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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/5077Logical partitioning of resources; Management or configuration of virtualized resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The method, the device, the electronic equipment and the storage medium for adjusting the container capacity can determine event sources and triggers through an initialization flow of a container system, further can call corresponding load services, can acquire monitoring parameters in the call load services through a monitoring system, so that corresponding capacity adjustment information is generated in real time, the container system is accessed, the capacity of the container system is adjusted, the container capacity is triggered through events, automatic container capacity elastic adjustment is realized, the number of cluster operation flows in the container can be dynamically increased or reduced according to application requirements, and the flexibility of container capacity adjustment and the utilization rate of system resources are improved.

Description

Container capacity adjustment method, device, electronic equipment and storage medium
Technical Field
The present invention relates to a container system technology, and more particularly, to a container capacity adjustment method, device, electronic apparatus, and storage medium.
Background
Currently, services of an application program are usually deployed on a container management platform such as k8s, and in order to improve usability, performance and flexibility of the application program, save cost and improve efficiency, the capacity of a container needs to be adjusted, while in the current container capacity adjustment method, a technician usually manually adjusts the number of containers, and an adjustment mode of small-mode expansion only depends on the utilization rate of cpu and memory used by the containers as expansion indexes, so that the application scenario has limitation.
Therefore, there is a need for a container capacity adjustment method to automatically adjust the container capacity, thereby improving the flexibility of container capacity adjustment and the utilization of system resources.
Disclosure of Invention
The application provides a container capacity adjustment method, a device, electronic equipment and a storage medium, which are used for solving the problems of insufficient flexibility and low system resource utilization rate of the current container capacity adjustment.
In a first aspect, the present application provides a container capacity adjustment method, comprising:
determining an event source and a trigger according to an initialization flow of the container system;
calling corresponding load service according to the event source and the trigger, and acquiring monitoring parameters in the process of calling the load service;
generating capacity adjustment information according to the monitoring parameters;
and accessing the container system according to the capacity adjustment information, modifying the copy number of the load service by the cluster, and adjusting the container capacity.
As an optional implementation manner, the determining the event source and the trigger according to the initialization flow of the container system includes:
creating load information and elastic conditions;
the load is used for indicating the application carried on the container system, and the elastic condition is used for indicating the condition and the adjustment process of container capacity adjustment, wherein the condition and the adjustment process comprise an elastic index and a trigger threshold;
establishing proxy service according to the load information;
and configuring an event source and a trigger according to the elastic condition.
As an optional implementation manner, the calling the corresponding load service according to the event source and the trigger includes:
generating an event message triggered by an event according to the event source, and generating a trigger message;
and driving the corresponding trigger to call the proxy service according to the trigger message, and calling the corresponding load service through the proxy service.
As an optional implementation manner, the monitoring parameters include the number of load service calls, the number of load service instances, the memory usage, the processor usage, and the network traffic;
the generating capacity adjustment information according to the monitoring parameters includes:
judging whether the monitoring parameters accord with the triggering conditions indicated by the trigger or not;
if the monitoring parameters are judged to be in accordance with the triggering conditions indicated by the trigger, calculating capacity parameters to be adjusted, and generating capacity adjustment information according to the capacity parameters.
As an optional implementation manner, after the acquiring the monitoring parameter in the process of calling the load service, the method further includes:
determining the alarm condition and the alarm mode of the monitoring parameters;
and if the monitoring parameters meet the alarm conditions, determining an alarm flow according to the alarm mode, and executing the alarm flow.
In a second aspect, the present application provides a container capacity adjustment device, the device comprising:
the acquisition module is used for determining an event source and a trigger according to the initialization flow of the container system;
the processing module is used for calling the corresponding load service according to the event source and the trigger and acquiring monitoring parameters in the process of calling the load service;
the processing module is also used for generating capacity adjustment information according to the monitoring parameters;
the processing module is further used for accessing the container system according to the capacity adjustment information, modifying the copy number of the load service by the cluster, and adjusting the container capacity.
As an optional implementation manner, the acquiring module determines a specific manner of the event source and the trigger according to an initialization flow of the container system, and includes:
creating load information and elastic conditions;
the load is used for indicating the application carried on the container system, and the elastic condition is used for indicating the condition and the adjustment process of container capacity adjustment, wherein the condition and the adjustment process comprise an elastic index and a trigger threshold;
establishing proxy service according to the load information;
and configuring an event source and a trigger according to the elastic condition.
As an optional implementation manner, the acquiring module calls a specific mode of the corresponding load service according to the event source and the trigger, and the specific mode includes:
generating an event message triggered by an event according to the event source, and generating a trigger message;
and driving the corresponding trigger to call the proxy service according to the trigger message, and calling the corresponding load service through the proxy service.
As an optional implementation manner, the monitoring parameters include the number of load service calls, the number of load service instances, the memory usage, the processor usage, and the network traffic;
the specific mode of generating capacity adjustment information by the processing module according to the monitoring parameters comprises the following steps:
judging whether the monitoring parameters accord with the triggering conditions indicated by the trigger or not;
if the monitoring parameters are judged to be in accordance with the triggering conditions indicated by the trigger, calculating capacity parameters to be adjusted, and generating capacity adjustment information according to the capacity parameters.
As an alternative embodiment, the processing module is further configured to, after obtaining the monitoring parameters in invoking the load service,
determining the alarm condition and the alarm mode of the monitoring parameters;
and if the monitoring parameters meet the alarm conditions, determining an alarm flow according to the alarm mode, and executing the alarm flow.
In a third aspect, the present application further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method as in the first aspect.
In a fourth aspect, the present application also provides a computer-readable storage medium having stored therein computer-executable instructions which, when executed by a processor, are adapted to carry out the method of the first aspect.
According to the container capacity adjustment method, the device, the electronic equipment and the storage medium, through the initialization flow of the container system, the event source and the trigger can be determined, and then the corresponding load service can be invoked, through the monitoring system, each monitoring parameter in the invoking load service can be acquired, so that corresponding capacity adjustment information is generated in real time, the container system is accessed, the capacity of the container system is adjusted, the container capacity is triggered through the event, automatic container capacity elastic adjustment is realized, the number of cluster operation flows in the container can be dynamically increased or reduced according to application requirements, and the flexibility of container capacity adjustment and the utilization rate of system resources are improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
FIG. 1 is a flow chart of a method for adjusting the capacity of a container according to an embodiment of the present invention;
FIG. 2 is a flow chart of another method for adjusting the capacity of a container according to an embodiment of the present invention;
FIG. 3 is a flow chart of yet another method for adjusting container capacity according to an embodiment of the present invention;
FIG. 4 is a flow chart of yet another method for adjusting container capacity according to an embodiment of the present invention;
FIG. 5 is a flow chart of yet another method for adjusting container capacity according to an embodiment of the present invention;
FIG. 6 is a flow chart of yet another method for adjusting container capacity according to an embodiment of the present invention;
FIG. 7 is a flow chart of yet another method for adjusting container capacity according to an embodiment of the present invention;
FIG. 8 is a flow chart of yet another method for adjusting container capacity according to an embodiment of the present invention;
FIG. 9 is a schematic view showing a structure of a container capacity adjusting apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a container capacity adjustment electronic device according to an embodiment of the present invention.
There has been shown in the drawings, and will hereinafter be described, specific embodiments of the present application with the understanding that the present application is not intended to limit the scope of the inventive concepts in any way, but is to be construed as an illustrative basis for the inventive concepts of the present application by way of example only.
Detailed Description
Reference will now be made in detail to exemplary 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 implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
Currently, application services are deployed on kubernetes, k8s, and in order to improve the usability, performance and flexibility of an application, while saving cost and improving efficiency, a method for dynamically adjusting the use of application resources is needed by a user to automatically increase or decrease container instances to meet the demands of the application in running. However, currently, the number of containers is often required to be manually adjusted, and part of dynamic expansion and contraction can only depend on the utilization rate of the cpu and the memory used by the containers as expansion and contraction indexes, which cannot meet the requirements of other services which do not depend on the cpu and the memory indexes, and dynamic elastic expansion and contraction are also required.
In particular, current containerization systems have difficulty coordinating the number and size of containers through manual intervention during peak load handling, which makes the use of containers inefficient. In addition, due to the constant change in the number of containers, it is more difficult to monitor and manage the entire container cluster, increasing the workload of technicians, and possibly resulting in performance degradation or even breakdown. The dynamic elastic expansion and contraction of part is only performed based on the utilization rate of the cpu and the memory, the use scene is too single, and the requirement of dynamic elastic expansion and contraction of the container service of user diversification cannot be met.
According to the method and the device, more diversified elastic indexes are provided through components such as an event source, a trigger, a control center, a strategy processor and a load processor, so that the container service of some specific use scenes can be dynamically elastically stretched, the problem that the prior art can only manually modify the quantity of containers when the containers are elastically stretched, or can elastically stretch through indexes such as cpu and memory, and can not be automatically stretched when other system information such as indexes such as message notification, concurrency number and database query results are faced is solved, and the resource utilization rate and the system stability are improved. Specifically, the container expansion and contraction behavior is triggered through the event, so that automatic elastic expansion and contraction are realized, and the number of process images can be dynamically increased or reduced according to the requirement of an application program. In addition, the application also provides various expansion schemes, including a high calculation template, a high memory template, a high concurrency template, a message flow template, a peak Gu Liuliang template, a database trigger template, a log query template and the like, which can be started only by simple configuration.
Specifically, through the initialization flow of the container system, an event source and a trigger can be determined, and then corresponding load service can be invoked, through a monitoring system, each monitoring parameter in the invoked load service can be obtained, so that corresponding capacity adjustment information is generated in real time, the container system is accessed, the capacity of the container system is adjusted, and through the event, the container capacity flexible adjustment is realized by triggering the container capacity shrinkage and expansion behaviors, the number of cluster operation processes in the container can be dynamically increased or reduced according to application requirements, and the flexibility of the container capacity adjustment and the utilization rate of system resources are improved.
Example 1
Referring to fig. 1, fig. 1 is a flow chart of a container capacity adjustment method according to an embodiment of the invention. As shown in fig. 1, the method includes:
s101, determining an event source and a trigger according to an initialization flow of a container system;
according to the application carried in the container system, the triggering conditions for adjusting the container capacity, namely the target event and the target parameter, the target event needing to be concerned is indicated by the event source, the target parameter corresponding to the target event and the parameter condition related to the target parameter for adjusting the container capacity are indicated by the trigger, and the corresponding event source is created at the rear end according to the elasticity strategy corresponding to the trigger, and the specific implementation manner can refer to the corresponding description of the second embodiment.
S102, according to the event source and the trigger, calling a corresponding load service, and acquiring monitoring parameters in the process of calling the load service;
after the container system receives the trigger information, the trigger information is transmitted to the trigger according to a preset message format, the trigger invokes corresponding load proxy service, the load service is further invoked according to the load proxy service, and the container system can monitor in real time in the invoking process and the running process of the load service to acquire corresponding monitoring parameters.
S103, generating capacity adjustment information according to the monitoring parameters;
after the container system acquires the monitoring parameters, the monitoring parameters can be compared with parameter conditions indicated in a preset trigger, whether the current system accords with the running condition of the container capacity to be adjusted or not is judged, and if so, corresponding data are issued to the processing unit to execute capacity adjustment operation.
S104, accessing the container system according to the capacity adjustment information, modifying the copy number of the load service by the cluster, and adjusting the container capacity.
The processing unit accesses the container system and clusters to modify the number of process mirror copies of the load service according to the condition indicated by the received capacity adjustment information, thereby realizing adjustment of the container capacity.
According to the embodiment, through the initialization flow of the container system, an event source and a trigger can be determined, and then corresponding load service can be invoked, through the monitoring system, each monitoring parameter in the invoked load service can be obtained, so that corresponding capacity adjustment information is generated in real time, the container system is accessed, the capacity of the container system is adjusted, and through the event, the container capacity flexible adjustment is realized through the container capacity flexible adjustment triggered by the event, the number of cluster operation processes in the container can be dynamically increased or reduced according to application requirements, and the flexibility of the container capacity adjustment and the utilization rate of system resources are improved.
Example two
Referring to fig. 2, fig. 2 is a flow chart of another method for adjusting container capacity according to an embodiment of the present invention, which is used to illustrate a floor implementation of the present application in a specific application scenario. As shown in fig. 2, each numerical flow in the diagram represents:
0: the user creates a load through the console; 1: a user configures an elastic strategy through a console; 2: the back end creates a corresponding event source according to the elastic strategy; 3: the back end creates a corresponding trigger according to the elastic strategy; 4: when the event of the event source is triggered, the event source notifies the control center; 5: the control center informs the trigger after receiving the trigger message; 6: the trigger calls a corresponding load Proxy, and the load Proxy calls a load; 7: after load calling, the monitored and collected triggering times; 7.1: monitoring the number of instances of the collected load, CPU and the utilization rate of the memory; 8: the strategy controller takes data from monitoring; 9: after the policy controller takes the monitoring data, the monitoring data is compared with the data in the elastic policy for calculation; 10: the strategy controller judges whether the expansion requirement is met after calculating through the two groups of data, and if yes, the strategy controller sends the expansion requirement to the load processor; 11: after receiving the telescopic command, the load processor modifies the number of copies of the load by accessing the kubernetes cluster; 12: the control console can check the relevant monitoring data of the load; 13: the control console can configure alarm rules of the monitoring data; 14: the user is notified when the monitoring data is abnormal.
For the above embodiments, implementation may be based on an architecture that includes core components such as control centers, loads, load Proxy, elastic policies, event sources, and triggers.
The control center is responsible for aggregating events, asynchronous notification triggers; the load is an application on kubernetes, for example deployment, statefulset; load Proxy is the Proxy service, and all copies of the load need to go in and out and call through Proxy; the elastic policy is a customized resource of kubernetes, is created by a console and is responsible for managing the elastic policy of the load; the event source refers to an event for calling a load, and can be a message generation consumption event, a timing calling event, a MySQL database query event, a log query event and the like; the trigger is a service for calling the load, and the load is called after the notification of the control center is received.
As an alternative embodiment, determining the event source and trigger according to the initialization procedure of the container system includes:
creating load information and elastic conditions;
the load is used for indicating the application carried on the container system, and the elastic condition is used for indicating the condition and the adjustment process of the container capacity adjustment, and comprises an elastic index and a trigger threshold;
establishing proxy service according to the load information;
the event sources and triggers are configured according to the elastic conditions.
Referring to fig. 3, fig. 3 is a flow chart of a container capacity adjustment method according to another embodiment of the present invention, which corresponds to the above-mentioned related process of determining an event source and a trigger according to an initialization process of a container system. As shown in fig. 3, the creation of loads, such as duplicate and statefulset, may be performed by the user through the console; the user then proceeds to configure the elasticity policy for the load, including elasticity metrics, such as selecting peak to valley traffic templates, setting a 3 pm trigger every day. And the back end creates Proxy service for the load according to the load created by the user, and manages the in-out flow of the load. And finally, the back end creates a corresponding event source and trigger for the user according to the elastic strategy created by the user. As in the example above, the event source contains a service that can generate a message every day at 3 PM, and the trigger can actively send a message to the responsible Proxy.
By creating load information and elastic conditions, proxy service is established, event sources and triggers are configured, a preset initialization flow is completed, the event sources and the triggers are associated with application and capacity dynamic adjustment on a container system, and the flow of elastic adjustment is realized through the event sources and the triggers, so that automatic container capacity elastic adjustment is realized, the number of cluster operation flows in a container can be dynamically increased or reduced according to application requirements, and the flexibility of container capacity adjustment and the utilization rate of system resources are improved.
As an alternative embodiment, invoking the corresponding load service according to the event source and the trigger includes:
generating an event message triggered by an event according to an event source, and generating a trigger message;
and driving the corresponding trigger to call the proxy service according to the trigger message, and calling the corresponding load service through the proxy service.
Referring to fig. 4, fig. 4 is a flow chart of another container capacity adjustment method according to an embodiment of the present invention, which corresponds to the related flow of calling the corresponding load service according to the event source and the trigger. As shown in fig. 4, the user creates a load and elasticity policy as in the previous application scenario. The event source can generate a message at 3 pm every day, the control center notifies the corresponding trigger after receiving the message, the trigger sends a calling message to the corresponding load Proxy, and the load Proxy transfers the calling to the service in the loaded container after receiving the message to complete one-time calling.
Referring to fig. 5, fig. 5 is a flow chart illustrating a method for adjusting a container capacity according to another embodiment of the present invention. As shown in FIG. 5, the present application uses the nats messaging service to implement a control center, and the results of all events are also converted into a message and output through the nats. When the user completes creating the load and elastic telescoping templates, the control center creates two globally unique topic0 and topic1. When a real event occurs, such as timing call, oss uploading file, message stream generation and the like, the event sends a message to the topic0 of the nats to inform the occurrence and result of the event, the event source subscribes to the topic0 according to the elastic policy template when creating, the message generated by the event is received, the load related information required to be triggered and the message generated by the event are combined into a new message, and the message is sent to the topic1. The trigger is also subscribed to topic1, when a message is received that a load needs to be invoked. After the message is read, the Proxy request address of the load is directly called once, and after the load Proxy is called, one load is randomly selected for calling.
The related information of the event is generated through the event source, the data interaction is realized through a preset information service, the corresponding trigger is driven to call the proxy service, and the corresponding load service is further called, so that the automatic flexible adjustment of the container capacity is realized, the number of cluster operation processes in the container can be dynamically increased or reduced according to the application requirement, and the flexibility of the container capacity adjustment and the utilization rate of system resources are improved.
As an optional implementation manner, the monitoring parameters include the number of load service calls, the number of load service instances, the memory usage rate, the processor usage rate and the network traffic;
generating capacity adjustment information according to the monitoring parameters, including:
judging whether the monitoring parameters meet the triggering conditions indicated by the trigger or not;
if the monitoring parameters are judged to be in accordance with the triggering conditions indicated by the trigger, calculating capacity parameters to be adjusted, and generating capacity adjustment information according to the capacity parameters.
For the architecture provided in fig. 2 of the present application, the main responsibility of the monitoring component is to collect various performance indexes of the system and the application program, such as CPU utilization, memory utilization, network traffic, event call times, etc., and compare and analyze these index data with predefined index templates to detect whether the operation condition of the system is normal. Meanwhile, the monitoring component can also process and analyze the monitoring data in real time according to a preset threshold rule, and once the preset threshold is exceeded, an alarm is triggered and an administrator is notified to process in time. The monitoring component is used for tracking and analyzing the performance index of the system in real time, and the potential hazards can be identified and solved in time, so that the stability and reliability of the system are ensured, and the maintainability and expandability of the system are improved.
The policy controller is another important component in the system, and its main responsibility is to collect the acquired performance index data from the monitoring component, and compare and analyze it with a preset or user-defined policy template. If the index value is observed to exceed the set elastic threshold, the strategy controller sends a capacity expansion request to the load processor so as to timely adjust the resource allocation and capacity allocation of the system according to the current load condition. Through the policy controller, the logic and decision weight of automatic expansion and contraction capacity can be given to the system from a main to finish, so that the complexity and inaccuracy of manually adjusting resources and expanding capacity are avoided, and meanwhile, the flexibility, the scalability and the user experience of the system are also effectively improved.
The load processor is responsible for receiving the expansion and contraction capacity request sent by the strategy controller and carrying out corresponding processing. According to the request parameters transmitted by the policy controller, the load processor can correspondingly expand or reduce the load on the premise of not influencing the stability and availability of the system.
Referring to fig. 6, fig. 6 is a flow chart of another method for adjusting container capacity according to an embodiment of the invention. As shown in fig. 6, fig. 6 is used to illustrate the relevant architecture of a monitoring component consisting of monitoring items, actions and notification modules.
Referring to fig. 7, fig. 7 is a flow chart of another method for adjusting capacity of a container according to an embodiment of the invention, which corresponds to the above-mentioned related flow for generating capacity adjustment information according to monitoring parameters. As shown in fig. 7, the monitoring items include individual monitoring scripts, and monitoring index data is actively collected through periodically running the monitoring scripts. An action is an operation triggered when a monitoring index exceeds a threshold, for example, an action script is set to execute when a threshold of a container cpu exceeds 60%, where the action script is the number of de-expansion load instances. The notification is that by configuring a mailbox, when an action is generated, the notification is sent to the defined mailbox, and the policy controller and the load processor are combined to complete the calculation of the monitoring data and the call of capacity expansion.
By applying the monitoring parameters in the operation and calling processes, whether each parameter accords with a preset trigger condition can be determined, when the corresponding monitoring parameter meets the trigger condition, the capacity parameter to be adjusted can be calculated, capacity adjustment information is generated, and corresponding capacity adjustment operation is executed, so that automatic flexible adjustment of the capacity of the container is realized, the number of cluster operation processes in the container can be dynamically increased or reduced according to application requirements, and the flexibility, instantaneity and utilization rate of system resources of the capacity adjustment of the container are improved.
As an optional implementation manner, after obtaining the monitoring parameter in the process of calling the load service, the method further includes:
determining alarm conditions and alarm modes of monitoring parameters;
if the monitoring parameters meet the alarm conditions, an alarm flow is determined according to the alarm mode, and the alarm flow is executed.
Through the preset alarm process, the system can give an alarm when the information indicated by the monitoring parameters represents that the system is likely to have problems, and prompts a user to perform corresponding processing, so that the capacity adjustment efficiency and the fault tolerance are improved, the automatic elastic adjustment of the container capacity is realized, the number of cluster operation processes in the container can be dynamically increased or reduced according to application requirements, and the flexibility of the container capacity adjustment and the utilization rate of system resources are improved.
Referring to fig. 8, fig. 8 is a flow chart of another container capacity adjustment method according to an embodiment of the invention. As shown in fig. 8, in the application scenario of this embodiment, the policy controller may take m pieces/s of current request messages from the monitoring component to a certain load and k pieces of current load instances, and may also take n pieces/s of processable messages from the user elastic policy template, that is, the message flow template, to the trigger threshold for each pod. When m > k×n is calculated, it indicates that the current example is insufficient, expansion is required, and when m < (k-2) ×n (if k > =2, otherwise, no calculation is performed), it indicates that contraction is required. And calculating the number [ m/n ] of the extended examples, calling a load processor, calling the api of k8s by the load processor, creating a replicaset for the load, and designating the new number of the examples of the load. The above determination process is satisfied, the waiting time set by the user is performed, and then the determination is circulated again.
In addition, in the architecture provided in the present application, a number of elastic templates are also provided for the user, including: high computation template (cpu), high memory template (memory), high concurrency template (concurrency), message stream template (stan), current limiting template (rps), peak Gu Liuliang template (corn), database query template (mysql), log query template (elastic search).
Through the template preset by the control console, the user can quickly select the required elastic conditions. More elastic conditions are expanded on the basis of the traditional cpu and memory. All elastic templates are considered as one event. For example, when a database trigger template is selected, connection information of the database, parameters of the query, interval time of the query, trigger threshold of the parameters need to be filled in. The event source creates a service capable of inquiring the parameter according to the template, inquires according to the time interval, sends the inquiry result generation message to the control center, and executes the load call flow according to the previous embodiments.
According to the embodiment, through the initialization flow of the container system, an event source and a trigger can be determined, and then corresponding load service can be invoked, through the monitoring system, each monitoring parameter in the invoked load service can be obtained, so that corresponding capacity adjustment information is generated in real time, the container system is accessed, the capacity of the container system is adjusted, and through the event, the container capacity flexible adjustment is realized through the container capacity flexible adjustment triggered by the event, the number of cluster operation processes in the container can be dynamically increased or reduced according to application requirements, and the flexibility of the container capacity adjustment and the utilization rate of system resources are improved.
Example III
An embodiment of the present invention further provides a container capacity adjusting device to implement the foregoing method, and referring to fig. 9, fig. 9 is a schematic structural diagram of a container capacity adjusting device disclosed in the embodiment of the present invention. As shown in fig. 9, in any other embodiment, the apparatus includes:
an obtaining module 31, configured to determine an event source and a trigger according to an initialization procedure of the container system;
the processing module 32 is configured to invoke a corresponding load service according to the event source and the trigger, and obtain a monitoring parameter in the process of invoking the load service;
the processing module 32 is further configured to generate capacity adjustment information according to the monitoring parameters;
the processing module 32 is further configured to access the container system according to the capacity adjustment information, modify the number of copies of the load service by the cluster, and adjust the capacity of the container.
The method has the advantages that the event source and the trigger can be determined through the initialization flow of the container system, the corresponding load service can be invoked, the monitoring system can acquire monitoring parameters in the invoking load service, corresponding capacity adjustment information is generated in real time, the container system is accessed, the capacity of the container system is adjusted, the container capacity is triggered through the event, automatic container capacity elastic adjustment is realized, the number of cluster operation processes in the container can be dynamically increased or reduced according to application requirements, and the flexibility of container capacity adjustment and the utilization rate of system resources are improved.
As an alternative embodiment, the obtaining module 31 determines, according to an initialization procedure of the container system, a specific manner of event source and trigger, including:
creating load information and elastic conditions;
the load is used for indicating the application carried on the container system, and the elastic condition is used for indicating the condition and the adjustment process of the container capacity adjustment, and comprises an elastic index and a trigger threshold;
establishing proxy service according to the load information;
the event sources and triggers are configured according to the elastic conditions.
By creating load information and elastic conditions, proxy service is established, event sources and triggers are configured, a preset initialization flow is completed, the event sources and the triggers are associated with application and capacity dynamic adjustment on a container system, and the flow of elastic adjustment is realized through the event sources and the triggers, so that automatic container capacity elastic adjustment is realized, the number of cluster operation flows in a container can be dynamically increased or reduced according to application requirements, and the flexibility of container capacity adjustment and the utilization rate of system resources are improved.
As an alternative embodiment, the obtaining module 31 calls a specific manner of the corresponding load service according to the event source and the trigger, including:
generating an event message triggered by an event according to an event source, and generating a trigger message;
and driving the corresponding trigger to call the proxy service according to the trigger message, and calling the corresponding load service through the proxy service.
The related information of the event is generated through the event source, the data interaction is realized through a preset information service, the corresponding trigger is driven to call the proxy service, and the corresponding load service is further called, so that the automatic flexible adjustment of the container capacity is realized, the number of cluster operation processes in the container can be dynamically increased or reduced according to the application requirement, and the flexibility of the container capacity adjustment and the utilization rate of system resources are improved.
As an optional implementation manner, the monitoring parameters include the number of load service calls, the number of load service instances, the memory usage rate, the processor usage rate and the network traffic;
the specific manner in which the processing module 32 generates the capacity adjustment information according to the monitoring parameters includes:
judging whether the monitoring parameters meet the triggering conditions indicated by the trigger or not;
if the monitoring parameters are judged to be in accordance with the triggering conditions indicated by the trigger, calculating capacity parameters to be adjusted, and generating capacity adjustment information according to the capacity parameters.
By applying the monitoring parameters in the operation and calling processes, whether each parameter accords with a preset trigger condition can be determined, when the corresponding monitoring parameter meets the trigger condition, the capacity parameter to be adjusted can be calculated, capacity adjustment information is generated, and corresponding capacity adjustment operation is executed, so that automatic flexible adjustment of the capacity of the container is realized, the number of cluster operation processes in the container can be dynamically increased or reduced according to application requirements, and the flexibility, instantaneity and utilization rate of system resources of the capacity adjustment of the container are improved.
As an alternative embodiment, the processing module 32 is further configured to, after obtaining the monitoring parameters during the invocation of the load service,
determining alarm conditions and alarm modes of monitoring parameters;
if the monitoring parameters meet the alarm conditions, an alarm flow is determined according to the alarm mode, and the alarm flow is executed.
Through the preset alarm process, the system can give an alarm when the information indicated by the monitoring parameters represents that the system is likely to have problems, and prompts a user to perform corresponding processing, so that the capacity adjustment efficiency and the fault tolerance are improved, the automatic elastic adjustment of the container capacity is realized, the number of cluster operation processes in the container can be dynamically increased or reduced according to application requirements, and the flexibility of the container capacity adjustment and the utilization rate of system resources are improved.
Example IV
The application provides an electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method as in any one of the embodiments.
The present application provides a computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out a method as in any of the embodiments.
Specifically, referring to fig. 10, fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 10, the electronic device may include:
a Processor 291, the apparatus further comprising a Memory 292 in which executable program code is stored; a communication interface (Communication Interface) 293 and bus 294 may also be included. The processor 291, the memory 292, and the communication interface 293 may communicate with each other via the bus 294. Communication interface 293 may be used for information transfer. The processor 291 is coupled to the memory 292, and the processor 291 may call logic instructions (executable program code) in the memory 292 to perform the methods of any of the embodiments described above.
Further, the logic instructions in memory 292 described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product.
The memory 292 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and program instructions/modules corresponding to the methods in the embodiments of the present application. The processor 291 executes functional applications and data processing by running software programs, instructions and modules stored in the memory 292, i.e., implements the methods of the method embodiments described above.
Memory 292 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the terminal device, etc. Further, memory 292 may include high-speed random access memory, and may also include non-volatile memory.
The embodiment of the invention also provides a computer readable storage medium, wherein computer executable instructions are stored in the computer readable storage medium, and the computer executable instructions are used for realizing the method in any embodiment when being called.
Embodiments of the present invention also disclose a computer program product comprising a non-transitory computer readable storage medium storing a computer program, the computer program being operable to cause a computer to perform the steps of the method described in any of the embodiments.
The apparatus embodiments described above are merely illustrative, in which the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above detailed description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course by means of hardware. Based on such understanding, the foregoing technical solutions may be embodied essentially or in part in the form of a software product that may be stored in a computer-readable storage medium including Read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), one-time programmable Read-Only Memory (OTPROM), electrically erasable programmable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic disc Memory, tape Memory, or any other medium that can be used for computer-readable carrying or storing data.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the present application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method of adjusting the capacity of a container, the method comprising:
determining an event source and a trigger according to an initialization flow of the container system;
calling corresponding load service according to the event source and the trigger, and acquiring monitoring parameters in the process of calling the load service;
generating capacity adjustment information according to the monitoring parameters;
and accessing the container system according to the capacity adjustment information, modifying the copy number of the load service by the cluster, and adjusting the container capacity.
2. The method of claim 1, wherein determining the event source and trigger based on the initialization flow of the container system comprises:
creating load information and elastic conditions;
the load is used for indicating the application carried on the container system, and the elastic condition is used for indicating the condition and the adjustment process of container capacity adjustment, wherein the condition and the adjustment process comprise an elastic index and a trigger threshold;
establishing proxy service according to the load information;
and configuring an event source and a trigger according to the elastic condition.
3. The method of claim 2, wherein invoking the corresponding load service according to the event source and trigger comprises:
generating an event message triggered by an event according to the event source, and generating a trigger message;
and driving the corresponding trigger to call the proxy service according to the trigger message, and calling the corresponding load service through the proxy service.
4. The method of claim 1, wherein the monitoring parameters include load service call times, number of load service instances, memory usage, processor usage, network traffic;
the generating capacity adjustment information according to the monitoring parameters includes:
judging whether the monitoring parameters accord with the triggering conditions indicated by the trigger or not;
if the monitoring parameters are judged to be in accordance with the triggering conditions indicated by the trigger, calculating capacity parameters to be adjusted, and generating capacity adjustment information according to the capacity parameters.
5. The method according to any one of claims 1-4, wherein after the obtaining of the monitored parameters in invoking the load service, the method further comprises:
determining the alarm condition and the alarm mode of the monitoring parameters;
and if the monitoring parameters meet the alarm conditions, determining an alarm flow according to the alarm mode, and executing the alarm flow.
6. A container capacity adjustment device, the device comprising:
the acquisition module is used for determining an event source and a trigger according to the initialization flow of the container system;
the processing module is used for calling the corresponding load service according to the event source and the trigger and acquiring monitoring parameters in the process of calling the load service;
the processing module is also used for generating capacity adjustment information according to the monitoring parameters;
the processing module is further used for accessing the container system according to the capacity adjustment information, modifying the copy number of the load service by the cluster, and adjusting the container capacity.
7. The apparatus of claim 6, wherein the acquisition module determines the particular manner of event sources and triggers based on an initialization procedure of the container system, comprising:
creating load information and elastic conditions;
the load is used for indicating the application carried on the container system, and the elastic condition is used for indicating the condition and the adjustment process of container capacity adjustment, wherein the condition and the adjustment process comprise an elastic index and a trigger threshold;
establishing proxy service according to the load information;
and configuring an event source and a trigger according to the elastic condition.
8. The apparatus of claim 7, wherein the means for retrieving, according to the event source and trigger, a specific manner of invoking a corresponding load service comprises:
generating an event message triggered by an event according to the event source, and generating a trigger message;
and driving the corresponding trigger to call the proxy service according to the trigger message, and calling the corresponding load service through the proxy service.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
10. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method of any one of claims 1-5.
CN202311398305.8A 2023-10-25 2023-10-25 Container capacity adjustment method, device, electronic equipment and storage medium Pending CN117435302A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311398305.8A CN117435302A (en) 2023-10-25 2023-10-25 Container capacity adjustment method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311398305.8A CN117435302A (en) 2023-10-25 2023-10-25 Container capacity adjustment method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117435302A true CN117435302A (en) 2024-01-23

Family

ID=89545640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311398305.8A Pending CN117435302A (en) 2023-10-25 2023-10-25 Container capacity adjustment method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117435302A (en)

Similar Documents

Publication Publication Date Title
CN108683720B (en) Container cluster service configuration method and device
CN102546256B (en) System and method used for monitoring cloud computation service
CN113037794B (en) Method, device and system for computing resource allocation scheduling
CN102882909B (en) Cloud computing service monitoring system and method thereof
CN110933178B (en) Method for adjusting node configuration in cluster system and server
CN110618869B (en) Resource management method, device and equipment
CN114416200A (en) System and method for monitoring, acquiring, configuring and dynamically managing and loading configuration of declarative cloud platform
CN112698952A (en) Unified management method and device for computing resources, computer equipment and storage medium
CN111143069A (en) Service management method, device, electronic equipment and storage medium
CN111400039A (en) Control method and device of cloud platform, cloud platform system and electronic equipment
CN110912726B (en) Service providing method, device, system, storage medium and electronic device
EP3672203A1 (en) Distribution method for distributed data computing, device, server and storage medium
CN213876703U (en) Resource pool management system
CN112448987A (en) Fusing degradation triggering method and system and storage medium
US20220206836A1 (en) Method and Apparatus for Processing Virtual Machine Migration, Method and Apparatus for Generating Virtual Machine Migration Strategy, Device and Storage Medium
CN111756800A (en) Method and system for processing burst flow
CN108173683B (en) Elastic control method and device for cloud application and cloud server
CN117435302A (en) Container capacity adjustment method, device, electronic equipment and storage medium
CN114900449B (en) Resource information management method, system and device
CN109962941B (en) Communication method, device and server
CN115469966A (en) Elastic expansion method and device for container cloud service
CN115225645A (en) Service updating method, device, system and storage medium
CN111209118A (en) Method and device for determining resource allowance, storage medium and electronic equipment
CN114443059A (en) Kubernets cluster deployment method, device and equipment
CN112711444A (en) Virtualization method and system for power grid monitoring service unit

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