CN115061778A - Container starting method and device, computer equipment and storage medium - Google Patents

Container starting method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115061778A
CN115061778A CN202210679450.2A CN202210679450A CN115061778A CN 115061778 A CN115061778 A CN 115061778A CN 202210679450 A CN202210679450 A CN 202210679450A CN 115061778 A CN115061778 A CN 115061778A
Authority
CN
China
Prior art keywords
preset
performance index
target
container
condition
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
CN202210679450.2A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210679450.2A priority Critical patent/CN115061778A/en
Publication of CN115061778A publication Critical patent/CN115061778A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/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
    • 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
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

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

Abstract

The application relates to a container starting method, a container starting device, computer equipment, a storage medium and a computer program product, relates to the technical field of computers, and can be used in the field of financial technology or other related fields. The method comprises the following steps: performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition; under the condition that the abnormal performance index meets the preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index; determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio; after the service request of the service system is limited based on the current limiting proportion, a target number of newly-added containers are started according to a preset elegant starting strategy and a preset starting preheating mechanism, the timeliness of the request can be ensured, and the stable operation of the service system can be ensured through the elegant starting strategy and the preheating strategy when the capacity expansion is actually carried out.

Description

Container starting method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a container starting method, an apparatus, a computer device, a storage medium, and a computer program product.
Background
With the continuous development of computer technology, the performance capacity of the business system can be planned through the application deployment server, and the number of servers (containers) providing services in the business system can be determined, for example, the application deployment server can determine the number of servers according to the actual situation of the traffic in the business system. Since the traffic in the traffic system is dynamically changing, the number of servers also needs to be dynamically adjusted accordingly. For example, when the demand of the traffic is large and the number of the existing servers cannot meet the traffic demand, the capacity expansion processing needs to be performed on the servers in the traffic system.
In the related art, the application deployment server may perform capacity expansion by directly increasing the number of servers, but directly increasing the number of servers may cause unsmooth transition of a service system, resulting in an unstable operating state.
Disclosure of Invention
In view of the above, it is necessary to provide a container starting method, apparatus, computer device, computer readable storage medium and computer program product capable of smooth transition.
In a first aspect, the present application provides a method of starting a container. The method comprises the following steps:
performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition;
under the condition that the abnormal performance index meets a preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index;
determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio;
and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
In one embodiment, the method further comprises:
and after receiving the starting success notification message corresponding to the target number of newly added containers, canceling the current limitation of the service request of the service system.
In one embodiment, the detecting the performance index of the target container includes:
periodically carrying out interval preset time length and carrying out abnormity detection on the performance index of the target container.
In one embodiment, the performing abnormality detection on the performance index of the target container and determining an abnormal performance index meeting a preset abnormal condition includes:
detecting the performance index of the target container to obtain an index value of the performance index;
and if the index value of the performance index is greater than or equal to the detection threshold value corresponding to the performance index, taking the performance index as an abnormal performance index meeting the preset abnormal condition.
In one embodiment, after the step of performing anomaly detection on the performance index of the target container and determining an abnormal performance index meeting a preset anomaly condition, the method further includes:
judging whether the abnormal performance index meets a preset capacity expansion condition or not;
determining that the abnormal performance indexes meet a preset capacity expansion condition under the condition that the number of the abnormal performance indexes is larger than or equal to a preset number threshold;
or determining that the abnormal performance index meets a preset capacity expansion condition under the condition that the abnormal duration of the abnormal performance index is greater than or equal to a preset duration threshold.
In one embodiment, the starting, according to a preset elegant starting policy and a preset starting preheating mechanism, a target number of newly added containers includes:
for each target newly added container in the target number of newly added containers, calling a preset state query address to query the state information of the target newly added container;
if the fact that the loading of the initialized resource of the target newly added container is completed is determined according to the state information, the state of the target newly added container is updated to be a ready state;
and starting the newly added containers with the target number under the condition that the newly added containers with the target number are all in a ready state.
In one embodiment, the method further comprises:
under the condition that the abnormal performance index meets a preset capacity reduction condition, determining a capacity reduction ratio and a target container corresponding to the capacity reduction ratio;
and storing the state information in the target container to a preset distributed cache database.
In a second aspect, the present application also provides a container actuation apparatus comprising:
the detection module is used for carrying out abnormity detection on the performance index of the target container and determining the abnormal performance index which meets the preset abnormity condition;
the first determining module is used for determining a target capacity expansion proportion according to the index value of the abnormal performance index under the condition that the abnormal performance index meets a preset capacity expansion condition;
the second determining module is used for determining the current limiting proportion of the service request of the service system and the target number of the newly added containers according to the target capacity expansion proportion;
and the starting module is used for starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
In one embodiment, the apparatus further comprises:
and the canceling module is used for canceling the current limitation of the service request of the service system after receiving the starting success notification message corresponding to the target number of the newly added containers.
In one embodiment, the detection module is specifically configured to:
detecting the performance index of the target container to obtain an index value of the performance index;
and if the index value of the performance index is greater than or equal to the detection threshold value corresponding to the performance index, taking the performance index as an abnormal performance index meeting the preset abnormal condition.
In one embodiment, after the step of performing anomaly detection on the performance index of the target container and determining an abnormal performance index meeting a preset anomaly condition, the apparatus further includes:
the judging module is used for judging whether the abnormal performance index meets a preset capacity expansion condition or not;
the third determining module is used for determining that the abnormal performance indexes meet preset capacity expansion conditions under the condition that the number of the abnormal performance indexes is larger than or equal to a preset number threshold;
and the fourth determining module is used for determining that the abnormal performance index meets a preset capacity expansion condition under the condition that the abnormal duration of the abnormal performance index is greater than or equal to a preset duration threshold.
In one embodiment, the starting module is specifically configured to:
for each newly added target container in the newly added target containers with the target number, calling a preset state query address to query the state information of the newly added target container;
if the fact that the loading of the initialized resource of the target newly added container is completed is determined according to the state information, the state of the target newly added container is updated to be a ready state;
and starting the target number of newly added containers under the condition that the target number of newly added containers are all in a ready state.
In one embodiment, the apparatus further comprises:
the fifth determining module is used for determining the capacity reduction ratio and the target container corresponding to the capacity reduction ratio under the condition that the abnormal performance index meets a preset capacity reduction condition;
and the storage module is used for storing the state information in the target container to a preset distributed cache database.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition;
under the condition that the abnormal performance index meets a preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index;
determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio;
and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition;
under the condition that the abnormal performance index meets a preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index;
determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio;
and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition;
under the condition that the abnormal performance index meets a preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index;
determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio;
and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
The container starting method, the container starting device, the computer equipment, the storage medium and the computer program product comprise the following steps: performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition; under the condition that the abnormal performance index meets the preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index; determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio; and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion. By adopting the method, under the condition of capacity expansion of the service system, the current limiting processing is carried out on the service system in advance, the timeliness of the service system for responding to the request is ensured, the operation stability of the service system is ensured through an elegant starting strategy and a preheating strategy during the actual capacity expansion, and the smooth transition of the number of the service requests is realized.
Drawings
FIG. 1 is a schematic flow diagram of a method for initiating a container in one embodiment;
FIG. 2 is a flowchart illustrating the step of determining an abnormal performance indicator in one embodiment;
FIG. 3 is a flowchart illustrating steps of meeting a preset expansion condition in one embodiment;
FIG. 4 is a schematic flow chart of the startup procedure in one embodiment;
FIG. 5 is a schematic flow chart illustrating the container activation step in one embodiment;
FIG. 6 is a schematic flow chart of the storing step in one embodiment;
FIG. 7 is a block diagram of the construction of the container actuation apparatus in one embodiment;
FIG. 8 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In an actual application scenario, an application deployment server in a service system may plan the performance and capacity of the service system according to an actual use situation. The specific process of capacity planning by the application deployment server may be to determine the number of servers in the service system according to the traffic of the service system. However, the traffic of the traffic system is dynamically changing. For example, as services develop and users of service systems grow, the amount of services also grows, so that the number of servers is insufficient and the servers cannot satisfy the users. Thus, the servers in the service system need to perform capacity expansion processing, that is, the number of servers (containers) is increased. In the related art, when the capacity expansion processing is performed, the problems that the smooth transition cannot be performed and the service of the service system cannot be stably operated occur.
In an embodiment, as shown in fig. 1, a container starting method is provided, and this embodiment is exemplified by applying the method to a terminal, it is to be understood that the method may also be applied to a server, and may also be applied to a system including the terminal and the server, and is implemented by interaction between the terminal and the server, where the terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device and the like, and the server can be realized by an independent server or a server cluster formed by a plurality of servers. In this embodiment, the container starting method includes the following steps:
and 102, carrying out abnormity detection on the performance index of the target container, and determining the abnormal performance index meeting the preset abnormity condition.
The target container may be a server in the service system for processing the service request, for example, a docker container, and the application deployment server (Kubernetes) may be a container orchestration engine for orchestrating and managing the container. The docker container may encapsulate a software environment on which the application runs, and may include an operating system, middleware, an application framework, and the like.
Specifically, the performance indicators of the target container may include a CPU usage of the container, a memory usage of the container, a network throughput of the container, an http connection number of the container, and so on. The terminal can detect each performance index of the target container, and can obtain the index value of each performance index. Therefore, the terminal can combine and comprehensively judge the index values of the performance indexes to obtain the performance indexes meeting the preset abnormal conditions. The preset abnormal condition may be used to determine whether the performance index is abnormal. The preset abnormal condition may also be determined according to an actual application scenario of the service system.
In one example, a practical application scenario of a business system may be to receive a user-triggered business request, which may include a long connection transaction, a short connection transaction, a tape session transaction, a pure service invocation transaction, a CPU intensive transaction, an IO intensive transaction. The terminal may deploy a java agent in the target container to detect each performance index in the target container, for example, the terminal may collect an index value of each performance index in the target container.
And 104, determining a target capacity expansion ratio according to the index value of the abnormal performance index under the condition that the abnormal performance index meets the preset capacity expansion condition.
Specifically, the terminal detects the performance indexes in the target container to obtain one or more abnormal performance indexes, and the types of the performance indexes are different. The terminal may perform comprehensive judgment on the index value of each abnormal performance index, and specifically, may perform comprehensive judgment according to the category of the abnormal performance index and the index value of the abnormal performance index. Under the condition that the terminal determines that the abnormal performance index meets the preset expansion condition, the terminal can determine a target expansion ratio according to each abnormal performance index value. The target expansion ratio may be a ratio of the number of the newly added containers to the original containers, for example, the target expansion ratio may be thirty percent.
In one example, the terminal determines a target capacity expansion ratio corresponding to an index value of a preset abnormal performance index according to a corresponding relationship between the index value and the capacity expansion ratio.
And step 106, determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio.
In particular, the service system may receive a user-triggered service request, which may be a user-triggered transaction request or the like. The terminal can calculate the proportion of the current service system which needs to limit the service request according to the calculated target capacity expansion proportion. Therefore, the terminal can calculate the number of the newly added containers according to the number of the original containers and the target expansion ratio. The terminal can perform product operation on the quantity of the original containers and the target capacity expansion ratio, and the obtained product result is used as the number of the newly added containers.
In an example, the target capacity expansion ratio may be consistent with a current limit ratio of a service request of the service system, for example, in a case that the target capacity expansion ratio calculated by the terminal is thirty percent, the terminal may determine that the current limit ratio of the service request of the service system is thirty percent according to a condition that the target capacity expansion ratio is consistent with the current limit ratio of the service request of the service system. The number of original containers of the service system may be b, and the target capacity expansion ratio may be c, so that the number of newly added containers may be bc.
In another example, the target capacity expansion ratio may be in a proportional relationship with the service request of the service system, for example, in a case that the target capacity expansion ratio calculated by the terminal is a, the terminal may determine that the current limit ratio of the service request of the service system is na according to the proportional relationship between the target capacity expansion ratio and the current limit ratio of the service request.
And 108, after the service request of the service system is limited based on the current limiting ratio, starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism, wherein the newly added containers are used for receiving the service request and processing the service request.
In particular, the graceful start-up policy of the container may be to delay the time that the container provides service to the business system after the container is started. In this way, the terminal can perform resource loading operation on the container and perform initialization operation on container parameters and the like in advance. After the resource loading operation and the parameter initialization operation of the container are completed, it can be determined that the container already has the capability of providing services for the service system, so that the terminal can determine that the container can provide services for the service system at the moment. The preset start-up pre-heating mechanism may be to gradually increase the flow (the number of service requests) allocated to the container according to the time, that is, the preset start-up pre-heating mechanism may be to allocate all the flow not immediately after the container is started, but to gradually increase the flow allocated to the container along with the time length of the container start-up.
In this way, the terminal can determine the amount of current limiting for the service request according to the calculated current limiting ratio. The terminal may determine, based on the target number of the service request for current limiting and the priority level of each service request, the target service request with the lowest target number of the priority program that needs to be current limited, and may perform current limiting processing on each target service request. After the current-limiting processing is performed on each target service request, the terminal can start a target number of newly-added containers according to a preset elegant strategy and a starting prediction mechanism to complete the capacity expansion processing of the service system. The current limiting processing of the service request refers to that the service system refuses the access of the service request.
In the container starting method, the performance index of the target container is subjected to abnormal detection, and the abnormal performance index meeting the preset abnormal condition is determined; under the condition that the abnormal performance index meets the preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index; determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio; and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion. By adopting the method, under the condition of expanding the capacity of the service system, the current limiting processing is carried out on the service system in advance, the timeliness of the service system for responding the request is ensured, the operation stability of the service system is ensured through an elegant starting strategy and a preheating strategy when the capacity is actually expanded, and the smooth transition of the number of the service requests is realized.
In one embodiment, the container activation method further comprises:
and after receiving the starting success notification message corresponding to the target number of newly added containers, canceling the current limitation of the service request of the service system.
Specifically, the terminal starts a target number of newly added containers according to a preset elegant strategy and a starting prediction mechanism, and completes capacity expansion processing on the service system. Thus, if the target number of newly added containers are started successfully, the target number of newly added containers can respectively send a starting success notification message to the terminal. After the terminal receives the start success notification message corresponding to the target number of the newly added containers, the terminal can determine that the target number of the newly added containers are all started successfully. In this way, the terminal may cancel the flow limiting process for the service request of the service system in the above-described steps of the embodiment, that is, the terminal may resume the access of the service request to the service system.
In this embodiment, by canceling the current limitation on the service system after the newly added container is started, the smooth transition of the capacity expansion processing of the service system can be realized, and the smooth transition of the service request to the newly added container is realized.
In one embodiment, the specific process of "detecting the performance index of the target container" in step 102 includes:
periodically detecting the performance index of the target container at preset time intervals.
Specifically, the preset duration may be determined according to an actual application scenario of the service system, and specifically may be determined according to a degree of timeliness of the service system for performance detection. Therefore, the terminal can preset time length at intervals to realize periodic detection of the performance index of the target container.
In this embodiment, the interval duration of the performance index detection determined according to the actual application scenario may avoid frequent detection of the performance index of the service system, and may also avoid excessive occupation of resources of the server. Meanwhile, the terminal can also ensure the timeliness and timeliness of the detection of the performance index of the service system. Therefore, the terminal can generate the alarm notification message in time under the condition of detecting the abnormal performance index, and output the alarm notification message to the operation and maintenance personnel of the service system, so that the operation and maintenance personnel can support the production operation condition of the service system in time. After the service system is automatically expanded, if the requirement of the service request of the service system cannot be met, the operation and maintenance personnel can perform manual adjustment.
In one embodiment, as shown in fig. 2, the specific process of "performing anomaly detection on the performance index of the target container and determining an abnormal performance index meeting a preset anomaly condition" in step 102 includes:
and step 202, carrying out abnormity detection on the performance index of the target container, and determining the index value of the performance index.
Specifically, the terminal may deploy a java agent in the target container, and acquire an index value of each performance index in the target container through the java agent. The performance metrics for the target container may include the CPU usage of the container, the memory usage of the container, the network throughput of the container, the http connection number of the container, and so on.
And 204, if the index value of the performance index is greater than or equal to the detection threshold value corresponding to the performance index, taking the performance index as an abnormal performance index meeting a preset abnormal condition.
Specifically, the terminal first determines a detection threshold corresponding to each performance index, for example, the terminal may determine a detection threshold corresponding to the CPU usage of the container. The terminal may compare the index value of the performance index with a detection threshold value of the performance index, and if the index value of the performance index is greater than or equal to the detection threshold value of the performance index, the terminal may determine that the performance index is an abnormal performance index. That is, if the terminal determines that the index value of the performance index is greater than or equal to the detection threshold value of the performance index, the terminal may determine that the performance index satisfies the preset abnormal condition, and may determine that the performance index is an abnormal performance index.
In one embodiment, after the step of "performing anomaly detection on the performance index of the target container and determining an abnormal performance index meeting a preset anomaly condition", as shown in fig. 3, the container starting method further includes:
step 302, determine whether the abnormal performance index meets a preset capacity expansion condition.
Specifically, after determining one or more abnormal performance indicators, the terminal may determine whether the abnormal performance indicators satisfy a preset capacity expansion condition, and when determining that the abnormal performance indicators do not satisfy the preset capacity expansion condition, the terminal may also determine whether the abnormal performance indicators satisfy the preset capacity reduction condition.
And step 304, determining that the abnormal performance indexes meet the preset capacity expansion condition under the condition that the number of the abnormal performance indexes is greater than or equal to the preset number threshold.
Specifically, the terminal may determine whether the abnormal performance indicator satisfies a preset capacity expansion condition according to a relationship between the determined number of the abnormal performance indicators and a preset number threshold. When the terminal determines that the number of the abnormal performance indexes is greater than or equal to the preset number threshold, the terminal may determine that a preset capacity expansion condition is satisfied at this time.
In one example, the terminal may determine whether the abnormal performance indicator satisfies a preset capacity expansion condition according to the category combination of the abnormal performance indicator.
For example, the performance index of the target container may include the CPU usage of the container, the memory usage of the container, the network throughput of the container, and the http connection number of the container; the preset detection threshold corresponding to the CPU usage of the container may be 70%, the preset detection threshold corresponding to the http connection number of the container may be 90%, and the preset detection threshold corresponding to the memory usage of the container may be 70%. In this way, in the case where the index value of the CPU usage of the container is greater than 70%, it can be determined that the CPU usage of the container is an abnormal performance index; under the condition that the index value of the memory usage of the container is larger than 70%, the memory usage of the container can be determined as an abnormal performance index; when the index value of the http connection number of the container is greater than 90%, the http connection number of the container may be determined to be an abnormal performance index.
Therefore, under the condition that the CPU usage amount of the container and the http connection number of the container are determined to be abnormal performance indexes by the terminal, the terminal can determine that the abnormal performance indexes meet the preset capacity expansion condition at the moment.
Or, the terminal may determine that the abnormal performance index satisfies the preset capacity expansion condition when determining that the CPU usage of the container and the memory usage of the container are both the abnormal performance indexes.
Step 306, determining that the abnormal performance index meets a preset capacity expansion condition under the condition that the abnormal duration of the abnormal performance index is greater than or equal to a preset duration threshold.
Specifically, the terminal may obtain an abnormal duration of each abnormal performance index, and the terminal may obtain a duration that an index value of each performance index is greater than or equal to a preset detection threshold corresponding to the performance index. The preset duration threshold may be determined according to the actual network conditions of the service system. Therefore, the terminal can determine that the abnormal performance index meets the preset capacity expansion condition under the condition that the abnormal duration of the abnormal performance index is greater than or equal to the preset duration threshold.
In an example, when the terminal determines that the CPU usage of the container and the http connection number of the container are both abnormal performance indicators, and the abnormal duration of the CPU usage of the container and the http connection number of the container is greater than or equal to a preset duration threshold, the terminal may determine that the abnormal performance indicators satisfy a preset capacity expansion condition at this time.
In an example, the terminal may further determine whether the preset capacity expansion condition is satisfied according to the importance degree of the application corresponding to the service system. Under the condition that the terminal determines that the importance degree of the application corresponding to the service system is higher, the terminal can determine that the service system meets the preset capacity expansion condition at the moment under the condition that an abnormal performance index appears at random, and the timeliness of the service system for processing the service request can be guaranteed without guaranteeing the use experience of a user. The importance degree of the application corresponding to each business system can be determined according to the configuration operation of the user. For example, the importance program of each application may include a first importance level, a second importance level, and a third importance level, and the terminal may determine the first importance level as an application having a higher importance level.
In the embodiment, the comprehensive condition of the operation of the container can be more accurately reflected by comprehensively judging the performance indexes, and the occurrence of misjudgment or misjudgment is avoided. By judging the abnormal duration of the abnormal performance index, the sudden abnormality of the performance index at a certain time point, which is caused by network fluctuation, network jitter and the like happened by the network infrastructure of the service system, can be identified, but the situation of performance problem is avoided, and false alarm is avoided.
In one embodiment, as shown in fig. 4, the step "starting a target number of newly added containers according to a preset elegant starting policy and a preset starting preheating mechanism" includes:
step 402, for each target newly added container in the target number of newly added containers, calling a preset state query address to query the state information of the target newly added container.
Specifically, the preset state query address may specify a URL, so that the terminal may call the specified URL to detect the state of each of the target newly added containers in the target number of newly added containers. The specified URL returns the current status information of the container. The state of each newly added target container that is not detected may be a not ready state (not ready).
Wherein, the specified URL is an access address provided by the container to the outside, and is used for providing the current state information of the container. The state information may be current state information of the target newly added container.
And step 404, if the loading of the initialized resource of the target newly added container is determined to be completed according to the state information, updating the state of the target newly added container to be a ready state.
Specifically, if the terminal can determine that the loading of the initialization resource in the container is completed according to the current state information of the target newly added container, the state of the target newly added container can be updated to the ready state (ready). That is, after the probing is successful, the container state is set to Ready, and the container can provide services to the business system.
Step 406, starting the target number of newly added containers under the condition that the target number of newly added containers are all in the ready state.
Specifically, if the terminal determines that the states of the target number of newly added containers are ready states, the terminal may start the target number of newly added containers, even if the target number of newly added containers provide services for the service system, which may be used to process the service request.
In one example, as shown in fig. 5, the terminal may determine that the state of the container may be a not ready state (not ready) before the terminal determines that the new container is not detected. First, the terminal may determine whether the number of probing is less than or equal to three, and in the case where the terminal determines that the number of probing is less than or equal to the number of probing, the terminal (kubernets) may access a specified URL to probe the container state. The URL is an access address provided outside the container for providing current state information of the container.
Thus, if the specified URL determines that the initialization resource in the container is successfully loaded, a ready state (ready) is returned, i.e., ok information is returned. And after the detection is successful, setting the state of the container to Ready, and providing service for the outside. If the check fails, that is, the ok message is not returned, after waiting for one cycle (60s), whether the number of probing times is less than or equal to three is determined again, and the steps described in the above embodiment are executed again.
In one embodiment, as shown in fig. 6, the container activation method further comprises:
step 502, determining a capacity reduction ratio and a target container corresponding to the capacity reduction ratio under the condition that the abnormal performance index meets a preset capacity reduction condition.
Specifically, the terminal determines the condition that the usage rate of the target container is low according to the abnormal performance index, and the terminal can determine that the preset capacity reduction condition is met at the time. In this way, the terminal can determine the target capacity reduction ratio according to the index value of the abnormal performance index and the target container which needs to be removed correspondingly.
And step 504, storing the state information in the target container to a preset distributed cache database.
Specifically, the state information within the target container may include: carrying session information of the task, saving user login information and order information in the session. In this way, the terminal can store the state information backup in the target container to the preset distributed cache database. Thus, when the service system receives the first service request, if the first service request is processed by the service system before the service system performs the capacity reduction processing, the preset distributed cache database stores the session information corresponding to the first service request. Therefore, the service system can extract the session information corresponding to the first service request from the preset distributed cache database to ensure the normal operation of the first service request.
The container starting method provided by the embodiment of the invention can comprehensively judge the service operation condition by using a plurality of performance index combinations, and accurately identify the problem of insufficient performance capacity. During capacity expansion, the method adopts the strategies of elegant starting, starting preheating and transaction current limiting to ensure stable production operation and smooth transition of transaction flow. For the condition that the capacity needs to be reduced, the system introduces the distributed cache to cache the service state information, and the normal execution of the transaction is ensured.
It should be understood that, although the steps in the flowcharts related to the embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a container starting apparatus for implementing the above-mentioned container starting method. The solution to the problem provided by the device is similar to the solution described in the above method, so the specific limitations in one or more embodiments of the container activation device provided below can be referred to the limitations in the above container activation method, and are not described herein again.
In one embodiment, as shown in fig. 7, there is provided a container activation device 600 comprising: a detection module 601, a first determination module 602, a second determination module 603, and an initiation module 604, wherein:
the detection module 601 is configured to perform anomaly detection on the performance index of the target container, and determine an abnormal performance index meeting a preset anomaly condition;
a first determining module 602, configured to determine a target expansion ratio according to an index value of an abnormal performance index when the abnormal performance index meets a preset expansion condition;
a second determining module 603, configured to determine, according to the target capacity expansion ratio, a current limit ratio of a service request of the service system and a target number of a newly added container;
the starting module 604 is configured to start the target number of newly added containers according to a preset elegant starting policy and a preset starting preheating mechanism after the current limiting is performed on the service request of the service system based on the current limiting ratio.
In one embodiment, the apparatus further comprises:
and the canceling module is used for canceling the current limitation of the service request of the service system after receiving the starting success notification message corresponding to the target number of the newly added containers.
In one embodiment, the detection module is specifically configured to:
detecting the performance index of the target container to obtain an index value of the performance index;
and if the index value of the performance index is greater than or equal to the detection threshold value corresponding to the performance index, taking the performance index as an abnormal performance index meeting the preset abnormal condition.
In one embodiment, after the step of performing anomaly detection on the performance index of the target container and determining an abnormal performance index meeting a preset anomaly condition, the apparatus further includes:
the judging module is used for judging whether the abnormal performance index meets a preset capacity expansion condition or not;
the third determining module is used for determining that the abnormal performance indexes meet preset capacity expansion conditions under the condition that the number of the abnormal performance indexes is larger than or equal to a preset number threshold;
and the fourth determining module is used for determining that the abnormal performance index meets a preset capacity expansion condition under the condition that the abnormal duration of the abnormal performance index is greater than or equal to a preset duration threshold.
In one embodiment, the starting module is specifically configured to:
for each target newly added container in the target number of newly added containers, calling a preset state query address to query the state information of the target newly added container;
if the fact that the loading of the initialized resource of the target newly added container is completed is determined according to the state information, the state of the target newly added container is updated to be a ready state;
and starting the newly added containers with the target number under the condition that the newly added containers with the target number are all in a ready state.
In one embodiment, the apparatus further comprises:
the fifth determining module is used for determining the capacity reduction ratio and the target container corresponding to the capacity reduction ratio under the condition that the abnormal performance index meets a preset capacity reduction condition;
and the storage module is used for storing the state information in the target container to a preset distributed cache database.
The various modules in the container activation device 600 described above may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 8. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing the relevant data of the container. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a container activation method.
Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program that when executed by the processor performs the steps of:
performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition;
under the condition that the abnormal performance index meets a preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index;
determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio;
and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
In one embodiment, a computer-readable storage medium is provided, having stored thereon a computer program which, when executed by a processor, performs the steps of:
performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition;
under the condition that the abnormal performance index meets a preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index;
determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio;
and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of:
performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition;
under the condition that the abnormal performance index meets a preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index;
determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio;
and starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It should be noted that the method and apparatus of the embodiments of the present disclosure may be used in the field of financial technology or other related fields, and the method and apparatus of the embodiments of the present disclosure do not limit the application field.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method of starting a container, the method comprising:
performing abnormity detection on the performance index of the target container, and determining an abnormal performance index meeting a preset abnormity condition;
under the condition that the abnormal performance index meets a preset expansion condition, determining a target expansion proportion according to the index value of the abnormal performance index;
determining the current limiting ratio of the service request of the service system and the target number of the newly added containers according to the target capacity expansion ratio;
and after the service request of the service system is subjected to current limiting based on the current limiting proportion, starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism, wherein the newly added containers are used for receiving the service request and processing the service request.
2. The method of claim 1, further comprising:
and after receiving the starting success notification message corresponding to the target number of newly added containers, canceling the current limitation of the service request of the service system.
3. The method according to claim 1, wherein the performing anomaly detection on the performance index of the target container and determining the abnormal performance index meeting the preset anomaly condition comprises:
detecting the performance index of the target container to obtain an index value of the performance index;
and if the index value of the performance index is greater than or equal to the detection threshold value corresponding to the performance index, taking the performance index as an abnormal performance index meeting the preset abnormal condition.
4. The method according to claim 1, wherein after the step of performing anomaly detection on the performance index of the target container and determining an abnormal performance index meeting a preset anomaly condition, the method further comprises:
judging whether the abnormal performance index meets a preset capacity expansion condition or not;
determining that the abnormal performance indexes meet a preset capacity expansion condition under the condition that the number of the abnormal performance indexes is larger than or equal to a preset number threshold;
or determining that the abnormal performance index meets a preset capacity expansion condition under the condition that the abnormal duration of the abnormal performance index is greater than or equal to a preset duration threshold.
5. The method of claim 1, wherein the starting the target number of newly added containers according to a preset graceful starting strategy and a preset starting preheating mechanism comprises:
for each target newly added container in the target number of newly added containers, calling a preset state query address to query the state information of the target newly added container;
if the initialization resource loading of the target newly added container is determined to be completed according to the state information, updating the state of the target newly added container to be a ready state;
and starting the target number of newly added containers under the condition that the target number of newly added containers are all in a ready state.
6. The method of claim 1, further comprising:
under the condition that the abnormal performance index meets a preset capacity reduction condition, determining a capacity reduction ratio and a target container corresponding to the capacity reduction ratio;
and storing the state information in the target container to a preset distributed cache database.
7. A container actuation apparatus, characterized in that it comprises:
the detection module is used for carrying out abnormity detection on the performance index of the target container and determining the abnormal performance index meeting a preset abnormity condition, and the newly added container is used for receiving the service request and processing the service request;
the first determining module is used for determining a target capacity expansion proportion according to the index value of the abnormal performance index under the condition that the abnormal performance index meets a preset capacity expansion condition;
the second determining module is used for determining the current limiting proportion of the service request of the service system and the target number of the newly added containers according to the target capacity expansion proportion;
and the starting module is used for starting a target number of newly added containers according to a preset elegant starting strategy and a preset starting preheating mechanism after the service request of the service system is subjected to current limiting based on the current limiting proportion.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202210679450.2A 2022-06-16 2022-06-16 Container starting method and device, computer equipment and storage medium Pending CN115061778A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210679450.2A CN115061778A (en) 2022-06-16 2022-06-16 Container starting method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210679450.2A CN115061778A (en) 2022-06-16 2022-06-16 Container starting method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115061778A true CN115061778A (en) 2022-09-16

Family

ID=83199692

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210679450.2A Pending CN115061778A (en) 2022-06-16 2022-06-16 Container starting method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115061778A (en)

Similar Documents

Publication Publication Date Title
EP3221795B1 (en) Service addressing in distributed environment
US10379838B1 (en) Update and rollback of code and API versions
US10725763B1 (en) Update and rollback of configurations in a cloud-based architecture
US9055065B2 (en) Managing participant order in distributed transactions
CN110708196B (en) Data processing method and device
US10505863B1 (en) Multi-framework distributed computation
WO2017114176A1 (en) Method and apparatus for coordinating consumption queue in distributed environment
CN112650575B (en) Resource scheduling method, device and cloud service system
CN111190753A (en) Distributed task processing method and device, storage medium and computer equipment
CN112433863A (en) Micro-service calling method and device, terminal equipment and storage medium
WO2017118318A1 (en) Data storage and service processing method and device
US10148592B1 (en) Prioritization-based scaling of computing resources
CN109951551B (en) Container mirror image management system and method
CN114237852A (en) Task scheduling method, device, server and storage medium
CN115914404A (en) Cluster flow management method and device, computer equipment and storage medium
CN115373886A (en) Service group container shutdown method, device, computer equipment and storage medium
CN115061778A (en) Container starting method and device, computer equipment and storage medium
US20220276901A1 (en) Batch processing management
CN115658287A (en) Method, apparatus, medium, and program product for scheduling execution units
CN115118612A (en) Resource quota management method and device, computer equipment and storage medium
CN114827157A (en) Cluster task processing method, device and system, electronic equipment and readable medium
CN110597682B (en) Application deployment method and device, computer equipment and storage medium
CN111698266A (en) Service node calling method, device, equipment and readable storage medium
CN112115119B (en) Graph database service performance monitoring method and device and storage medium
CN116701410B (en) Method and system for storing memory state data for data language of digital networking

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