CN114265669A - Destroyed container instance identification method and device - Google Patents
Destroyed container instance identification method and device Download PDFInfo
- Publication number
- CN114265669A CN114265669A CN202111658939.3A CN202111658939A CN114265669A CN 114265669 A CN114265669 A CN 114265669A CN 202111658939 A CN202111658939 A CN 202111658939A CN 114265669 A CN114265669 A CN 114265669A
- Authority
- CN
- China
- Prior art keywords
- container instance
- container
- timing task
- task
- filter
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 59
- 230000004083 survival effect Effects 0.000 claims abstract description 96
- 238000012544 monitoring process Methods 0.000 claims abstract description 63
- 238000012806 monitoring device Methods 0.000 claims description 44
- 238000001914 filtration Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 description 13
- 238000012545 processing Methods 0.000 description 13
- 238000004891 communication Methods 0.000 description 10
- 230000008859 change Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 230000009471 action Effects 0.000 description 5
- 230000002085 persistent effect Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000010365 information processing Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000006378 damage Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000000670 limiting effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004883 computer application Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005111 flow chemistry technique Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000036961 partial effect Effects 0.000 description 1
- 230000002829 reductive effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The specification provides a destroyed container instance identification method and a destroyed container instance identification device, which are applied to container instance monitoring equipment, wherein the method comprises the following steps: inputting the state information reported by all container examples in the current reporting period into a filter; wherein the filter is used for deleting repeated information in the state information of the container instance input into the filter; the state information of the container instance at least comprises a survival mark of the container instance, and the survival mark is used for representing that the container instance is not destroyed; and for each container instance, identifying the container instance based on the survival mark of the container instance output by the filter, the set initial timing task and the set termination timing task, and determining the container instance to be a destroyed container instance according to the identification result.
Description
Technical Field
The present disclosure relates to the field of computer application technologies, and in particular, to a method and an apparatus for identifying a destroyed container instance.
Background
The container technology is an operating system layer virtualization technology, a plurality of independent and non-interfering containers can be virtualized on one physical host by using the container technology, and each container provides an independent application running environment for applications running in the container. Some business system technicians will host business systems through container instances deployed on the cloud platform.
In order to manage a plurality of container instances of the business system, a device for monitoring the operation state of each container instance (hereinafter referred to as a container instance monitoring device) is generally configured. The container instance monitoring equipment summarizes and displays the operation condition of each container instance.
In the case of a destroyed container instance, the state information displayed by the container instance monitoring device in the related art may be adulterated with the destroyed container instance, which may affect the use experience of the user using the container monitoring device.
Disclosure of Invention
The specification provides a destroyed container instance identification method and device
According to a first aspect of embodiments herein, there is provided a method for identifying a destroyed container instance, the method being applied to a container instance monitoring apparatus, the method comprising:
inputting the state information reported by all container examples in the current reporting period into a filter; the filter is used for deleting repeated information in the state information of the container instance input into the filter, wherein the repeated information is the same state information as the existing information in the filter; the state information of the container instance at least comprises a survival mark of the container instance, and the survival mark is used for representing that the container instance is not destroyed;
and for each container instance, identifying the container instance based on the survival mark of the container instance output by the filter, the set initial timing task and the set termination timing task, and determining the container instance to be the destroyed container instance according to the identification result.
According to a second aspect of embodiments herein, there is provided a destroyed container instance identification apparatus for use in a container instance monitoring device, the apparatus comprising:
the state information input module is used for inputting the state information reported by all container examples in the current reporting period into the filter; the filter is used for deleting repeated information in the state information of the container instance input into the filter, wherein the repeated information is the same state information as the existing information in the filter; the state information of the container instance at least comprises a survival mark of the container instance, and the survival mark is used for representing that the container instance is not destroyed;
and the identification module is used for identifying the container instance based on the survival mark of the container instance, the set initial timing task and the set termination timing task which are output by the filter for each container instance, and determining the container instance to be the destroyed container instance according to the identification result.
According to a third aspect of embodiments herein, there is provided a container instance monitoring system, comprising a container instance monitoring device and container instances; the container instance monitoring device executes the above-described method to achieve identification of a destroyed container instance.
According to a fourth aspect of embodiments herein, there is provided a computer readable storage medium, which when executed by a processor, implements the destroyed container instance identification method described above.
According to a fifth aspect of embodiments herein, there is provided a computer apparatus comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the destroyed container instance identification method described above.
The specification provides a destroyed container instance identification method and a destroyed container instance identification device, which are applied to container instance monitoring equipment, wherein the method comprises the following steps: inputting the state information reported by all container examples in the current reporting period into a filter; wherein the filter is used for deleting repeated information in the state information of the container instance input into the filter; the state information of the container instance at least comprises a survival mark of the container instance, and the survival mark is used for representing that the container instance is not destroyed; and for each container instance, identifying the container instance based on the survival mark of the container instance output by the filter, the set initial timing task and the set termination timing task, and determining the container instance to be a destroyed container instance according to the identification result.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the specification.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a flow chart illustrating a method for identifying an instance of a destroyed container in accordance with an exemplary embodiment of the present specification.
Fig. 2A is a flow chart illustrating a method for identifying an instance of a destroyed container in accordance with one embodiment of the present description.
Fig. 2B is a flow chart illustrating another method for identifying an instance of a destroyed container in accordance with one embodiment of the present description.
Fig. 2C is a flow chart illustrating yet another example destroyed container identification method in accordance with one embodiment of the present disclosure.
Fig. 3 is a block diagram of an example destroyed container identification apparatus shown in accordance with an exemplary embodiment.
Fig. 4 is a hardware block diagram of a computer device in which a destroyed container instance identification means is shown in accordance with an exemplary embodiment of the present specification.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the specification, as detailed in the appended claims.
The terminology used in the description herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. 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. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present specification. Depending on context, the word "if" as used herein may be interpreted as "in the … … case" or "when … … case" or "in response to a determination".
The container instances on the cloud platform can be flexibly deployed as required, and the service system with large traffic change along with time change is more suitable for being realized through the container instances of the cloud platform. The service system deploys software of the service system through the container instances, and because each container instance has a certain upper flow processing limit, resources are saved by deploying more container instances in the service peak period and destroying a part of container instances in the service valley period.
In the case of a large number of container instances used by some business systems, equipment is needed to monitor the operating conditions of each container instance and to cope with traffic bursts or to detect failures more quickly. Such a device is referred to in this specification as a container instance monitoring device.
Because all container instances which need to be monitored by the container instance monitoring equipment may belong to different service systems, and the different service systems cannot summarize the running state of each container instance through the functions provided by each framework due to the difference between the development language and the development framework.
In the related art, the running state of each container instance is generally summarized in a manner that each container instance reports a unified specification message. The messages include state information of the container instance, and the state information generally includes information describing an operation state of the container instance, such as CPU utilization, access number of a certain interface, and data representing an alive state of the container. It should be noted that the report is generally reported according to a period (hereinafter referred to as a reporting period), the reporting periods of different container instances may be the same or different, and the time for starting reporting by the container instance may be the same or different. And the container example monitoring equipment displays the running state of each container example based on the received reported data. This operating state is hereinafter referred to as state information of the container instance.
When the container instance monitoring device is actually used, it is found that sometimes, after some container instances are destroyed because the container instances do not need to be destroyed or because new versions are online (for example, a part of container instances are destroyed when the container instances are not busy so as to save resources; when the service is upgraded, in order to not interrupt the service, the old version container instances are also destroyed while the new version container instances are deployed so as to complete the upgrade of the service), the container instance monitoring device still displays the state information of the container instances, which brings much confusion to users (confusion is why the destroyed container instances are still running).
Through analysis, after receiving the message, the container instance monitoring device does not directly analyze the data corresponding to the message storage, but analyzes the message first, inputs the obtained multiple pieces of state information of each container instance into a bloom filter (or other filters capable of rapidly filtering repeated information), and then stores the data output from the bloom filter. Since the bloom filter can filter out the repeated information, that is, if a piece of state information (container instance a, container Alive state is Alive) enters the bloom filter in the last period, the bloom filter will filter out the information after the state information is input into the bloom filter in the case that the same state information (container instance a, container Alive state is Alive) is received in the period, that is, the bloom filter will not output the state information. As can be seen from the above description, if the same state information is reported in two adjacent reporting periods (the state information includes the container instance to which the state information belongs, the name of the state information, and the corresponding specific state value), the bloom filter will not output the state information in the next period, and so on, if the same state information is reported in multiple consecutive periods, the bloom filter will only output the state information reported in the first period. It should be further noted that since the data will first arrive at the bloom filter, the state information filtered by the bloom filter will not be stored in the persistent storage space, and the container instance monitoring device will consider that the state information has not been received.
The purpose of setting the bloom filter is to improve the efficiency of processing the packet, and specifically, the bloom filter determines whether a certain state information is a duplicate information, not by accessing a persistent storage space (for example, accessing a database storing state information in a hard disk), but when the state information of the previous cycle arrives, if the state information is output, an index of the state information is stored in a memory, so that whether the newly received state information is the duplicate information can be determined only by the index stored in the memory, and in case of the duplicate information, the duplicate information does not need to be stored in the persistent storage space. The process of storing the state information into the persistent storage space is time-consuming, and the process of judging whether the state information is repeated or not through the memory is fast, so that a lot of repeated information can be stored without repetition through low consumption, and the efficiency of processing the message is improved.
Since the filtered data is not stored, the filtered data cannot be displayed normally. In order to enable the state information to be displayed normally after being filtered, the filtered state data are considered to be repeated information, so that when the state information of the container instance needs to be displayed, if the current state information is not obtained, the last state information with the period for storing the state information is taken as the current state information by the container instance monitoring system. For example, if the survival state of the container instance a in the first reporting period is Alive, and the survival states of the container instances a in the 2 nd to 9 th periods are not recorded, the Alive state reported in the first reporting period will be used as the survival state of the container instance a in the 10 th period when the survival state of the container instance a in the 10 th period needs to be displayed. This results in that the container instance monitoring device will not know if it has not stored all the status information for a certain period: whether it is not stored because the message was not really received or because it was filtered by the bloom filter. This allows the container instance monitoring device to still display the operational status of the container instance that has been destroyed.
Therefore, there are in the related art: the problem of how to quickly identify container instances that have been destroyed while ensuring message processing efficiency (using bloom filters or other filters).
In order to solve the above problem, the present specification provides a method for identifying a destroyed container instance, where a container instance monitoring device inputs status information reported in a current reporting period of all container instances into a filter to filter out duplicate information, where the status information at least includes a survival flag used for characterizing the survival of the container instances. If the filter outputs the survival mark of a certain container instance, the survival mark of the container instance is added in the filter, and the survival mark of the container instance is recorded; setting an initial timing task; and under the condition that the timing task termination corresponding to the container instance exists, the timing task termination is stopped; the timing duration of the initial timing task is not less than the reporting period of the container example; under the condition that the initial timing task is expired, deleting the survival mark of the container instance in the filter, and setting a termination timing task; and under the condition that the termination timing task expires, identifying the container instance corresponding to the termination timing task as a destroyed container instance.
In this way, the survival flag in the filter is deleted after the initial timing task expires, so that in the case that the container instance is not destroyed, the container instance monitoring device may receive the survival flag at intervals to confirm whether the container instance is alive, and in the case that the container instance is destroyed, the container instance monitoring device may normally delete the destroyed container instance by terminating the timing task. And because the filter is still working, the message processing efficiency can still be improved. Furthermore, inputting the survival flags into the filter eliminates the need to identify and screen out the survival flags before filtering by the filter; because the initial timing task exists, the survival mark can not change for a long time in the time period of the initial timing task, and the survival mark does not need to be received and stored in the time period of the initial timing task; and if the survival flag is not input into the filter, the initial timing task is not set, only the termination timing task is set, the termination timing task needs to be updated or a new termination timing task is set each time the survival flag is input, and by inputting the survival flag into the filter and setting the initial timing task, the device does not need to do any operation (such as updating the termination timing task) on the survival flag within the timing time of the initial timing task, so that the processing efficiency can be improved through the filter and the initial timing task.
The following provides a detailed description of examples of the present specification.
As shown in fig. 1, fig. 1 is a flowchart illustrating a method for identifying a destroyed container instance according to an exemplary embodiment, including the following steps:
It should be noted that, firstly, the method is applied to the container example monitoring device, and the container example monitoring device is described above and is not described herein again. The step is the same as the method in the related art, and the state information reported by the container instance in the current reporting period needs to be input into the filter. The input filter may reduce stored data, thereby improving the processing efficiency of the container monitoring instance.
In the following, the term appearing in step 101 will be explained, where the reporting period refers to the time interval between two times of reporting status information by the container instance. At the time of the arrival of the current reporting period, the container instance monitoring equipment receives messages sent by all container instances, and the messages contain the state information of the container instances. The reporting period may be generally set by a user of the container instance monitoring device, or may use a system default value.
The status information may refer to the foregoing description, and it should be noted that the status information of the container instance at least includes a survival flag of the container instance (the survival flag is used to indicate that the container instance is not destroyed), and since the survival flag does not change for a long time and clearly indicates whether a container is alive, the purpose of identifying the destroyed container instance can be more conveniently achieved by the survival flag.
With regard to the meaning of the alive flag, some container instances will inform the container instance monitoring device of their alive status by sending the alive flag when they are alive, and the container instance monitoring device will not receive the alive flag after the destruction, so as to determine whether a certain container instance has been destroyed by whether the alive flag is received within the timing time of terminating the timing task.
It should be noted that the status information input to the filter may be all status information contained in the message, and considering that some status information changes frequently, since the filter identifies repeated information by data stored in the memory, if the memory specification is not large, the filter may be set to input only part of the status information that does not change frequently into the filter without inputting the status information that changes frequently into the filter, so as to save memory resources.
Next, a description will be given of a filter for deleting duplicate information in the state information of the container instance input to the filter, the duplicate information being the same state information as the existing information in the filter. When a certain data is not filtered out by the filter, the data is added into the filter (the data is added into the space allocated by the memory for the filter), when the certain data is received by the filter, the received data is matched with the existing data in the filter, if any existing data in the filter is matched, the data is regarded as the repeated information, the repeated information is further deleted, and the repeated information is not output to the filter. In addition, in a reporting period after the state information is stored, if some data (information except the survival flag) existing in the filter is not matched, the data in the filter is deleted, so that some state information which is not required to be filtered is prevented from being filtered by mistake.
As can be seen from the above analysis, the repeated information is the same status information as the status information received in the previous cycle. By the filter, under the condition that the state information of one container instance received in two adjacent periods is the same, the filter does not output the same repeated information, so that the container instance monitoring equipment can not store the repeated information.
The filter may be a bloom filter or another filter having the above characteristics, and the present specification is not limited thereto.
Through the step 101, the process of inputting the state information into the filter in the related art is reserved, and the processing efficiency of the container instance monitoring equipment is ensured.
And 103, for each container instance, identifying the container instance based on the survival flag of the container instance output by the filter, the set initial timing task and the set termination timing task, and determining the container instance to be the destroyed container instance according to the identification result.
Next, a specific implementation of step 103 will be described.
From the above analysis, it can be seen that the present disclosure needs to implement the detection of the container instance survival status while ensuring the container instance monitoring system. Since duplicate information is filtered by the filter, an initial timing task needs to be set to periodically detect the alive status of the container instance, and the initial timing task needs to be set in the case that the filter outputs the alive flag of the container instance. Meanwhile, in order to ensure that the processing efficiency can be guaranteed within the timing time of the initial timing task, it is necessary to add the survival flag of the container instance to the filter and record the survival flag of the container instance while setting the initial timing task.
In view of the above process, it should be noted that, since the filter filters the repeated information, the repeated information refers to the same information as the information already existing in the filter, in other words, when the filter outputs a certain information, it proves that the information does not exist in the filter. Then for the survival flag, in the case that the filter outputs the survival flag of the container instance, it is proved that the survival flag of the container instance is not stored in the filter, so that the survival flag of the container instance needs to be added to the filter to filter out the repeated survival flags.
Meanwhile, if the survival mark is received, the survival mark of the container instance in the period also needs to be recorded, so that the container instance monitoring equipment can normally display the information of the container instance. Of course, in order to reduce the writing of data into the persistent storage medium, the container instance survival flag may be recorded only in the case that the container instance monitoring device has not recorded the container instance survival flag.
Furthermore, an initial timing task needs to be set. The initial timing task includes a timing duration, that is, the timing is started from the moment when the initial timing task is set until the timing duration is reached, which is the waiting time of the initial timing task, and after the timing duration is passed, the initial timing task is expired. After the initial timed task expires, i.e., after the timed duration has elapsed, the actions that should be performed when the initial timed task expires will be performed.
The purpose of setting the initial timing task is that on one hand, after the initial timing task is finished, the existing survival mark of the container instance of the filter needs to be deleted, so that the survival mark can be received and stored, and then whether the container instance monitoring device receives the survival mark or not in the time of terminating the timing task timing is judged, so that whether the survival mark is not received in the time period of the initial timing task because the container is destroyed or filtered is determined. On the other hand, if the initial timing task is not set, only the terminating timing task is set, i.e., the survival flag is not input to the filter, then the survival flag of the container instance per cycle needs to be stored; and only by terminating the timing task, under the condition that the container instance is not destroyed, the deletion or the update of the timing task is triggered in each reporting period, under the condition that the number of the container instances is large, the method can greatly increase the working efficiency of the container instance monitoring equipment, in other words, the working efficiency of the container instance monitoring equipment can be improved by setting the initial timing task.
After the effect of the initial timing task is explained, it should be also explained that the timing duration of the initial timing task is not less than the reporting period of the container instance. If the timing duration of the initial timing task is less than the reporting period of the container instance, in the case that the survival flag of a certain container instance is newly stored in the first period (that is, in the case that step 103 is executed), since the timing duration of the initial timing task is shorter than the reporting period of the container instance, the action executed in step 103 is performed once in the second period when the survival flag of the container instance is received, which does not achieve the above-mentioned advantage of improving the processing efficiency.
The timing durations of the initial timing tasks for different container instances may be the same. In addition, considering that all container instances on the physical machine are restarted due to the abnormality of the physical machine where the container instance is located, so that a plurality of container instances start reporting at the same time, and the reporting periods of the container instances are the same, the container instance monitoring device will receive a plurality of report messages when reaching the reporting periods of the container instances. In addition, the reported message middleware has message backlog, which also causes the container instance monitoring device to process a large amount of reported messages at the same time. In this case, if the timing durations of the initial timing tasks corresponding to all container instances are the same, which will cause all the initial timing tasks to expire at the same time (the expiration refers to the time that the initial timing tasks have waited for the timing duration), the container instance monitoring device handles the pressure at the expired time point.
In order to avoid reducing the problem that the pressure of the container instance monitoring equipment is high at a certain time point, the timing duration of the initial timing task is the initial duration plus the random duration, and the initial duration is not lower than the reporting period of the container instance. In addition, for convenience, the initial duration may be set to be not less than the longest reporting period in the reporting periods of all container instances. That is, the initial timing tasks corresponding to different container instances have the same initial duration, but the random duration is a random number generated within a certain range (the range can be set by a technician), and the random numbers corresponding to different container instances are different, so that the timing durations corresponding to different container instances are different, and thus all container instances do not expire at the same time, and the processing pressure of the container instance monitoring device is dispersed.
After the initial timing task is explained, the termination timing task is also explained. For the setting of the timing task termination, under the condition that the initial timing task is expired, deleting the survival mark of the container instance in the filter, and setting the timing task termination; and the timing duration of the timing task is not less than the reporting period of the container example. The stopping conditions of the terminating timed task of the container instance are as follows: the filter outputs a survival flag for the container instance. After the termination timing task is stopped, under the condition that the termination timing task of the container instance expires, the container instance is identified, and an identification result representing that the container instance is destroyed is obtained.
In other words, the terminating timing task is similar to the initial timing task, and is an action (identifying a destroyed container instance) that needs to be executed after the terminating timing task is expired after the terminating timing task is set and the timing duration of the terminating timing task is waited for; unlike the initial timed task, the terminating timed task may be stopped, that is, the terminating timed task corresponding to the container instance is stopped in the event that the filter outputs the surviving flag for the container instance.
Since the container instance monitoring device cannot receive the survival flag of the container instance within the timing duration of the initial timing task corresponding to a certain container instance, it cannot determine whether the container instance is alive through the survival flag, and then the container instance destruction state can be identified by deleting the survival flag of the container instance in the filter when the initial timing task expires and setting the termination timing task. Specifically, if the survival flag of the container instance is received within the timing duration of the timed task, the container instance is proved to survive, and if the survival flag of the container instance is not received, the container instance is proved to be destroyed, and then the container instance corresponding to the timed task needs to be identified as the destroyed container instance.
In addition, for the timing task termination, the timing duration of the timing task termination is not less than the reporting period of the container instance, so as to accurately judge whether the reported message is not received because the container instance is destroyed or the reported state information is not received because the timing duration is too short when the timing task termination expires. The timing task is preferably not terminated for a period of time too short to misidentify an undisrupted container instance as a destroyed container instance due to network latency or network jitter, etc.
As can be seen from the above analysis, step 103 can be implemented by:
for each container instance, the following steps are performed:
step 1031, if the filter outputs the survival flag of the container instance, adding the survival flag of the container instance to the filter; recording the survival flag of the container instance; setting an initial timing task; in the event that there is a termination timing task corresponding to the container instance, the termination timing task will be stopped.
Step 1032, in case of the expiration of the initial timing task, the alive flag of the container instance in the filter is deleted, and the termination timing task is set.
Step 1033, in case that the termination timing task expires, identifying the container instance corresponding to the termination timing task as the destroyed container instance.
After step 103, the container instance monitoring device will no longer display the status information of the destroyed container instance for normal display. Furthermore, to reduce the storage space occupied by garbage, all state information for a destroyed container instance may be deleted. If the requirement of the later-period duplicate container instance running condition exists, the destroyed container instance can be marked, and the container instance monitoring equipment only displays the following steps: container instances that are not marked as destroyed.
After the terminating timing task is described, specific implementations of steps 1032 and 1033 will also be described. In order to more efficiently perform step 1032 and 1033, step 1032 and step 1033 may be implemented by two listening threads/processes, respectively. In other words, the container instance monitoring device has an initial task monitoring module for monitoring whether the initial timing task corresponding to each container instance is expired, and a termination task monitoring module for monitoring whether the termination timing task corresponding to each container instance is expired.
Specifically, the container instance monitoring device is configured with an initial task monitoring module. Step 1032 specifically includes: the initial task monitoring module circularly executes the following steps: judging whether an initial timing task expires currently; under the condition that an expired initial timing task exists, deleting a survival mark for filtering a container instance corresponding to the initial timing task, and setting an end timing task; and waiting for a first preset time length in the case that the expired initial timing task does not exist.
The purpose of waiting for the first preset time is mainly to prevent the initial task monitoring module from idling and to prevent the module from executing all the time: and judging whether the initial timing task expires currently, so that the condition that the load of the CPU is overhigh can be reduced.
In addition, the container instance monitoring device is configured with a termination task monitoring module. Step 1033 specifically includes: the task termination monitoring module circularly executes the following steps: judging whether a termination timing task expires currently; under the condition that a timing task expires, identifying the container instance to obtain an identification result representing that the container instance is destroyed; waiting a second preset duration in the absence of an expired expiration timing task.
The purpose of waiting for the second preset duration is similar to the purpose of waiting for the first preset duration in the above process, and details are not repeated here. The first preset time period and the second preset time period may be the same or different, and specific values may be set according to requirements, which is not limited in this specification.
Step 1033 may be performed in addition to the above, by: the setting of the termination timing task comprises the following steps: and setting a termination timing task and starting a termination task monitoring module corresponding to the termination timing task. Under the condition that the termination timing task of the container instance expires, identifying the container instance to obtain an identification result representing that the container instance is destroyed, including: the termination task monitoring module executes the following steps: after the termination task monitoring module is started, waiting for the timing duration of the termination timing task, and judging whether the termination timing task is stopped; and under the condition that the termination timing task is not stopped, identifying the container instance to obtain an identification result representing that the container instance is destroyed (namely identifying the container instance corresponding to the termination timing task as the destroyed container instance).
In other words, after the timing task is terminated, the termination task monitoring module corresponding to the timing task is started, and the module does not need to monitor the timing task in real time, but only needs to judge whether the timing task is terminated after waiting for the timing duration of the timing task to be terminated, and identifies the container instance corresponding to the timing task as the destroyed container instance under the condition of stopping, thereby completing the purpose of step 1033.
The method illustrated in this specification will now be described by way of a specific example.
A certain container instance monitoring device is responsible for monitoring all container instances (different container instances may belong to different businesses) deployed by the company on the cloud platform. An initial task monitoring module, a termination task monitoring module and a state information processing module are configured in the container instance monitoring equipment, and each module is independently executed respectively to finish the identification of the destroyed container instance. It should be further noted that, after receiving the status information, the container instance monitoring device stores the status information that is not filtered by the bloom filter into the database, and when displaying the status of each container instance, the container instance monitoring device displays only the status information stored in the bloom filter (that is, the container instance identified as a destroyed container instance needs to be deleted).
The state information processing module performs the steps as shown in fig. 2A:
It should be noted that the target container example may refer to any container example, and is referred to as a target container example for convenience of description. The module may perform the following steps according to the container instance, that is, first input all the state information of a container instance into the bloom filter, and perform the steps 202 and 206 for the container instance.
At step 202, it is determined whether the bloom filter outputs a live flag for the target container instance.
If not, the proof is still within the timing duration of the initial timing task, the run is ended, and step 201 and 206 continue to be performed for the status information of the next received container instance. If so, step 203 is performed.
Further, for state information other than the alive flags, in the case where the bloom filter outputs other state information of the target container instance, the state information is stored into the database.
Past status information, that is, status information received in past reporting periods. Since for the first period, the state information reported in the first period is necessarily output by the bloom filter, and as long as the state information of the past reporting period is stored, it can be determined that the state information is not reported for the first time, so that there is a timing termination task corresponding to the target container instance.
In addition, if the status information of the past reporting period is not stored, the survival flag of the target container instance needs to be stored in the database, so that the status of the container instance can be normally displayed.
And step 206, setting an initial timing task, wherein the timing time is the initial time plus the random time.
The initial task monitor module performs the following steps as shown in fig. 2B:
Step 214, whether a system interrupt is received, if yes, the process is ended, otherwise, the process returns to step 211.
Wherein, the receipt of the system interrupt represents the system notifying the program to end its operation, and thus ends when the system interrupt is received.
The number of the state information processing modules and the number of the initial task monitoring modules are both 1, each module is responsible for processing all information, the terminated task monitoring modules are in one-to-one correspondence with the terminated timing tasks, and the terminated task monitoring modules are started when the terminated timing tasks are set and are responsible for monitoring the terminated timing tasks. It should be noted that the termination task monitoring module is only responsible for monitoring whether the termination timing task is expired or not, and is not responsible for stopping the termination timing task that needs to be stopped.
Specifically, the terminating task monitoring module corresponding to the target container instance performs the following steps as shown in fig. 2C:
That is, the task termination monitoring module is started after the task termination is set, and needs to wait for the timing duration of the task termination.
In other words, if the timed task is still present after waiting for the timed duration of the timed task to terminate, indicating that the surviving flag of the target container instance is received during this time, the target container instance is identified as the destroyed container instance, and all information of the target container instance in the database is deleted. If the task does not exist after waiting for the timing duration, the task is deleted after the status information processing module receives the survival flag of the target container instance, the task indicates that the target container instance is not destroyed, and the operation is finished.
In addition, the present specification also provides a container instance monitoring system, which comprises a container instance monitoring device and a plurality of container instances; the container instance monitoring device executes the above-described method to achieve identification of a destroyed container instance.
The present specification also provides embodiments of an apparatus and a computer device for use therewith, corresponding to the embodiments of the method described above.
As shown in fig. 3, fig. 3 is a block diagram of a destroyed container instance identification apparatus according to an exemplary embodiment, which is applied to a container instance monitoring device, and includes:
a status information input module 310, configured to input the status information reported in the current reporting period of all container instances into a filter; the filter is used for deleting repeated information in the state information of the container instance input into the filter, wherein the repeated information is the same state information as the existing information in the filter; the state information of the container instance at least comprises a survival mark of the container instance, and the survival mark is used for representing that the container instance is not destroyed.
And the identifying module 320 is configured to identify, for each container instance, the container instance based on the survival flag of the container instance output by the filter, the set initial timing task, and the set termination timing task, and determine that the container instance is a destroyed container instance according to the identification result.
Wherein, the identification module at least comprises an initial timing task setting submodule (not shown in the figure) for setting an initial timing task in case that the filter outputs the survival flag of the container instance; adding the survival mark of the container instance in the filter, and recording the survival mark of the container instance; and the timing duration of the initial timing task is not less than the reporting period of the container instance.
The timing duration of the initial timing task is the initial duration plus the random duration, and the initial duration is not lower than the reporting period of the container instance.
Wherein, the above-mentioned identification module further comprises an end timing task setting submodule (not shown in the figure), which is used for deleting the survival flag of the container instance in the filter and setting the end timing task when the initial timing task expires; the timing duration of the timing task is not less than the reporting period of the container example; the stopping conditions of the terminating timed task of the container instance are as follows: the filter outputs a survival flag for the container instance.
Wherein, the destroyed container instance identifying device further comprises an initial task monitoring module (not shown in the figure) for: the initial task monitoring module circularly executes the following steps: judging whether an initial timing task expires currently; under the condition that an expired initial timing task exists, deleting a survival mark for filtering a container instance corresponding to the initial timing task, and setting an end timing task; and waiting for a first preset time length in the case that the expired initial timing task does not exist.
Wherein, the destroyed container instance identifying device further comprises a termination task monitoring module (not shown in the figure) for: the task termination monitoring module circularly executes the following steps: judging whether a termination timing task expires currently; under the condition that a timing task expires, identifying the container instance to obtain an identification result representing that the container instance is destroyed; waiting a second preset duration in the absence of an expired expiration timing task.
The identification module 320 is specifically configured to: and under the condition that the termination timing task of the container instance expires, identifying the container instance to obtain an identification result representing that the container instance is destroyed.
Wherein, the destroyed container instance identifying device further comprises an initial task monitoring module (not shown in the figure) for: for each container instance, deleting the survival flag of the container instance in the filter if the initial timing task expires; and setting a termination timing task and starting a termination task monitoring module corresponding to the termination timing task. The destroyed container instance identification apparatus further comprises a termination task monitoring module for: the termination task monitoring module executes the following steps: after the termination task monitoring module is started, waiting for the timing duration of the termination timing task, and judging whether the termination timing task is stopped; and under the condition that the termination timing task is not stopped, identifying the container instance to obtain an identification result representing that the container instance is destroyed.
Wherein the filter is a bloom filter.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
As shown in fig. 4, fig. 4 is a hardware configuration diagram of a computer device in which the destroyed container instance identification means is located according to an embodiment, and the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Embodiments of the present description also provide a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the destroyed container instance identification method described above.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the specification being indicated by the following claims.
It will be understood that the present description is not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.
Claims (13)
1. A method for identifying a destroyed container instance, which is applied to a container instance monitoring device, the method comprising:
inputting the state information reported by all container examples in the current reporting period into a filter; wherein the filter is used for deleting repeated information in the state information of the container instance input into the filter; the state information of the container instance at least comprises a survival mark of the container instance, and the survival mark is used for representing that the container instance is not destroyed;
and for each container instance, identifying the container instance based on the survival mark of the container instance output by the filter, the set initial timing task and the set termination timing task, and determining the container instance to be a destroyed container instance according to the identification result.
2. The method of claim 1, wherein the setting of the initial timing task for the container instance comprises:
setting an initial timing task in the event that the filter outputs a live flag for the container instance; adding the survival mark of the container instance in the filter, and recording the survival mark of the container instance; and the timing duration of the initial timing task is not less than the reporting period of the container instance.
3. The method of claim 2, wherein the timing duration of the initial timing task is an initial duration plus a random duration, and the initial duration is not lower than the reporting period of the container instance.
4. The method of claim 2, wherein the setting of the termination timing task for the container instance comprises:
under the condition that the initial timing task is expired, deleting the survival mark of the container instance in the filter, and setting a termination timing task; the timing duration of the timing task is not less than the reporting period of the container example; the stopping conditions of the terminating timed task of the container instance are as follows: the filter outputs a survival flag for the container instance.
5. The method of claim 4, wherein the container instance monitoring device is configured with an initial task monitoring module;
in the case that the initial timing task expires, deleting the survival flag of the container instance in the filter, and setting the termination timing task, the method includes:
the initial task monitoring module circularly executes the following steps:
judging whether an initial timing task expires currently;
under the condition that an expired initial timing task exists, deleting a survival mark for filtering a container instance corresponding to the initial timing task, and setting an end timing task;
and waiting for a first preset time length in the case that the expired initial timing task does not exist.
6. The method of claim 4, wherein said identifying the container instance comprises:
and under the condition that the termination timing task of the container instance expires, identifying the container instance to obtain an identification result representing that the container instance is destroyed.
7. The method of claim 6, wherein the container instance monitoring device is configured with a terminate task monitoring module;
under the condition that the termination timing task of the container instance expires, identifying the container instance to obtain an identification result representing that the container instance is destroyed, including:
the task termination monitoring module circularly executes the following steps:
judging whether a termination timing task expires currently;
under the condition that a timing task expires, identifying the container instance to obtain an identification result representing that the container instance is destroyed;
waiting a second preset duration in the absence of an expired expiration timing task.
8. The method of claim 6, wherein setting the termination timing task comprises:
setting a termination timing task, and starting a termination task monitoring module corresponding to the termination timing task;
under the condition that the termination timing task of the container instance expires, identifying the container instance to obtain an identification result representing that the container instance is destroyed, including:
the termination task monitoring module executes the following steps:
after the termination task monitoring module is started, waiting for the timing duration of the termination timing task, and judging whether the termination timing task is stopped;
and under the condition that the termination timing task is not stopped, identifying the container instance to obtain an identification result representing that the container instance is destroyed.
9. The method of any one of claims 1-8, wherein the filter is a bloom filter.
10. A destroyed container instance identification apparatus, for use in a container instance monitoring device, the apparatus comprising:
the state information input module is used for inputting the state information reported by all container examples in the current reporting period into the filter; wherein the filter is used for deleting repeated information in the state information of the container instance input into the filter; the state information of the container instance at least comprises a survival mark of the container instance, and the survival mark is used for representing that the container instance is not destroyed;
and the identification module is used for identifying the container instance based on the survival mark of the container instance, the set initial timing task and the set termination timing task which are output by the filter for each container instance, and determining the container instance to be the destroyed container instance according to the identification result.
11. A container instance monitoring system, comprising a container instance monitoring device and a plurality of container instances;
the container instance monitoring device performs the method of any one of claims 1-9 to enable identification of a destroyed container instance.
12. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the destroyed container instance identification method as claimed in any one of claims 1-9.
13. A computer device, characterized in that the computer device comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the destroyed container instance identification method of any of claims 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111658939.3A CN114265669A (en) | 2021-12-30 | 2021-12-30 | Destroyed container instance identification method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111658939.3A CN114265669A (en) | 2021-12-30 | 2021-12-30 | Destroyed container instance identification method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114265669A true CN114265669A (en) | 2022-04-01 |
Family
ID=80832190
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111658939.3A Pending CN114265669A (en) | 2021-12-30 | 2021-12-30 | Destroyed container instance identification method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114265669A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117457032A (en) * | 2023-12-25 | 2024-01-26 | 山东万里红信息技术有限公司 | Storage medium destroying method based on volume identification |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160283256A1 (en) * | 2015-03-23 | 2016-09-29 | Societal Innovations Ipco Limited | System and method for configuring a platform instance at runtime |
CN109120678A (en) * | 2018-07-26 | 2019-01-01 | 北京百度网讯科技有限公司 | The method and apparatus of service tray for distributed memory system |
CN110262873A (en) * | 2019-05-17 | 2019-09-20 | 平安科技(深圳)有限公司 | Configuration modification method, apparatus, computer equipment and the storage medium of container application |
US10719369B1 (en) * | 2017-06-01 | 2020-07-21 | Amazon Technologies, Inc. | Network interfaces for containers running on a virtual machine instance in a distributed computing environment |
-
2021
- 2021-12-30 CN CN202111658939.3A patent/CN114265669A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160283256A1 (en) * | 2015-03-23 | 2016-09-29 | Societal Innovations Ipco Limited | System and method for configuring a platform instance at runtime |
US10719369B1 (en) * | 2017-06-01 | 2020-07-21 | Amazon Technologies, Inc. | Network interfaces for containers running on a virtual machine instance in a distributed computing environment |
CN109120678A (en) * | 2018-07-26 | 2019-01-01 | 北京百度网讯科技有限公司 | The method and apparatus of service tray for distributed memory system |
CN110262873A (en) * | 2019-05-17 | 2019-09-20 | 平安科技(深圳)有限公司 | Configuration modification method, apparatus, computer equipment and the storage medium of container application |
Non-Patent Citations (1)
Title |
---|
潘腾: "基于相似度的微服务资源调度方法的研究与实现", 中国优秀硕士学位论文全文数据库信息科技辑, 15 May 2021 (2021-05-15) * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117457032A (en) * | 2023-12-25 | 2024-01-26 | 山东万里红信息技术有限公司 | Storage medium destroying method based on volume identification |
CN117457032B (en) * | 2023-12-25 | 2024-03-22 | 山东万里红信息技术有限公司 | Storage medium destroying method based on volume identification |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109739727B (en) | Service monitoring method and device in micro-service architecture | |
US20180365085A1 (en) | Method and apparatus for monitoring client applications | |
CN108399132B (en) | Scheduling test method, device and storage medium | |
CN108984366B (en) | Terminal monitoring processing method, device and equipment | |
CN106919494B (en) | Method and device for realizing android application log | |
CN112311617A (en) | Configured data monitoring and alarming method and system | |
CN112256542B (en) | eBPF-based micro-service system performance detection method, device and system | |
CN110109741B (en) | Method and device for managing circular tasks, electronic equipment and storage medium | |
CN110515795A (en) | A kind of monitoring method of big data component, device, electronic equipment | |
CN114356499A (en) | Kubernetes cluster alarm root cause analysis method and device | |
CN111478792B (en) | Cutover information processing method, system and device | |
CN114265669A (en) | Destroyed container instance identification method and device | |
CN111597091A (en) | Data monitoring method and system, electronic equipment and computer storage medium | |
CN111309548A (en) | Timeout monitoring method and device and computer readable storage medium | |
CN112748990A (en) | Quartz-based data quality task execution method and device and computer equipment | |
CN114363334A (en) | Network configuration method, device and equipment for cloud system and cloud desktop virtual machine | |
CN117149480A (en) | Method and device for processing abnormality of Flink task, electronic equipment and medium | |
US10311032B2 (en) | Recording medium, log management method, and log management apparatus | |
CN114637656B (en) | Redis-based monitoring method and device, storage medium and equipment | |
CN114860432A (en) | Method and device for determining information of memory fault | |
CN114327835A (en) | Distributed task scheduling method and device, processor and electronic equipment | |
CN112596750B (en) | Application testing method and device, electronic equipment and computer readable storage medium | |
CN112783730A (en) | Interface monitoring method, device, medium and electronic equipment | |
CN110597603A (en) | Scheduling method and system of distributed scheduling tasks | |
CN117667604B (en) | Data monitoring method, device, electronic equipment and storage medium for tracking event |
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 | ||
EE01 | Entry into force of recordation of patent licensing contract | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20220401 Assignee: Baisheng Consultation (Shanghai) Co.,Ltd. Assignor: Shengdoushi (Shanghai) Technology Development Co.,Ltd. Contract record no.: X2023310000138 Denomination of invention: A Method and Device for Identifying Destroyed Container Instances License type: Common License Record date: 20230714 |