CN117369981A - Container adjusting method, device and storage medium based on monitor - Google Patents

Container adjusting method, device and storage medium based on monitor Download PDF

Info

Publication number
CN117369981A
CN117369981A CN202210764077.0A CN202210764077A CN117369981A CN 117369981 A CN117369981 A CN 117369981A CN 202210764077 A CN202210764077 A CN 202210764077A CN 117369981 A CN117369981 A CN 117369981A
Authority
CN
China
Prior art keywords
container
monitored
monitor
state
target resource
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
CN202210764077.0A
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN202210764077.0A priority Critical patent/CN117369981A/en
Priority to PCT/CN2023/103346 priority patent/WO2024002190A1/en
Publication of CN117369981A publication Critical patent/CN117369981A/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/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]
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Debugging And Monitoring (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention provides a container adjusting method, device and storage medium based on a monitor, and belongs to the field of back-end servers. The method comprises the following steps: acquiring a service state in container information of a container to be monitored through a monitor; acquiring a target resource utilization rate in a service state, and determining a container state according to a comparison result of a preset threshold value and the target resource utilization rate; and adjusting the container to be monitored according to the container state. The method comprises the steps of monitoring container information of a container to be monitored through a monitor, determining the container state of the container to be monitored according to a comparison result of target resource utilization rate in the container information and a preset threshold value, and adjusting the container to be monitored according to the container state, so that the service efficiency of the container to be monitored is improved on the premise of being separated from a PaaS platform, and the problem that the service efficiency is low due to the fact that the existing container system cannot be automatically flicked is solved.

Description

Container adjusting method, device and storage medium based on monitor
Technical Field
The present invention relates to the field of backend server technologies, and in particular, to a method, an apparatus, and a storage medium for adjusting a container based on a monitor.
Background
In recent years, as services of a server are more and more complex, service quantity is more and more, services are extremely huge, and demands for server resources are rapidly increasing. Aiming at the increasing service demands, how to automatically shrink the container under the condition of limited resources, the service is realized to be highly available, the service continuity is ensured, and the problem which needs to be solved by the service management platform is solved.
The method is characterized in that the service is subjected to containerized management through a PaaS (Platform as a Service, platform, namely service) platform based on a K8S (high availability scheme of open source docker arrangement) self-operation and maintenance scheme at present, wherein the K8S takes Pod (Plain Old Data) as a minimum management unit, all containers in the Pod are uniformly scheduled and scheduled, the K8S monitors the public state of a cluster through a controller, manages and schedules the Pod, and the high availability performance of the service is realized to a certain extent; meanwhile, K8S provides a cluster strategy, other nodes are not affected when an abnormality occurs in a single node by deploying a multi-node PaaS environment, disaster recovery management is realized, and continuity of service is ensured. However, the K8S has high requirements on resources, and only the normal operation of the K8S occupies approximately 20% of the whole resources, so that the K8S occupies a large amount of service resources, and cannot bear high resource overhead in some miniaturized local sites. Therefore, how to solve the problem that the existing container system cannot realize automatic flicking under the limited resource scene, which results in low service efficiency, becomes a technical problem to be solved urgently.
Disclosure of Invention
The embodiment of the invention provides a container adjusting method, device and storage medium based on a monitor, which aim to solve the problem of low service efficiency caused by incapability of realizing automatic flick of a container system in a limited resource scene on the premise of being separated from a PaaS platform.
In a first aspect, an embodiment of the present invention provides a method for adjusting a container based on a monitor, including: acquiring a service state in container information of a container to be monitored through a monitor; acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate; and adjusting the container to be monitored according to the container state.
In a second aspect, embodiments of the present invention also provide a monitor-based container adjustment device, the monitor-based container adjustment device comprising a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for enabling a connection communication between the processor and the memory, wherein the computer program, when executed by the processor, implements any of the monitor-based container adjustment methods as provided in the present specification.
In a third aspect, embodiments of the present invention also provide a storage medium for computer readable storage, the storage medium storing one or more programs executable by one or more processors to implement any of the monitor-based container adjustment methods as provided in the present specification.
The invention provides a container adjusting method, device and storage medium based on a monitor, wherein the embodiment of the invention obtains the service state in the container information of a container to be monitored through the monitor; acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate; and adjusting the container to be monitored according to the container state. By the method, the container information of the container to be monitored is monitored through the monitor, the container state of the container to be monitored is determined according to the comparison result of the target resource utilization rate in the container information and the preset threshold value, and the container to be monitored is adjusted according to the container state, so that the service efficiency of the container to be monitored is improved on the premise of being separated from the PaaS platform, and the problem that the service efficiency is low due to the fact that the existing container system cannot automatically flick under the limited resource scene is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for adjusting a container based on a monitor according to an embodiment of the present invention;
FIG. 2 is a flow chart of a sub-step of the monitor-based container adjustment method of FIG. 1;
FIG. 3 is a flow chart of a sub-step of the monitor-based container adjustment method of FIG. 1;
fig. 4 is a schematic block diagram of a container adjusting device based on a monitor according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification 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.
The embodiment of the invention provides a container adjusting method based on a monitor, container adjusting equipment based on the monitor and a storage medium.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
The method for adjusting a container based on a monitor according to an embodiment of the present invention will be described in detail with reference to the scenario in fig. 1. It should be noted that, the scenario in fig. 1 is only used to explain the method for adjusting a container based on a monitor provided by the embodiment of the present invention, but does not constitute a limitation on the application scenario of the method for adjusting a container based on a monitor provided by the embodiment of the present invention.
Referring to fig. 1, fig. 1 is a flow chart of a container adjusting method based on a monitor according to an embodiment of the invention.
As shown in fig. 1, the method for adjusting a container based on a monitor includes steps S101 to S103.
Step S101, acquiring service states in container information of a container to be monitored through a monitor.
Specifically, referring to fig. 1, step S101 includes:
creating a monitoring thread, taking the monitoring thread as the monitor, and monitoring the state of the container through the monitoring thread;
and if the container state is detected to be abnormal, controlling the container to be monitored to restart and re-monitor the container state through the monitoring thread.
Referring to fig. 1, step S101 specifically includes:
and determining a data serialization format (YML) file through the monitoring thread, and starting monitoring of the container to be monitored through the YML file, wherein the YML file is pre-stored in service software.
Step S102, obtaining the target resource utilization rate in the service state, and determining the container state according to the comparison result of the preset threshold value and the target resource utilization rate.
And step 103, adjusting the container to be monitored according to the container state.
In this embodiment, the container state includes an expansion state and a contraction state, and the adjusting the container to be monitored specifically includes: and expanding the capacity of the container to be monitored according to the capacity expansion state, or shrinking the capacity of the container to be monitored according to the capacity shrinking state. The monitor is a self-grinding monitor, and the target resource utilization rate is the resource utilization rate of the container to be monitored, wherein the resource utilization rate comprises CPU utilization rate, memory utilization rate and the like.
The Docker container is an open-source application container engine, so that the developer can package their applications and rely on packages to a portable container in a unified manner, then release the packages to any server (including popular Linux machines and Windows machines) provided with the Docker engine, and can also realize virtualization. The containers are completely using sandboxed mechanisms without any interface to each other (IPhone-like apps). Almost no performance overhead, can be easily run in machines and data centers. Most importantly, they do not rely on any language, framework, including systems.
After the server is started, the selected operating system is started. Linux may be selected in the Docker world or the kernel supports a new version of Windows for container primitives in the kernel. Like the virtual machine model, the OS also occupies all hardware resources. Above the OS layer, a container engine (e.g., docker) needs to be installed. The container engine may take system resources such as process trees, file systems, and network stacks and then partition the resources into secure, isolated resource structures, referred to as containers. Each container looks like a real operating system within which applications can run.
The Docker container has the following three major characteristics:
and (3) light weight: multiple Docker containers running on one host may share the host operating system kernel; the starting is rapid, and only few calculation and memory resources are occupied;
standard opening: the Docker container is based on open standards, capable of running on all mainstream Linux versions, microsoft Windows, and any infrastructure including VMs, bare metal servers, and clouds;
safety and reliability: the isolation of the Docker-endowed applications is not limited to isolation from each other, but is also independent of the underlying infrastructure. Docker provides the strongest isolation by default, so that application problems occur, just as a single container, but not the whole host.
The embodiment of the invention provides a container adjusting method, device and storage medium based on a monitor, and the embodiment of the invention obtains the service state in the container information of a container to be monitored through the monitor; acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate; the container state comprises an expansion state and a contraction state, and the expansion state and the contraction state are respectively according to the expansion state. By the method, the container information of the container to be monitored is monitored through the monitor, the container state of the container to be monitored is determined according to the comparison result of the target resource utilization rate in the container information and the preset threshold value, and the container to be monitored is adjusted according to the container state, so that the service efficiency of the container to be monitored is improved on the premise of being separated from the PaaS platform, and the problem that the service efficiency is low due to the fact that the existing container system cannot automatically flick under the limited resource scene is solved.
Referring to fig. 2, step S103 specifically includes: substep S1031.
And step S1031, deleting the container information of at least one to-be-monitored container copy through the monitor if the container state is the shrinking state, and completing the shrinking of the to-be-monitored container.
Referring to fig. 2, step S1031 specifically includes:
calling an Application Programming (API) interface of the container to be monitored through the monitor, and matching the API interface with an API interface of the container copy to be monitored;
and deleting the copy of the container to be monitored matched with the API by the monitor based on the matching result, and deleting the corresponding container information.
The embodiment of the invention provides a container adjusting method, device and storage medium based on a monitor, and the embodiment of the invention obtains the service state in the container information of a container to be monitored through the monitor; acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate; and if the container state is the capacity expansion state, expanding the capacity of the container to be monitored. By the method, the container information of the container to be monitored is monitored through the monitor, the container state of the container to be monitored is determined according to the comparison result of the target resource utilization rate in the container information and the preset threshold value, and the container to be monitored is contracted in the contracted state, so that the service efficiency of the container to be monitored is improved on the premise of being separated from the PaaS platform, and the problem of low service efficiency caused by the fact that the existing container system cannot automatically contract under the limited resource scene is solved.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for adjusting a container based on a monitor according to the present embodiment, as shown in fig. 3, step S102 specifically includes sub-steps S1021-S1022.
And step S1021, obtaining the target resource utilization rate in the container to be monitored through the monitor.
Sub-step S1022, reading the preset threshold in the data serialization format YML file, comparing the preset threshold with the target resource utilization rate, obtaining a comparison result, and determining the container state based on the comparison result.
In this embodiment, if the target resource usage rate is greater than the preset threshold, determining that the container state is a capacity expansion state; and if the target resource utilization rate is not greater than the preset threshold value, determining that the container state is a capacity shrinking state.
Further, step S103 specifically further includes:
and if the container state is the capacity expansion state, creating at least one container copy to be monitored, controlling the starting of the container copy to be monitored through the YML file, and synchronizing the container information of the container to be monitored to the container copy to be monitored to realize the capacity expansion of the container to be monitored.
The embodiment of the invention provides a container adjusting method, device and storage medium based on a monitor, and the embodiment of the invention obtains the service state in the container information of a container to be monitored through the monitor; acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate; and if the container state is the capacity expansion state, expanding the capacity of the container to be monitored. By the method, the container information of the container to be monitored is monitored through the monitor, the container state of the container to be monitored is determined according to the comparison result of the target resource utilization rate in the container information and the preset threshold value, and the container to be monitored is expanded in the expansion state, so that the service efficiency of the container to be monitored is improved on the premise of being separated from the PaaS platform, and the problem of low service efficiency caused by the fact that the existing container system cannot automatically spring under the limited resource scene is solved.
Based on all the above embodiments, the present embodiment further includes:
and monitoring the resource utilization rate through the monitor, and reading the preset threshold value set in the data serialization format YML file according to a preset time interval.
In a specific embodiment, the monitor reads the threshold value according to a preset time interval, so that the updating of the container information in the container to be monitored is realized, and the state of the container system is adjusted according to the updating of the container information, so that the automatic container flicking is finally realized.
The invention mainly monitors the state of the container in real time through the monitoring process to determine the flick of the container, and firstly, the service module needs to be started first. The service module mainly comprises: MSB (service registry component of GPaas, in this invention, ported to static container), public service, business components (otcp, apps), all deployed in micro-service fashion.
And the service deployment based on the PaaS platform is based on the blueprint, and the containers corresponding to the services are arranged according to the blueprint planning. In the invention, service deployment centers on configuration files default-config. Yml, yml files are generated by analyzing blueprint files of each micro service;
configuration information (service and micro-service names, base image information, initialization container information, dependent public services, PG and PGcache instance information, image names and image packet paths, network information, environment variables, volume, cpu/memory constraints, etc.) of each service is configured in the default-config.
During deployment, the configuration file is analyzed, the operations of creating a mirror image, creating an instance in PG and PGcache, creating and starting a container, registering with MSB and the like are realized through the Docker SDK, and the deployment of MSB, public service, business components and the like is completed.
The static container compares the obtained container information with a configuration threshold set by a yml file in a mode that a main monitoring process and a sub-thread thereof are created by a monitor module monitor the state of the container, and adopts a corresponding container flick strategy, and the method comprises the following specific steps:
after the service module is deployed, the static container starts a monitor process, a dock monitoring thread dock monitor thread is created and used for monitoring the dock service state, and if the dock operates abnormally, the thread will pull up the dock service again, so that the normal operation environment of the container is ensured; the monitoring process will initialize the pull-up service monitoring thread: the method comprises the steps of obtaining a deployed specified service type and a micro-service list of the service from a type attribute by a sub monitor for [ servtype ] - [ servname ], obtaining total configuration information of the specified service from a persistence yml file, and monitoring service container states including the state of the container and the service state; starting a management thread (LifeManagerThread), managing the life cycle of each sub-thread, and controlling the start and stop of the sub-monitoring thread in real time according to the state of the switch map; simultaneously starting a SetActionHandlerthread thread to process the CLI client request; after the service deployment is completed, the monitor module sub-thread detects the container information to be monitored at regular time, and writes the read container information into a specified file, wherein the container information comprises: container state, CPU and memory usage.
The container extended copy scenario is as follows:
in the prior art, a PaaS platform based on K8S takes Pod as a minimum operation unit, the Pod operates in the Pod, one Pod can be composed of one or more containers, K8S has own Pod scheduling strategy, information indexes such as a CPU and a memory of a service are read through a horizontal Pod automatic expansion device (HPA: horizontal Pod Autoscaler), and compared with a set value of the scheduling strategy, and the information indexes are represented by the following formula:
expected running instance number = ceil [ current running instance number + (current index/expected index) ];
and when the number of expected container operation examples is calculated and the number of examples is larger than the number of current operation examples, the K8S is used for newly increasing Pod to schedule new container examples so as to realize container expansion.
In the invention, the service is directly deployed on the environment in a container mode without Pod support, the information such as a CPU and a memory of the container detected in real time by a service monitoring thread is read at fixed time, the threshold value set in a persistence yml file is compared with the container information detected in real time, and for the CPU service condition index, when the real-time data of the container exceeds the threshold value, the following formula is adopted:
CPU overrun percentage = CPU measured/CPU threshold 100% + float percentage;
and calculating the CPU overrun percentage, judging the memory use condition index by the same way, when any overrun value in the CPU and the memory index exceeds 85%, finding a corresponding default_config.yml configuration file by the monitor according to the service name, executing a dock run command by calling an API interface of the dock, and re-creating a con copy identical to the original container configuration. And the service thread pulls up the newly-built container copy through a start method defined by the service thread, monitors the newly-built container copy in real time, and writes the container copy information into a container information file to be monitored, so that the container expansion is realized. At this time, the two containers share the load of the service, so that the resource utilization rate is reduced, when the resource occupation of the two containers exceeds the limit again, the monitor creates a new container again, and so on until the number of container copies reaches the maximum value set in yml file, an alarm is generated, and the problem is examined.
Unlike PaaS, where a static container is a newly built container with the same configuration, paaS is a newly added Pod, when a plurality of containers run in one Pod, the number of copies is also newly added corresponding to other containers, which causes that the containers that do not have to be shrunk expand together, resulting in resource waste.
When the real-time data of the container is lower than the threshold value set in the yml file, the monitor randomly deletes one container under the service by calling the API interface of the dock, and simultaneously deletes the information of the corresponding id in the information file of the container to be monitored, releases the resource and realizes the container capacity reduction. The data generated in the container flicking process is stored in the server through the mounting volume, and the double-machine scene can also store the data through the shared magnetic array, so that the data integrity and the normal operation of the service are ensured.
The static container also has a double-machine scene which is the same as a single-machine scene on a container flick mechanism, and the difference is that the double-machine environment supports disaster recovery management. The dual-computer environment needs to install dual-computer software, create dual-computer catalogue, upload dual-computer software package and license file, and install dual-computer by configuring related information of dual-computer in setup_config.yml file. The dual-machine software is a self-grinding tool, and can determine whether to execute dual-machine switching by starting a monitoring process, monitoring the states of the container and the server.
The disaster recovery system is characterized in that two or more sets of IT systems with the same function are built at different places far apart, health state monitoring and function switching can be performed between the two systems, and when one system stops working due to accidents (such as fire, earthquake and the like), the whole application system can be switched to the other system, so that the functions of the system can continue to work normally. The disaster recovery technology is a component part of the high availability technology of the system, and the disaster recovery system is used for more emphasizing the influence of the external environment on the system, particularly the influence of disastrous events on the whole IT node, and providing a node-level system recovery function.
The embodiment of the invention provides a container adjusting method, device and storage medium based on a monitor, and the embodiment of the invention obtains the service state in the container information of a container to be monitored through the monitor; acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate; and if the container state is the capacity expansion state, expanding the capacity of the container to be monitored. By the method, the container information of the container to be monitored is monitored through the monitor, the container state of the container to be monitored is determined according to the comparison result of the target resource utilization rate in the container information and the preset threshold value, and the container to be monitored is adjusted according to the container state, so that the service efficiency of the container to be monitored is improved on the premise of being separated from the PaaS platform, and the problem that the service efficiency is low due to the fact that the existing container system cannot automatically flick under the limited resource scene is solved.
Referring to fig. 4, fig. 4 is a schematic block diagram illustrating a structure of a container adjusting apparatus based on a monitor according to an embodiment of the present invention.
As shown in fig. 4, the monitor-based container conditioning apparatus 300 includes a processor 301 and a memory 302, the processor 301 and the memory 302 being connected by a bus 303, such as an I2C (Inter-integrated Circuit) bus.
In particular, the processor 301 is configured to provide computing and control capabilities to support the operation of the overall monitor-based container conditioning apparatus. The processor 301 may be a central processing unit (Central Processing Unit, CPU), the processor 301 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Specifically, the Memory 302 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 4 is merely a block diagram of a portion of the structure associated with an embodiment of the present invention and is not intended to limit the monitor-based container adjustment device to which an embodiment of the present invention may be applied, and that a particular monitor-based container adjustment device may include more or less components than those shown, or may combine some of the components, or may have a different arrangement of components.
The processor 301 is configured to execute a computer program stored in the memory 302, and implement any one of the monitor-based container adjustment methods provided in the embodiments of the present invention when the computer program is executed.
In an embodiment, the processor 301 is configured to execute a computer program stored in a memory, and when executing the computer program, implement the following steps: acquiring a service state in container information of a container to be monitored through a monitor; acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate; and adjusting the container to be monitored according to the container state.
In an embodiment, the processor 301 is configured to implement: and if the container state is a shrinking state, deleting the container information of at least one to-be-monitored container copy through the monitor to finish shrinking of the to-be-monitored container.
In an embodiment, the processor 301 is configured to implement: calling an Application Programming (API) interface of the container to be monitored through the monitor, and matching the API interface with an API interface of the container copy to be monitored; and deleting the copy of the container to be monitored matched with the API by the monitor based on the matching result, and deleting the corresponding container information.
In an embodiment, the processor 301 is configured to implement: creating a monitoring thread, taking the monitoring thread as the monitor, and monitoring the state of the container through the monitoring thread; and if the container state is detected to be abnormal, controlling the container to be monitored to restart and re-monitor the container state through the monitoring thread.
In an embodiment, the processor 301 is configured to implement: and determining a data serialization format (YML) file through the monitoring thread, and starting monitoring of the container to be monitored through the YML file, wherein the YML file is pre-stored in service software.
In an embodiment, the processor 301 is configured to implement: acquiring the target resource utilization rate in the container to be monitored through the monitor; and reading the preset threshold value in the data serialization format YML file, comparing the preset threshold value with the target resource utilization rate to obtain a comparison result, and determining the container state based on the comparison result.
In an embodiment, the processor 301 is configured to implement: and if the container state is the capacity expansion state, creating at least one container copy to be monitored, controlling the starting of the container copy to be monitored through the YML file, and synchronizing the container information of the container to be monitored to the container copy to be monitored to realize the capacity expansion of the container to be monitored.
In an embodiment, the processor 301 is configured to implement: if the target resource utilization rate is greater than the preset threshold value, determining that the container state is a capacity expansion state; and if the target resource utilization rate is not greater than the preset threshold value, determining that the container state is a capacity shrinking state.
The embodiment of the invention provides a container adjusting method, device and storage medium based on a monitor, and the embodiment of the invention obtains the service state in the container information of a container to be monitored through the monitor; acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate; and if the container state is the capacity expansion state, expanding the capacity of the container to be monitored. By the method, the container information of the container to be monitored is monitored through the monitor, the container state of the container to be monitored is determined according to the comparison result of the target resource utilization rate in the container information and the preset threshold value, and the container to be monitored is adjusted according to the container state, so that the service efficiency of the container to be monitored is improved on the premise of being separated from the PaaS platform, and the problem of low service efficiency caused by the fact that the existing container system cannot realize automatic flicking under the limited resource scene is solved
It should be noted that, for convenience and brevity of description, a person skilled in the art may clearly understand that, for the specific working process of the above-described monitor-based container adjusting apparatus, reference may be made to the corresponding process in the foregoing embodiment of the monitor-based container adjusting method, which is not repeated herein.
Embodiments of the present invention also provide a storage medium for computer readable storage, where the storage medium stores one or more programs executable by one or more processors to implement any of the monitor-based container adjustment methods provided in the embodiments of the present invention.
The storage medium may be an internal storage unit of the monitor-based container adjusting device according to the foregoing embodiment, for example, a hard disk or a memory of the monitor-based container adjusting device. The storage medium may also be an external storage device of the monitor-based container adjustment device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the monitor-based container adjustment device.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware embodiment, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
It should be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, 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 process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. A method of container adjustment based on a monitor, comprising:
acquiring a service state in container information of a container to be monitored through a monitor;
acquiring a target resource utilization rate in the service state, and determining the container state according to a comparison result of a preset threshold value and the target resource utilization rate;
and adjusting the container to be monitored according to the container state.
2. The monitor-based container adjustment method of claim 1, wherein said adjusting the container to be monitored according to the container status comprises:
and if the container state is a shrinking state, deleting the container information of at least one to-be-monitored container copy through the monitor to finish shrinking of the to-be-monitored container.
3. The monitor-based container adjustment method according to claim 2, wherein said deleting, by the monitor, container information of at least one copy of a container to be monitored, completing the shrinking of the container to be monitored, comprises:
calling an Application Programming (API) interface of the container to be monitored through the monitor, and matching the API interface with an API interface of the container copy to be monitored;
and deleting the copy of the container to be monitored matched with the API by the monitor based on the matching result, and deleting the corresponding container information.
4. The monitor-based container adjustment method of claim 1, wherein said adjusting the container to be monitored according to the container status comprises:
and if the container state is the capacity expansion state, creating at least one container copy to be monitored, controlling the starting of the container copy to be monitored through the YML file, and synchronizing the container information of the container to be monitored to the container copy to be monitored to realize the capacity expansion of the container to be monitored.
5. The method for adjusting a container based on a monitor according to claim 1, wherein before the acquiring, by the monitor, a service status in container information of the container to be monitored, the method comprises:
creating a monitoring thread, taking the monitoring thread as the monitor, and monitoring the state of the container through the monitoring thread;
and if the container state is detected to be abnormal, controlling the container to be monitored to restart and re-monitor the container state through the monitoring thread.
6. The monitor-based container conditioning method of claim 5, wherein the controlling the container to be monitored to restart and monitor the container status by the monitoring thread further comprises:
and determining a data serialization format (YML) file through the monitoring thread, and starting monitoring of the container to be monitored through the YML file, wherein the YML file is pre-stored in service software.
7. The monitor-based container adjustment method according to claim 1, wherein said obtaining a target resource usage rate in the traffic state and determining the container state according to a comparison result of a preset threshold and the target resource usage rate comprises:
acquiring the target resource utilization rate in the container to be monitored through the monitor;
and reading the preset threshold value in the data serialization format YML file, comparing the preset threshold value with the target resource utilization rate to obtain a comparison result, and determining the container state based on the comparison result.
8. The monitor-based container adjustment method according to any one of claims 1-7, wherein said determining the container status based on a comparison of a preset threshold and the target resource usage comprises:
if the target resource utilization rate is greater than the preset threshold value, determining that the container state is a capacity expansion state;
and if the target resource utilization rate is not greater than the preset threshold value, determining that the container state is a capacity shrinking state.
9. A monitor-based container conditioning device comprising a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for enabling a connection communication between the processor and the memory, wherein the computer program, when executed by the processor, implements the steps of the monitor-based container conditioning method according to any of claims 1-8.
10. A storage medium for computer readable storage, wherein the storage medium stores one or more programs executable by one or more processors to implement the steps of the method of monitor-based container adjustment of any of claims 1-8.
CN202210764077.0A 2022-06-30 2022-06-30 Container adjusting method, device and storage medium based on monitor Pending CN117369981A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210764077.0A CN117369981A (en) 2022-06-30 2022-06-30 Container adjusting method, device and storage medium based on monitor
PCT/CN2023/103346 WO2024002190A1 (en) 2022-06-30 2023-06-28 Monitor-based container adjustment method and device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210764077.0A CN117369981A (en) 2022-06-30 2022-06-30 Container adjusting method, device and storage medium based on monitor

Publications (1)

Publication Number Publication Date
CN117369981A true CN117369981A (en) 2024-01-09

Family

ID=89383111

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210764077.0A Pending CN117369981A (en) 2022-06-30 2022-06-30 Container adjusting method, device and storage medium based on monitor

Country Status (2)

Country Link
CN (1) CN117369981A (en)
WO (1) WO2024002190A1 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920153B (en) * 2018-05-29 2022-04-22 华南理工大学 Docker container dynamic scheduling method based on load prediction
CN109669758A (en) * 2018-09-11 2019-04-23 深圳平安财富宝投资咨询有限公司 Concocting method, device, equipment and the storage medium of server resource
CN110311831B (en) * 2019-06-14 2022-03-25 平安科技(深圳)有限公司 Container cloud-based system resource monitoring method and related equipment
CN111464355B (en) * 2020-03-31 2022-11-15 北京金山云网络技术有限公司 Method and device for controlling expansion and contraction capacity of Kubernets container cluster and network equipment
CN112199150A (en) * 2020-08-13 2021-01-08 北京航空航天大学 Online application dynamic capacity expansion and contraction method based on micro-service calling dependency perception
CN112511339B (en) * 2020-11-09 2023-04-07 宝付网络科技(上海)有限公司 Container monitoring alarm method, system, equipment and storage medium based on multiple clusters

Also Published As

Publication number Publication date
WO2024002190A1 (en) 2024-01-04

Similar Documents

Publication Publication Date Title
US11960915B2 (en) Method and apparatus for creating virtual machine based on parameter information of a virtual network interface card
US11593149B2 (en) Unified resource management for containers and virtual machines
CN109729143B (en) Deploying a network-based cloud platform on a terminal device
EP2754046B1 (en) Automatic preemption in multiple computer systems
US9304815B1 (en) Dynamic replica failure detection and healing
US9319281B2 (en) Resource management method, resource management device, and program product
US8104038B1 (en) Matching descriptions of resources with workload requirements
US20190317824A1 (en) Deployment of services across clusters of nodes
CN110661647A (en) Life cycle management method and device
US11146623B2 (en) Intelligent distribution of virtual network function images
US11354150B1 (en) Utilizing maintenance event windows to determine placement of instances
CN111381928B (en) Virtual machine migration method, cloud computing management platform and storage medium
EP3879875A1 (en) Resource change method and device, apparatus, and storage medium
CN108900435B (en) Service deployment method, device and computer storage medium
WO2020211362A1 (en) Method and apparatus for improving availability of trunking system, and computer device
CN115328662A (en) Process thread resource management control method and system
CN114546587A (en) Capacity expansion and reduction method of online image recognition service and related device
US20220206836A1 (en) Method and Apparatus for Processing Virtual Machine Migration, Method and Apparatus for Generating Virtual Machine Migration Strategy, Device and Storage Medium
CN112567687B (en) Availability towards network slicing
CN117369981A (en) Container adjusting method, device and storage medium based on monitor
EP4206915A1 (en) Container creation method and apparatus, electronic device, and storage medium
CN115328608A (en) Kubernetes container vertical expansion adjusting method and device
CN116166413A (en) Lifecycle management for workloads on heterogeneous infrastructure
US11768704B2 (en) Increase assignment effectiveness of kubernetes pods by reducing repetitive pod mis-scheduling
US11853783B1 (en) Identifying hosts for dynamically enabling specified features when resuming operation of a virtual compute instance

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication