Multi-process service instance deployment method, device, equipment and readable storage medium
By introducing kernel CGROUP technology, monitoring process memory levels and adjusting resource usage, we resolved service anomalies caused by OOM, achieved timely processing and user-friendly error feedback, and improved service stability and user experience.
Patent Information
- Application Number
- CN202111483245.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2041-12-07
AI Technical Summary
In the existing technology, service exception processing delays caused by program memory leaks (OOM) cannot predict user behavior in advance, resulting in business losses and a lack of friendly feedback, so users cannot know the cause of the error in a timely manner.
By introducing kernel CGROUP technology, creating private and public CGROUP, monitoring process memory levels, adjusting process resource usage based on memory water level thresholds, terminating tasks in a timely manner, generating and displaying error messages, and sending analysis results.
It reduces the probability of program OOM and the risk of overall unavailability. Users can promptly learn the reasons for transaction failures caused by insufficient memory, improving service stability and user experience.
Smart Images

Figure CN114217926B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a multi-process service instance deployment method, apparatus, device, and readable storage medium. Background Art
[0002] When a program experiences an out-of-memory (OOM) leak, a monitoring program typically detects the disappearance of the process or an operating system error log, then notifies development, operations, and testing personnel for processing. This feedback method causes substantial damage to system services and lacks user-friendly feedback. OOMs are often caused by excessive concurrent service connections, large object operations, excessive temporary memory usage for queries, or insufficient service memory. From the service provider's perspective, user behavior cannot be predicted or restricted in advance. Only after an OOM kill occurs, when the monitoring program detects the disappearance of the service or an operating system error log, does exception handling trigger, but by then, user services have often been severely impacted. Summary of the Invention
[0003] The purpose of the present invention is to provide a multi-process service instance deployment method, apparatus, device and readable storage medium to improve the above-mentioned problems.
[0004] In order to achieve the above objectives, the embodiments of the present application provide the following technical solutions:
[0005] In one aspect, an embodiment of the present application provides a multi-process service instance deployment method, the method comprising:
[0006] Get the multi-process service instance and the tasks matched to each process, and create private and public CGROUP;
[0007] Put the multi-process service instance into the private CGROUP to obtain a first CGROUP;
[0008] A termination result is obtained based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and the corresponding task is terminated according to the termination result.
[0009] Optionally, obtaining a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminating the corresponding task according to the termination result, includes:
[0010] Analyze the memory water level of the first CGROUP to obtain a first analysis result, and move at least one process in the first CGROUP to the public CGROUP according to the first analysis result to obtain a second CGROUP;
[0011] Analyze the memory water level of the second CGROUP to obtain a second analysis result, and terminate related tasks according to the second analysis result.
[0012] Optionally, obtaining a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminating the corresponding task according to the termination result, includes:
[0013] Get the private CGROUP memory water level threshold;
[0014] Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP, move the processes in the first CGROUP to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP.
[0015] Analyze the memory water level of the second CGROUP to obtain a second analysis result, and terminate related tasks according to the second analysis result.
[0016] Optionally, obtaining a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminating the corresponding task according to the termination result, includes:
[0017] Get the private CGROUP memory water level threshold and the public CGROUP memory water level threshold;
[0018] Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP, move the processes in the first CGROUP to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP.
[0019] Analyze the memory water level of the second CGROUP. If the memory water level of the second CGROUP is greater than the public CGROUP memory water level threshold, trigger a termination signal to be sent to the process with the largest memory usage in the second CGROUP. The termination signal is used to trigger the process with the largest memory usage in the second CGROUP to terminate the task corresponding to the process with the largest memory usage in the second CGROUP.
[0020] Optionally, after analyzing the memory water level of the second CGROUP to obtain a second analysis result and terminating the relevant task according to the second analysis result, the method further includes:
[0021] Get the private CGROUP memory water level threshold;
[0022] Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP, move the processes in the public CGROUP to the first CGROUP until the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP.
[0023] Optionally, after analyzing the memory water level of the first CGROUP to obtain an analysis result and terminating the corresponding task based on the analysis result, the method further includes:
[0024] Generate error information based on the terminated task, and display the error information on a display interface;
[0025] Acquiring input information, wherein the input information includes operation information for analyzing the error message;
[0026] In response to the input information, the analysis result of the error information is displayed on the display interface, and the analysis result of the error information is sent to relevant staff members to prompt the relevant staff members to find the reason for the termination of the task.
[0027] In a second aspect, an embodiment of the present application provides a multi-process service instance deployment device, which includes a first acquisition module, an insertion module, and a termination module.
[0028] The first acquisition module is used to obtain multi-process service instances and tasks matched to each process, and create private CGROUP and public CGROUP;
[0029] The placing module is used to place the multi-process service instance into the private CGROUP to obtain a first CGROUP;
[0030] The termination module is configured to obtain a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminate the corresponding task according to the termination result.
[0031] Optionally, the termination module includes:
[0032] A first analysis unit is configured to analyze the memory water level of the first CGROUP to obtain a first analysis result, and move at least one process in the first CGROUP to the public CGROUP according to the first analysis result to obtain a second CGROUP;
[0033] The second analysis unit is configured to analyze the memory water level of the second CGROUP, obtain a second analysis result, and terminate related tasks according to the second analysis result.
[0034] Optionally, the termination module includes:
[0035] The first acquisition unit is used to obtain the private CGROUP memory water level threshold;
[0036] A third analysis unit is configured to analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP, the processes in the first CGROUP are moved sequentially to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP.
[0037] The fourth analysis unit is configured to analyze the memory water level of the second CGROUP, obtain a second analysis result, and terminate related tasks according to the second analysis result.
[0038] Optionally, the termination module includes:
[0039] The second acquisition unit is used to obtain the private CGROUP memory water level threshold and the public CGROUP memory water level threshold;
[0040] a fifth analyzing unit configured to analyze the memory water level of the first CGROUP, and if the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP, move the processes in the first CGROUP to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP;
[0041] The sixth analysis unit is used to analyze the memory water level of the second CGROUP. If the memory water level of the second CGROUP is greater than the public CGROUP memory water level threshold, it triggers the sending of a termination signal to the process with the largest memory usage in the second CGROUP. The termination signal is used to trigger the process with the largest memory usage in the second CGROUP to terminate the task corresponding to the process with the largest memory usage in the second CGROUP.
[0042] Optionally, the device further includes:
[0043] The second acquisition module is used to obtain the private CGROUP memory water level threshold;
[0044] An analysis module is configured to analyze a memory water level of the first CGROUP. If the memory water level of the first CGROUP is less than a memory water level threshold of the private CGROUP, the process in the public CGROUP is moved to the first CGROUP until the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP.
[0045] Optionally, the device further includes:
[0046] A generating module, configured to generate error information based on the terminated task, and display the error information on a display interface;
[0047] A third acquisition module is used to acquire input information, wherein the input information includes operation information for analyzing the error information;
[0048] The response module is used to respond to the input information, display the analysis result of the error information on the display interface, and send the analysis result of the error information to relevant staff to prompt the relevant staff to find the reason for the termination of the task.
[0049] In a third aspect, embodiments of the present application provide a multi-process service instance deployment device, comprising a memory and a processor. The memory is configured to store a computer program; the processor is configured to execute the computer program to implement the steps of the multi-process service instance deployment method.
[0050] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned multi-process service instance deployment method are implemented.
[0051] The beneficial effects of the present invention are:
[0052] 1. The present invention introduces kernel CGROUP technology to create private CGROUP areas and public CGROUP areas, selects and limits resource usage of processes with memory excess, and triggers service cancellation operations when memory exceeds the limit, thereby reducing the probability of program OOM and the risk of overall unavailability of the entire instance.
[0053] 2. By using the method of the present invention, users can learn from the error message that insufficient memory caused the transaction failure, thus solving the problem of the entire instance OOM but being unable to know the cause of the error.
[0054] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the embodiments of the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0056] Figure 1 This is a flowchart of a multi-process service instance deployment method according to an embodiment of the present invention;
[0057] Figure 2 It is a structural diagram of a multi-process service instance deployment device according to an embodiment of the present invention;
[0058] Figure 3 It is a schematic diagram of the structure of a multi-process service instance deployment device described in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0060] It should be noted that similar reference numerals or letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.
[0061] Example 1
[0062] like Figure 1 As shown, this embodiment provides a multi-process service instance deployment method, which includes step S1, step S2 and step S3.
[0063] Step S1: Get the multi-process service instance and the tasks matched to each process, and create a private CGROUP and a public CGROUP;
[0064] Step S2: Put the multi-process service instance into the private CGROUP to obtain a first CGROUP;
[0065] Step S3: Obtain a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminate the corresponding task according to the termination result.
[0066] In this embodiment, by introducing private CGROUP and public CGROUP based on kernel resource restrictions, it is possible to solve the problem of a process or service in a multi-process microservice application exhausting the operating system memory, causing the entire application instance to restart, all connections to be disconnected, and business unavailability for a certain period of time.
[0067] In a specific embodiment of the present disclosure, step S3 may further include step S31 and step S32.
[0068] Step S31: Analyze the memory water level of the first CGROUP to obtain a first analysis result, and move at least one process in the first CGROUP to the public CGROUP based on the first analysis result to obtain a second CGROUP;
[0069] Step S32: Analyze the memory water level of the second CGROUP to obtain a second analysis result, and terminate the related task according to the second analysis result.
[0070] In a specific embodiment of the present disclosure, step S3 may further include step S33, step S34 and step S35.
[0071] Step S33: Obtain the private CGROUP memory water level threshold;
[0072] Step S34: Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the private CGROUP memory water level threshold, move the processes in the first CGROUP to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the private CGROUP memory water level threshold.
[0073] Step S35: Analyze the memory water level of the second CGROUP to obtain a second analysis result, and terminate the related task according to the second analysis result.
[0074] In a specific embodiment of the present disclosure, step S3 may further include step S36, step S37 and step S38.
[0075] Step S36: Obtain the private CGROUP memory water level threshold and the public CGROUP memory water level threshold;
[0076] Step S37: Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the private CGROUP memory water level threshold, move the processes in the first CGROUP to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the private CGROUP memory water level threshold.
[0077] Step S38: Analyze the memory water level of the second CGROUP. If the memory water level of the second CGROUP is greater than the public CGROUP memory water level threshold, trigger a termination signal to be sent to the process with the largest memory usage in the second CGROUP. The termination signal is used to trigger the process with the largest memory usage in the second CGROUP to terminate the task corresponding to the process with the largest memory usage in the second CGROUP.
[0078] In this embodiment, when the memory level of the first CGROUP is greater than or equal to 80% of the total memory of the private CGROUP, the processes in the first CGROUP will be moved to the public CGROUP in order of memory usage. If the memory level of the second CGROUP is greater than 80% of the total memory of the public CGROUP, a special signal processing script will be triggered to send a task cancellation signal to the process with the most memory usage in the second CGROUP. After receiving the cancellation signal, the process with the most memory usage in the second CGROUP will cancel its executing task. By introducing kernel CGROUP technology, private and public CGROUP areas are opened up, resource usage of processes with memory exceeding the limit is selected and restricted, and when the memory exceeds the limit, a business cancellation operation is triggered, reducing the probability of program OOM and the risk of overall unavailability of the entire instance.
[0079] In a specific embodiment of the present disclosure, step S4 and step S5 may be further included after step S3.
[0080] Step S4: Obtain the private CGROUP memory water level threshold;
[0081] Step S5: Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP, move the processes in the public CGROUP to the first CGROUP until the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP.
[0082] In this embodiment, when the memory level of the first CGROUP is less than 80% of the total memory of the private CGROUP, the process in the public CGROUP will be moved to the first CGROUP.
[0083] In a specific embodiment of the present disclosure, after step S3, step S6, step S7 and step S8 may be further included.
[0084] Step S6: Generate error information based on the terminated task, and display the error information on the display interface;
[0085] Step S7: obtaining input information, wherein the input information includes operation information for analyzing the error message;
[0086] Step S8: In response to the input information, the analysis result of the error information is displayed on the display interface, and the analysis result of the error information is sent to relevant staff to prompt the relevant staff to find the reason for the termination of the task.
[0087] In this embodiment, by displaying the error information on the display interface, the user can be informed through the error information that the transaction failure is caused by insufficient memory, that is, the user can know the specific reason for the transaction failure, thereby solving the problem of the entire instance OOM and the inability to know the cause of the error.
[0088] At the same time, in this embodiment, the error message can also be analyzed to obtain the data the staff wants, and by sending the error message to the relevant staff, it can help the relevant staff quickly know that there is a problem with the system business so that they can take corresponding measures based on the error message.
[0089] Example 2
[0090] like Figure 2 As shown, this embodiment provides a multi-process service instance deployment device, which includes a first acquisition module 701, an insertion module 702 and a termination module 703.
[0091] The first acquisition module 701 is used to obtain multi-process service instances and tasks matched to each process, and create private CGROUP and public CGROUP;
[0092] The placing module 702 is configured to place the multi-process service instance into the private CGROUP to obtain a first CGROUP;
[0093] The termination module 703 is configured to obtain a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminate the corresponding task according to the termination result.
[0094] In this embodiment, by introducing private CGROUP and public CGROUP based on kernel resource restrictions, it is possible to solve the problem of a process or service in a multi-process microservice application exhausting the operating system memory, causing the entire application instance to restart, all connections to be disconnected, and business unavailability for a certain period of time.
[0095] In a specific embodiment of the present disclosure, the termination module 703 includes a first analysis unit 7031 and a second analysis unit 7032 .
[0096] The first analysis unit 7031 is configured to analyze the memory water level of the first CGROUP to obtain a first analysis result, and move at least one process in the first CGROUP to the public CGROUP according to the first analysis result to obtain a second CGROUP;
[0097] The second analysis unit 7032 is configured to analyze the memory level of the second CGROUP, obtain a second analysis result, and terminate related tasks according to the second analysis result.
[0098] In a specific embodiment of the present disclosure, the termination module 703 includes a first acquisition unit 7033 , a third analysis unit 7034 and a fourth analysis unit 7035 .
[0099] The first obtaining unit 7033 is used to obtain the private CGROUP memory water level threshold;
[0100] The third analysis unit 7034 is configured to analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the private CGROUP memory water level threshold, the processes in the first CGROUP are moved sequentially to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the private CGROUP memory water level threshold.
[0101] The fourth analysis unit 7035 is configured to analyze the memory level of the second CGROUP, obtain a second analysis result, and terminate related tasks according to the second analysis result.
[0102] In a specific embodiment of the present disclosure, the termination module 703 includes a second acquisition unit 7036 , a fifth analysis unit 7037 and a sixth analysis unit 7038 .
[0103] The second obtaining unit 7036 is used to obtain the private CGROUP memory water level threshold and the public CGROUP memory water level threshold;
[0104] The fifth analyzing unit 7037 is configured to analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the private CGROUP memory water level threshold, the processes in the first CGROUP are moved sequentially to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the private CGROUP memory water level threshold.
[0105] The sixth analysis unit 7038 is used to analyze the memory water level of the second CGROUP. If the memory water level of the second CGROUP is greater than the public CGROUP memory water level threshold, a termination signal is triggered to be sent to the process with the largest memory usage in the second CGROUP. The termination signal is used to trigger the process with the largest memory usage in the second CGROUP to terminate the task corresponding to the process with the largest memory usage in the second CGROUP.
[0106] In a specific embodiment of the present disclosure, the device further includes a second acquisition module 704 and an analysis module 705 .
[0107] The second acquisition module 704 is used to obtain the private CGROUP memory water level threshold;
[0108] The analysis module 705 is configured to analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is less than the private CGROUP memory water level threshold, the processes in the public CGROUP are moved to the first CGROUP until the memory water level of the first CGROUP is greater than or equal to the private CGROUP memory water level threshold.
[0109] In a specific embodiment of the present disclosure, the device further includes a generating module 706 , a third obtaining module 707 and a responding module 708 .
[0110] The generating module 706 is configured to generate error information based on the terminated task and display the error information on the display interface;
[0111] The third acquisition module 707 is used to acquire input information, where the input information includes operation information for analyzing the error information;
[0112] The response module 708 is used to respond to the input information, display the analysis result of the error information on the display interface, and send the analysis result of the error information to relevant staff to prompt the relevant staff to find the reason for the termination of the task.
[0113] It should be noted that, regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0114] Example 3
[0115] Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a multi-process service instance deployment device. The multi-process service instance deployment device described below and the multi-process service instance deployment method described above can refer to each other.
[0116] Figure 3 FIG. 8 is a block diagram of a multi-process service instance deployment device 800 according to an exemplary embodiment. Figure 3 As shown, the multi-process service instance deployment device 800 may include: a processor 801 and a memory 802. The multi-process service instance deployment device 800 may also include one or more of a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805.
[0117] The processor 801 is used to control the overall operation of the multi-process service instance deployment device 800 to complete all or part of the steps in the multi-process service instance deployment method described above. The memory 802 is used to store various types of data to support the operation of the multi-process service instance deployment device 800. This data may include, for example, instructions for any application or method operating on the multi-process service instance deployment device 800, as well as application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 802 or transmitted via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules. The above-mentioned other interface modules can be a keyboard, a mouse, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the multi-process service instance deployment device 800 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 may include: a Wi-Fi module, a Bluetooth module, an NFC module.
[0118] In an exemplary embodiment, the multi-process service instance deployment device 800 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-mentioned multi-process service instance deployment method.
[0119] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided. When executed by a processor, the program instructions implement the steps of the multi-process service instance deployment method described above. For example, the computer-readable storage medium may be the memory 802 including the program instructions described above. The program instructions may be executed by the processor 801 of the multi-process service instance deployment device 800 to perform the multi-process service instance deployment method described above.
[0120] Example 4
[0121] Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a readable storage medium. The readable storage medium described below and the multi-process service instance deployment method described above can refer to each other.
[0122] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the multi-process service instance deployment method of the above method embodiment.
[0123] The readable storage medium may specifically be any readable storage medium that can store program code, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0124] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A multi-process service instance deployment method, characterized in that: include: Get the multi-process service instance and the tasks matched to each process, and create private and public CGROUP; Put the multi-process service instance into the private CGROUP to obtain a first CGROUP; Obtaining a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminating the corresponding task according to the termination result; Obtaining a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminating the corresponding task according to the termination result, includes: Analyze the memory water level of the first CGROUP to obtain a first analysis result, and move at least one process in the first CGROUP to the public CGROUP according to the first analysis result to obtain a second CGROUP; Analyze the memory water level of the second CGROUP to obtain a second analysis result, and terminate related tasks according to the second analysis result.
2. The multi-process service instance deployment method according to claim 1, characterized in that: Obtaining a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminating the corresponding task according to the termination result, includes: Get the private CGROUP memory water level threshold; Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP, move the processes in the first CGROUP to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP. Analyze the memory water level of the second CGROUP to obtain a second analysis result, and terminate related tasks according to the second analysis result.
3. The multi-process service instance deployment method according to claim 1, characterized in that: Obtaining a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminating the corresponding task according to the termination result, includes: Get the private CGROUP memory water level threshold and the public CGROUP memory water level threshold; Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP, move the processes in the first CGROUP to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP. Analyze the memory water level of the second CGROUP. If the memory water level of the second CGROUP is greater than the public CGROUP memory water level threshold, trigger a termination signal to be sent to the process with the largest memory usage in the second CGROUP. The termination signal is used to trigger the process with the largest memory usage in the second CGROUP to terminate the task corresponding to the process with the largest memory usage in the second CGROUP.
4. The multi-process service instance deployment method according to claim 1, characterized in that: After analyzing the memory level of the second CGROUP to obtain a second analysis result and terminating the related task according to the second analysis result, the method further includes: Get the private CGROUP memory water level threshold; Analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP, move the processes in the public CGROUP to the first CGROUP until the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP.
5. The multi-process service instance deployment method according to claim 1, characterized in that: After analyzing the memory water level of the first CGROUP to obtain an analysis result and terminating the corresponding task based on the analysis result, the method further includes: Generate error information based on the terminated task, and display the error information on a display interface; Acquiring input information, wherein the input information includes operation information for analyzing the error message; In response to the input information, the analysis result of the error information is displayed on the display interface, and the analysis result of the error information is sent to relevant staff members to prompt the relevant staff members to find the reason for the termination of the task.
6. A multi-process service instance deployment device, characterized in that: include: The first acquisition module is used to obtain multi-process service instances and tasks matched to each process, and create private and public CGROUPs; An insert module is used to insert the multi-process service instance into the private CGROUP to obtain a first CGROUP; a termination module, configured to obtain a termination result based on the memory water level of the first CGROUP and the memory water level of the public CGROUP, and terminate the corresponding task according to the termination result; The termination module comprises: A first analysis unit is configured to analyze the memory water level of the first CGROUP to obtain a first analysis result, and move at least one process in the first CGROUP to the public CGROUP according to the first analysis result to obtain a second CGROUP; The second analysis unit is configured to analyze the memory water level of the second CGROUP, obtain a second analysis result, and terminate related tasks according to the second analysis result.
7. The multi-process service instance deployment device according to claim 6, characterized in that: The termination module comprises: The first acquisition unit is used to obtain the private CGROUP memory water level threshold; A third analysis unit is configured to analyze the memory water level of the first CGROUP. If the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP, the processes in the first CGROUP are moved sequentially to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP. The fourth analysis unit is configured to analyze the memory water level of the second CGROUP, obtain a second analysis result, and terminate related tasks according to the second analysis result.
8. The multi-process service instance deployment device according to claim 6, characterized in that: The termination module comprises: The second acquisition unit is used to obtain the private CGROUP memory water level threshold and the public CGROUP memory water level threshold; a fifth analyzing unit configured to analyze the memory water level of the first CGROUP, and if the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP, move the processes in the first CGROUP to the public CGROUP in order of memory usage to obtain a second CGROUP, until the memory water level of the first CGROUP is less than the memory water level threshold of the private CGROUP; The sixth analysis unit is used to analyze the memory water level of the second CGROUP. If the memory water level of the second CGROUP is greater than the public CGROUP memory water level threshold, it triggers the sending of a termination signal to the process with the largest memory usage in the second CGROUP. The termination signal is used to trigger the process with the largest memory usage in the second CGROUP to terminate the task corresponding to the process with the largest memory usage in the second CGROUP.
9. The multi-process service instance deployment device according to claim 6, characterized in that: The device further comprises: The second acquisition module is used to obtain the private CGROUP memory water level threshold; An analysis module is configured to analyze a memory water level of the first CGROUP. If the memory water level of the first CGROUP is less than a memory water level threshold of the private CGROUP, the process in the public CGROUP is moved to the first CGROUP until the memory water level of the first CGROUP is greater than or equal to the memory water level threshold of the private CGROUP.
10. The multi-process service instance deployment device according to claim 6, characterized in that: The device further comprises: A generating module, configured to generate error information based on the terminated task, and display the error information on a display interface; A third acquisition module is used to acquire input information, wherein the input information includes operation information for analyzing the error information; The response module is used to respond to the input information, display the analysis result of the error information on the display interface, and send the analysis result of the error information to relevant staff to prompt the relevant staff to find the reason for the termination of the task.
11. Multi-process service instance deployment device, characterized in that, include: Memory for storing computer programs; A processor, configured to implement the steps of the multi-process service instance deployment method according to any one of claims 1 to 5 when executing the computer program.
12. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the multi-process service instance deployment method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Memory management method and computing device
CN109857561A