Server memory dynamic monitoring method, device, equipment and storage medium
By analyzing the overall change trend and sudden increase of server memory usage, and judging the sudden increase of memory usage, the problem of low monitoring accuracy in the existing technology is solved, and the accuracy and timeliness of dynamic monitoring of server memory is improved.
Patent Information
- Application Number
- CN202110854823.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-28
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-07-28
AI Technical Summary
The existing server memory monitoring methods are not accurate, and cannot adapt to the monitoring needs of server clusters in scale, and cannot effectively judge memory usage sudden increase and abnormal phenomena.
By obtaining the overall change trend of the memory usage of the target server and the number of memory usage sub-intervals in the second period, we can judge whether there is a sudden increase in memory usage, and determine the memory monitoring results based on the overall change trend and sudden increase, reducing the calculation volume , improve monitoring accuracy and timeliness.
It improves the accuracy of server memory monitoring, and only judges that the memory usage rate suddenly increases when the overall change trend is on the rise, reducing the amount of computing and enhancing the timeliness of monitoring.
Smart Images

Figure CN113505042B_ABST
Abstract
Description
Technical Field
[0001] The present specification relates to server memory monitoring technology in the financial field or other fields, and in particular to a server memory dynamic monitoring method, device, equipment and storage medium. Background Art
[0002] In recent years, the scale of server clusters has shown explosive growth; at the same time, the usage of performance indicators such as server memory has also become a critical concern. At present, the existing server memory monitoring method is to compare the memory usage of each server with the set threshold; among them, the memory usage threshold can be different for different application servers. However, considering the characteristics of memory data, occasional high memory usage, or memory usage that has been stable and high may not be an abnormal phenomenon. Therefore, the monitoring accuracy of the existing server memory monitoring solution is not high; it cannot adapt to the monitoring needs under the scale of server clusters and needs to be improved urgently. Summary of the invention
[0003] The purpose of the embodiments of this specification is to provide a server memory dynamic monitoring method, device, equipment and storage medium to improve the accuracy of server cluster memory monitoring.
[0004] To achieve the above objectives, on the one hand, an embodiment of this specification provides a method for dynamically monitoring server memory, including:
[0005] Obtaining an overall change trend of the memory usage of the target server in the first period, and obtaining the number of memory usage sub-intervals covered by the memory usage of the target server in the second period;
[0006] When the overall change trend of the memory usage rate is an upward trend, or the number of sub-intervals of the memory usage rate reaches the sharding threshold, determining whether there is a sudden increase in the memory usage rate of the target server during the second time period;
[0007] When the target server experiences a sudden increase in memory usage during the second time period, the memory monitoring result of the target server is determined according to the overall change trend of the memory usage and the memory usage during the second time period.
[0008] In the embodiment of this specification, obtaining the overall change trend of the memory usage of the target server in the first period includes:
[0009] Obtaining the memory usage of the target server during the first period of time;
[0010] The memory usage rate in the first time period is input into a preset trend detection algorithm to obtain an overall change trend of the memory usage rate of the target server in the first time period.
[0011] In the embodiment of this specification, obtaining the number of memory usage sub-intervals covered by the memory usage of the target server in the second time period includes:
[0012] Obtaining the memory usage of the target server during the second period;
[0013] Determining the coverage of the memory usage rate during the second time period;
[0014] The number of memory usage sub-intervals covered by the coverage range in the memory usage sub-interval set is determined.
[0015] In the embodiment of this specification, the determining whether the target server has a sudden increase in memory usage during the second period includes:
[0016] Determine a sliding window difference sequence of the memory usage of the target server during the second time period;
[0017] Generate multiple sliding window subsequences according to the sliding window difference sequence;
[0018] Determine the sum of sliding window differences in each sliding window subsequence;
[0019] When at least one sliding window subsequence among the multiple sliding window subsequences meets a preset condition, confirming that a sudden increase in memory usage of the target server occurs during the second time period;
[0020] The preset conditions include:
[0021] The sliding window difference at the last position in the sliding window subsequence is greater than the first threshold, and the sum of the sliding window differences in the sliding window subsequence is greater than the second threshold.
[0022] In the embodiment of this specification, determining the memory monitoring result of the target server according to the overall change trend of the memory usage rate and the memory usage rate in the second time period includes:
[0023] Determining the slope of the overall change trend of the memory usage;
[0024] Determine a first mean of sliding window differences in the sliding window difference sequence corresponding to the second time period, and determine a second mean of sliding window differences in the sliding window difference sequence corresponding to the specified second time period;
[0025] When the slope is greater than the slope threshold, and the first mean value is greater than the second mean value, it is confirmed that an abnormality exists in the memory of the target server.
[0026] In the embodiment of this specification, determining the memory monitoring result of the target server according to the overall change trend of the memory usage rate and the memory usage rate in the second time period includes:
[0027] Determining the slope of the overall change trend of the memory usage;
[0028] Determine a first standard deviation of the sliding window difference values in the sliding window difference value sequence corresponding to the second time period, and determine a second standard deviation of the sliding window difference values in the sliding window difference value sequence corresponding to the specified second time period;
[0029] When the slope is greater than the slope threshold and the first standard deviation is greater than the second standard deviation, it is confirmed that an abnormality exists in the memory of the target server.
[0030] In the embodiment of this specification, determining the slope of the overall change trend of the memory usage rate includes:
[0031] Using the least square method to fit the memory usage change curve in the first time period;
[0032] The slopes of the starting and ending points of the change curve are determined as the slope of the overall change trend of the memory usage rate.
[0033] In the embodiment of this specification, the first period includes the last two weeks.
[0034] In the embodiment of this specification, the second period includes the last three hours.
[0035] In the embodiment of this specification, the designated second time period includes the latest three hours of the previous week.
[0036] On the other hand, the embodiment of this specification also provides a server memory dynamic monitoring device, including:
[0037] An acquisition module, used to acquire the overall change trend of the memory usage of the target server in the first time period, and acquire the number of memory usage sub-intervals covered by the memory usage of the target server in the second time period;
[0038] A judgment module, configured to judge whether there is a sudden increase in memory usage of the target server during the second time period when the overall change trend of the memory usage is an upward trend or the number of sub-intervals of the memory usage reaches a sharding threshold;
[0039] A determination module is used to determine the memory monitoring result of the target server according to the overall change trend of the memory usage and the memory usage in the second time period when the memory usage of the target server suddenly increases in the second time period.
[0040] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions of the above method are executed.
[0041] On the other hand, an embodiment of the present specification further provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer device, the instructions of the above method are executed.
[0042] It can be seen from the technical solutions provided by the above embodiments of this specification that in the embodiments of this specification, the overall change trend of the server's memory usage can be obtained, and when the overall change trend is on an upward trend, it is determined whether the server has a sudden increase in memory usage, and then the server's memory monitoring results are determined based on the overall change trend of memory usage and the sudden increase in memory usage; because the overall change trend and sudden increase in memory usage are taken into consideration, the server memory dynamic monitoring method in the embodiments of this specification is more accurate compared to the method of directly judging the server memory status based on the threshold in traditional technology. Not only that, the embodiments of this specification only determine whether the server has a sudden increase in memory usage when the overall change trend is on an upward trend. In this way, the amount of calculation can be greatly reduced, thereby improving the timeliness of dynamic monitoring of server memory. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0044] Figure 1 A schematic diagram of a server memory dynamic monitoring system in some embodiments of this specification is shown;
[0045] Figure 2 A flowchart of a method for dynamically monitoring server memory in some embodiments of this specification is shown;
[0046] Figure 3 A schematic diagram of dividing memory usage into sub-intervals in some embodiments of this specification is shown;
[0047] Figure 4 A schematic diagram showing the number of memory usage sub-intervals covered by the memory usage in some embodiments of this specification;
[0048] Figure 5A schematic diagram showing the calculation of self-growth and cumulative growth in some embodiments of the present specification;
[0049] Figure 6 A structural block diagram of a server memory dynamic monitoring device in some embodiments of this specification is shown;
[0050] Figure 7 The structure block diagram of the computer device in some embodiments of the present specification is shown.
[0051] [Description of Reference Numerals]
[0052] 10. Data source;
[0053] 20. Server memory dynamic monitoring device;
[0054] 30.Configure source;
[0055] 40. Alarm display terminal;
[0056] 61. Get module;
[0057] 62. Judgment module;
[0058] 63. Determine the module;
[0059] 702. Computer equipment;
[0060] 704, processor;
[0061] 706. Memory;
[0062] 708, driving mechanism;
[0063] 710, input / output interface;
[0064] 712. Input devices;
[0065] 714. Output devices;
[0066] 716. Presentation equipment;
[0067] 718. Graphical user interface;
[0068] 720, network interface;
[0069] 722. Communication link;
[0070] 724. Communication bus. DETAILED DESCRIPTION
[0071] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0072] Figure 1 A schematic diagram of the structure of a server memory dynamic monitoring system in some embodiments is shown. The server memory dynamic monitoring system is used to dynamically monitor the memory status of a server cluster. Among them, the server cluster can be an application serverless cluster (such as a bank data center server cluster, etc.). The server memory dynamic monitoring system may include a data source 10, a server memory dynamic monitoring device 20, a configuration source 30 and an alarm display terminal 40. The server memory dynamic monitoring device 20 can obtain the memory usage data of the server cluster from multiple data sources 10, and process the memory usage data according to a preset processing logic, so as to obtain the memory monitoring result of the server cluster, and can send memory alarm information to the alarm display terminal 40 when there is an abnormality in the memory of one or some servers, so as to facilitate display to relevant personnel through the alarm display terminal 40. Among them, based on the configuration source 30, abnormal monitoring of a specified application, a specified node or a specified server in the server cluster can be achieved.
[0073] In some embodiments, the data source 10 may include, for example, an operating system power management system (OSPM), a server resource monitoring tool (e.g., NMON (Nigel's Monitor)), etc. The configuration source 30 may include, for example, a configuration management database (CMDB), etc. The alarm display terminal 40 may include, for example, a user terminal device or a server monitoring system, etc. The user terminal device may include, but is not limited to, a display, a desktop computer, a mobile terminal (i.e., a smart phone), a tablet computer, and / or a laptop computer, etc.
[0074] The embodiment of this specification provides a method for dynamically monitoring server memory, which can be applied to the above-mentioned server memory dynamic monitoring device. Figure 2 As shown, in some embodiments, the server memory dynamic monitoring method may include the following steps:
[0075] S201. Obtain an overall change trend of the memory usage of a target server in a first period of time, and obtain the number of memory usage sub-intervals covered by the memory usage of the target server in a second period of time.
[0076] S202: When the overall change trend of the memory usage is an upward trend, or the number of sub-intervals of the memory usage reaches the sharding threshold, determine whether there is a sudden increase in the memory usage of the target server during the second time period;
[0077] S203: When the memory usage of the target server suddenly increases during the second time period, determine the memory monitoring result of the target server according to the overall change trend of the memory usage and the memory usage during the second time period.
[0078] In the embodiment of this specification, the overall change trend of the server's memory usage can be obtained, and when the overall change trend is on an upward trend, it is determined whether the server has a sudden increase in memory usage, and then the server's memory monitoring results are determined based on the overall change trend of memory usage and the sudden increase in memory usage; because the overall change trend and sudden increase in memory usage are taken into consideration, the server memory dynamic monitoring method of the embodiment of this specification is more accurate compared to the method of directly judging the server memory status based on the threshold in traditional technology. Not only that, the embodiment of this specification only determines whether the server has a sudden increase in memory usage when the overall change trend is on an upward trend. In this way, the amount of calculation can be greatly reduced, thereby improving the timeliness of the server memory dynamic monitoring.
[0079] The target server refers to any server in the server cluster that is included in the memory monitoring range. In the embodiment of this specification, the first time period is a relatively long recent time period, so as to globally and holistically understand the overall change trend of the target server in the relatively long recent time period. For example, in some embodiments, the first time period can be the last two weeks (i.e., the last 14 days), that is, the memory usage of the target server in the last two weeks can be obtained. The second time period is a relatively short recent time period, so as to locally understand the local change trend of the target server in the relatively short recent time period. For example, in some embodiments, the second time period can be the last three hours, that is, the memory usage of the target server in the last three hours can be obtained. It can be understood by those skilled in the art that the above two weeks and three hours are only exemplary descriptions. In other embodiments of this specification, the specific duration of the first time period and the second time period can be appropriately set as needed, and this specification does not make a unique limitation on this. However, no matter how you choose, in general, the duration of the first time period should be much greater than the duration of the second time period.
[0080] In some embodiments, obtaining the overall change trend of the memory usage of the target server in the first period may include the following steps:
[0081] (1) Obtaining the memory usage of the target server during the first time period.
[0082] Since the first period is a relatively long and recent period, its sampling and processing frequency can be appropriately reduced to reduce computer resource consumption. For example, taking the first period as the last two weeks as an example, the memory usage of the target server in the last two weeks can be collected once a day; in this way, the overall change trend of the memory usage of the target server in the last two weeks can be calculated only once a day. Similarly, collecting and calculating once a day here is only an exemplary description. In other embodiments of this specification, the collection and calculation frequency can be appropriately set as needed, and this specification does not make a sole limitation on this.
[0083] In some embodiments, the overall change trend of the memory usage of the target server in the first time period can be obtained from multiple data sources, which can avoid the limitations of a single data source and facilitate obtaining higher quality memory usage data.
[0084] (2) Inputting the memory usage rate in the first time period into a preset trend detection algorithm to obtain an overall change trend of the memory usage rate of the target server in the first time period.
[0085] In some embodiments, the memory usage rate in the first time period is input into the Mann-Kendall trend test algorithm, so that the overall change trend of the memory usage rate of the target server in the first time period can be obtained. Among them, the Mann-Kendall trend test algorithm is a non-parametric test method (non-parametric test method is also called distribution-free test), which has the advantages of not requiring samples to follow a certain distribution, not being disturbed by a few outliers, being more suitable for type variables and ordinal variables, and being relatively simple to calculate. In other embodiments, the discrete data of the memory usage rate of the target server in the first time period can also be fitted into a memory usage rate change curve by curve fitting, so that the overall change trend of the memory usage rate of the target server in the first time period can also be obtained. Among them, curve fitting can include, for example, but is not limited to least squares fitting algorithms. In this way, for all servers in the server cluster that are included in the monitoring range, a memory usage rate change curve of each server in the first time period can be obtained by the above method.
[0086] In the embodiments of this specification, in order to more intuitively express the change of the memory usage rate of the target server in the second time period, the memory usage rate interval (i.e., 0-100%) can be pre-divided into multiple sub-intervals (or interval segments). The more sub-intervals covered by the memory usage rate of the target server in the second time period, the greater the fluctuation of the memory usage rate of the target server in the second time period; otherwise, the smaller the fluctuation. For example, Figure 3 In the exemplary embodiment shown, the memory usage rate can be divided into 20 sub-intervals, and the 20 sub-intervals can form a memory usage rate sub-interval set, and adjacent sub-intervals differ by 5 percentage points, such as [0%, 5%], [6%, 10%], [11%-15%], ..., [91%-95%], [95%-100%]. Among them, Figure 3 The numbers in the column represent the memory usage percentage; for example, 20 represents 20% and 50 represents 50%.
[0087] In some embodiments, obtaining the number of memory usage sub-intervals covered by the memory usage of the target server in the second time period may include the following steps:
[0088] (1) Obtaining the memory usage of the target server during the second time period.
[0089] In order to improve the timeliness of memory status monitoring, the sampling frequency of obtaining the memory usage of the target server in the second period can be relatively high. For example, in one embodiment, the memory usage of the target server in the second period can be collected every several minutes.
[0090] (2) Determine the coverage of the memory usage during the second time period.
[0091] In the embodiments of this specification, the memory usage of the target server collected in the second period is a number of discrete values, and the minimum and maximum values can be determined by sorting these discrete values; the interval formed by the minimum and maximum values as the interval endpoints is the coverage of the memory usage of the target server in the second period. For example, in an exemplary embodiment, the maximum value of the memory usage of the target server collected in the second period is 59%, and the minimum value is 20%. For this sampling, [20%, 59%] is the coverage of the memory usage of the target server in the second period.
[0092] (3) Determine the number of memory usage sub-intervals covered by the coverage range in the memory usage sub-interval set.
[0093] Since the entire memory usage interval (i.e., 0-100%) is pre-divided into multiple sub-intervals, the endpoint value of each sub-interval is determined; based on determining the coverage range of the memory usage in the second time period, the number of memory usage sub-intervals covered by the coverage range in the memory usage sub-interval set can be calculated. Figure 4 In the exemplary embodiment shown, the memory usage can be divided into 20 sub-intervals; the coverage range of the collected memory usage of the target server in the second period is 18% to 37%; through calculation, it can be obtained that the 18% to 37% coverage range covers [15%, 20%], [21%, 25%], [26%, 30%], [31%, 35%] and [35%, 40%], a total of 5 memory usage sub-intervals. Therefore, it can be determined that the number of memory usage sub-intervals covered by the 18% to 37% coverage range in the memory usage sub-interval set is 5.
[0094] When the overall change trend of the server's memory usage is downward or stable, a short-term small fluctuation in memory usage generally does not have a substantial impact on the server; and considering that the amount of calculation required to determine whether the target server has a sudden increase in memory usage in the second period is large; therefore, when the overall change trend of the memory usage is upward, or the number of memory usage sub-intervals reaches the sharding threshold, it is determined whether the target server has a sudden increase in memory usage in the second period. In this way, for servers whose overall change trend of memory usage is downward or stable, and for servers whose number of memory usage sub-intervals does not reach the sharding threshold, there is no need to participate in this memory usage sudden increase judgment, thereby achieving a significant reduction in calculation without reducing the accuracy of memory monitoring, thereby taking into account the timeliness of server memory monitoring. It should be noted that the above-mentioned stable trend does not only include overall or roughly horizontally distributed memory usage curves, but also includes curves whose amplitude does not exceed a certain value and are periodic (or roughly periodic) (for example, similar to a sine curve, etc.).
[0095] In some embodiments, determining whether there is a sudden increase in memory usage of the target server within the second period may include the following steps:
[0096] (1) Determine a sliding window difference sequence of the memory usage of the target server during the second time period.
[0097] In some embodiments, the memory usage of the target server in the second period can be a time series of multiple discrete data points arranged in sampling time order. A sliding window of a specified size can be preset, and a discrete data point can be used as a sliding step, and then the difference in memory usage at both ends of the sliding window can be calculated; accordingly, a sliding window difference sequence of the memory usage of the target server in the second period can be obtained.
[0098] For example, taking the second period as the last three hours, assuming that the sampling frequency of memory usage is once every 5 minutes (i.e., 12 times per hour), a total of 36 memory usages of the target server can be obtained in the last three hours (e.g. Figure 5 Using 12 discrete data points as the sliding window size and one discrete data point as the sliding step, by calculating these memory usage rates through sliding windows, we can get 25 natural growth increments (for example Figure 5 Specifically, the first natural growth increment Selfgrow1 can be calculated according to the formula Selfgrow1=mem12-mem1; the second natural growth increment Selfgrow2 can be calculated according to the formula Selfgrow2=mem13-mem2; the third natural growth increment Selfgrow3 can be calculated according to the formula Selfgrow3=mem14-mem3; recursively, the 25th natural growth increment Selfgrow25 can be calculated according to the formula Selfgrow25=mem36-mem25.
[0099] Arranging the 25 natural growth increments Selfgrow1 to Selfgrow25 in sequence can only obtain one sliding window difference sequence, that is, the sliding window difference sequence of the memory usage of the target server in the second time period.
[0100] (2) Generate multiple sliding window subsequences according to the sliding window difference sequence.
[0101] In some embodiments, for the sliding window difference sequence obtained in the previous step, a sliding window of a specified size can also be preset, and a natural growth increment can be used as the sliding step size, and then the natural growth increment within the sliding window can be selected by sliding, so as to obtain multiple sliding window subsequences.
[0102] Please continue to see Figure 5 As shown, in an exemplary embodiment, for 25 natural growth increments Selfgrow1 to Selfgrow25, if 12 natural growth increments are used as the sliding window size and one natural growth increment is used as the sliding step, then by sliding and selecting the natural growth increments within the sliding window, 14 sliding window subsequences as shown below can be obtained.
[0103] {Selfgrow1,Selfgrow2,Selfgrow3,Selfgrow4,Selfgrow5,Selfgrow6,Selfgrow7,Selfgrow8,Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12};
[0104] {Selfgrow2,Selfgrow3,Selfgrow4,Selfgrow5,Selfgrow6,Selfgrow7,Selfgrow8,Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13};
[0105] {Selfgrow3,Selfgrow4,Selfgrow5,Selfgrow6,Selfgrow7,Selfgrow8,Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14};
[0106] {Selfgrow4,Selfgrow5,Selfgrow6,Selfgrow7,Selfgrow8,Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15};
[0107] {Selfgrow5,Selfgrow6,Selfgrow7,Selfgrow8,Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15,Selfgrow16};
[0108] {Selfgrow6,Selfgrow7,Selfgrow8,Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15,Selfgrow16,Selfgrow17};
[0109] {Selfgrow7,Selfgrow8,Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15,Selfgrow16,Selfgrow17,Selfgrow18};
[0110] {Selfgrow8,Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15,Selfgrow16,Selfgrow17,Selfgrow18,Selfgrow19};
[0111] {Selfgrow9,Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15,Selfgrow16,Selfgrow17,Selfgrow18,Selfgrow19,Selfgrow20};
[0112] {Selfgrow10,Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15,Selfgrow16,Selfgrow17,Selfgrow18,Selfgrow19,Selfgrow20,Selfgrow21};
[0113] {Selfgrow11,Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15,Selfgrow16,Selfgrow17,Selfgrow18,Selfgrow19,Selfgrow20,Selfgrow21,Selfgrow22};
[0114] {Selfgrow12,Selfgrow13,Selfgrow14,Selfgrow15,Selfgrow16,Selfgrow17,Selfgrow18,Selfgrow19,Selfgrow20,Selfgrow21,Selfgrow22,Selfgrow23};
[0115] {Selfgrow13, Selfgrow14, Selfgrow15, Selfgrow16, Selfgrow17, Selfgrow18, Selfgrow19, Selfgrow20, Selfgrow21, Selfgrow22, Selfgrow23, Selfgrow24};
[0116] {Selfgrow14, Selfgrow15, Selfgrow16, Selfgrow17, Selfgrow18, Selfgrow19, Selfgrow20, Selfgrow21, Selfgrow22, Selfgrow23, Selfgrow24, Selfgrow25};
[0117] (3) Determine the sum of the sliding window differences within each of the sliding window subsequences.
[0118] In the embodiment of this specification, the sliding window difference is the natural growth increment. For each sliding window subsequence, the sum of the natural growth increments therein (ie, the sum value) can be calculated.
[0119] For example, taking the above sliding window subsequence {Selfgrow1, Selfgrow2, Selfgrow3, Selfgrow4, Selfgrow5, Selfgrow6, Selfgrow7, Selfgrow8, Selfgrow9, Selfgrow10, Selfgrow11, Selfgrow12} as an example, the sum of the sliding window differences in the sliding window subsequence Sumgrow1 can be calculated by the formula Sumgrow1=Selfgrow1+Selfgrow2+…+Selfgrow12. The sum of the sliding window differences in each sliding window subsequence can be used as a cumulative growth increment (for example Figure 5 The number of memory usage sub-intervals covered by the target server's memory usage in the second period can qualitatively indicate the fluctuation of the target server in the second period, but cannot quantitatively reflect the magnitude of such short-term fluctuations. The above-mentioned cumulative growth increment can quantitatively reflect the increase in the short-term change of the target server's memory usage.
[0120] (4) When at least one sliding window subsequence among the multiple sliding window subsequences meets a preset condition, confirming that a sudden increase in memory usage of the target server occurs during the second time period.
[0121] In some embodiments, the preset conditions may include: the sliding window difference at the end of the sliding window subsequence is greater than a first threshold, and the sum of the sliding window differences in the sliding window subsequence is greater than a second threshold. The sliding window difference at the end of the sliding window subsequence is the last natural growth increment in the sliding window subsequence. For example, taking the above-mentioned sliding window subsequence {Selfgrow1, Selfgrow2, Selfgrow3, Selfgrow4, Selfgrow5, Selfgrow6, Selfgrow7, Selfgrow8, Selfgrow9, Selfgrow10, Selfgrow11, Selfgrow12} as an example, "Selfgrow12" is the sliding window difference at the end of the sliding window subsequence. The first threshold value may be a constant; the second threshold value may be a constant. a and b can be determined according to the characteristics of the server; m is the sliding window size, that is, the number of single sliding window subsequences. For example, when a sliding window subsequence has 12 natural growth increments, m=12.
[0122] Based on the above preset conditions, it is possible to not only identify whether the short-term change trend of the target server's memory usage is increasing or decreasing, but also to identify the magnitude of the increase in the short-term change trend, and thereby determine whether there is a sudden increase in the target server's memory usage within a short period of time, thereby facilitating accurate identification of whether there is a sudden increase in the target server's memory usage within a short period of time. Therefore, when at least one sliding window subsequence among the multiple sliding window subsequences satisfies the above preset conditions, it can be confirmed that the target server has a sudden increase in memory usage within the second period of time.
[0123] In some embodiments, determining the memory monitoring result of the target server according to the overall change trend of the memory usage rate and the memory usage rate in the second time period may include the following steps:
[0124] (1) Determine the slope of the overall change trend of the memory usage rate.
[0125] In some embodiments, the least squares method can be used to fit the change curve of the memory usage rate within the first time period; then the slope of the starting and ending points of the change curve (i.e., the slope between the starting point and the ending point within the first time period) is calculated and used as the slope of the overall change trend of the memory usage rate.
[0126] (2) Determine a first mean of sliding window differences in the sliding window difference sequence corresponding to the second time period, and determine a second mean of sliding window differences in the sliding window difference sequence corresponding to the specified second time period.
[0127] (3) When the slope is greater than the slope threshold and the first mean is greater than the second mean, it is confirmed that there is an abnormality in the memory of the target server (i.e., the memory usage is abnormal); otherwise, it can be confirmed that the memory of the target server is normal (i.e., the memory usage is normal).
[0128] In other embodiments, determining the memory monitoring result of the target server according to the overall change trend of the memory usage rate and the memory usage rate in the second time period may also include the following steps:
[0129] (1) Determine the slope of the overall change trend of the memory usage rate.
[0130] (2) Determine a first standard deviation of the sliding window difference in the sliding window difference sequence corresponding to the second time period, and determine a second standard deviation of the sliding window difference in the sliding window difference sequence corresponding to the specified second time period.
[0131] (3) When the slope is greater than the slope threshold and the first standard deviation is greater than the second standard deviation, it is confirmed that there is an abnormality in the memory of the target server (i.e., the memory usage is abnormal); otherwise, it can be confirmed that the memory of the target server is normal (i.e., the memory usage is normal).
[0132] In the embodiments of this specification, the above-mentioned designated second time period may refer to the corresponding statistical period, which can be set appropriately as needed. For example, in an exemplary embodiment, take the first time period as the last two weeks and the second time period as the last three hours; then the designated second time period may be the last three hours of last week (i.e. the last three hours a week ago). If the current time is 12:00 on July 23, 2021, the second time period is 9:00-12:00 on July 23, 2021, then the designated second time period is 9:00-12:00 on July 16, 2021.
[0133] Given that memory usage data has periodic characteristics in many scenarios (the server grows rapidly during periodic business peaks and then automatically recovers and decreases), the embodiments of this specification implement filtering of periodic growth from two aspects:
[0134] 1) Long-term slow growth, that is, the slope of the overall trend of memory usage in the first period; taking the first period of two weeks as an example, when the overall trend of memory usage in the first period is an upward trend, even if there are periodic fluctuations, it is necessary to pay attention to whether the recovery is complete; complete recovery here means: whether each periodic recovery can drop to the previous memory usage baseline, that is, there is no memory growth before and after the increase and decrease of memory usage, in other words, the cumulative growth within the period is 0 (or less than the setting).
[0135] 2) In terms of short-term surges, the business cycles of the current applications are mostly hourly, daily, and weekly. Taking the first period as the last two weeks, the second period as the last three hours, and specifying the second period as the last three hours of last week as an example, comparing the statistical indicators of the two time periods of "current three hours" and "corresponding three hours of the previous week" can filter out most of the periodic fluctuations. For example, if the current time period is in a surge state, but the growth rate is generally similar or relatively small compared to the previous time period, the memory usage rate can be considered normal.
[0136] In some embodiments, when it is confirmed that the memory of the target server is abnormal, a memory abnormality alarm message can be sent to an alarm display terminal (such as a user terminal, a monitoring system, etc.) in a timely manner to remind relevant personnel to pay attention or handle it. The sending of the memory abnormality alarm message to the alarm display terminal can be achieved by email notification, short message notification, or event notification.
[0137] For example, taking email notification as an example, by sending warning emails to the Notes mailbox system, the server with memory abnormality can be notified in the form of "warning type (such as memory abnormality, load balancing abnormality, etc.) → application → cluster → IP → two-week memory data change chart" to notify the relevant operation and maintenance personnel and operating system related personnel to troubleshoot and handle abnormal problems. For another example, taking event notification as an example, the memory abnormality alarm information can be sent to the alarm event list of the monitoring system to notify the operation and maintenance duty post to handle the relevant memory alarm.
[0138] In other embodiments, when sending memory abnormality alarm information to the alarm display terminal, the sending frequency can be appropriately controlled according to the degree of memory abnormality, so as to achieve the purpose of effectively notifying relevant personnel of the memory abnormality alarm information without disturbing the relevant personnel too much. For example, in an exemplary embodiment, the memory monitoring is a full inspection once an hour, and the number of emails sent by the server within 12 hours can be calculated. For the memory abnormality alarm information obtained from each inspection, the number of alarm emails that sent the same memory abnormality alarm information within the above 12 hours can be recorded in the database. For abnormal servers that are suspected of memory abnormalities but whose overall memory usage does not exceed 80% and whose growth is not prominent, only one alarm email can be sent within 12 hours to remind relevant personnel to analyze and process. Among them, the same memory abnormality alarm information refers to: memory abnormality alarms of the same nature for the same server.
[0139] Although the process flows described above include multiple operations that occur in a particular order, it should be clearly understood that the processes may include more or fewer operations, which may be performed sequentially or in parallel (eg, using parallel processors or a multi-threaded environment).
[0140] Corresponding to the memory usage rate method in the second time period described above, the embodiment of this specification also provides a server memory dynamic monitoring device, referring to Figure 6 As shown, in some embodiments, the server memory dynamic monitoring device may include:
[0141] The acquisition module 61 may be used to acquire the overall change trend of the memory usage of the target server in the first period, and acquire the number of memory usage sub-intervals covered by the memory usage of the target server in the second period;
[0142] The judgment module 62 may be used to judge whether there is a sudden increase in memory usage of the target server during the second time period when the overall change trend of the memory usage is an upward trend or the number of sub-intervals of the memory usage reaches the sharding threshold;
[0143] The determination module 63 may be configured to determine the memory monitoring result of the target server according to the overall change trend of the memory usage and the memory usage in the second time period when the memory usage of the target server increases suddenly in the second time period.
[0144] In some device embodiments, obtaining the overall change trend of the memory usage of the target server in the first period may include:
[0145] Obtaining the memory usage of the target server during the first period of time;
[0146] The memory usage rate in the first time period is input into a preset trend detection algorithm to obtain an overall change trend of the memory usage rate of the target server in the first time period.
[0147] In some device embodiments, obtaining the number of memory usage sub-intervals covered by the memory usage of the target server in the second time period may include:
[0148] Obtaining the memory usage of the target server during the second time period;
[0149] Determining the coverage of the memory usage rate during the second time period;
[0150] The number of memory usage sub-intervals covered by the coverage range in the memory usage sub-interval set is determined.
[0151] In some device embodiments, determining whether a memory usage of the target server increases suddenly during the second period may include:
[0152] Determine a sliding window difference sequence of the memory usage of the target server during the second time period;
[0153] Generate multiple sliding window subsequences according to the sliding window difference sequence;
[0154] Determine the sum of sliding window differences in each sliding window subsequence;
[0155] When at least one sliding window subsequence among the multiple sliding window subsequences meets a preset condition, confirming that a sudden increase in memory usage of the target server occurs during the second time period;
[0156] The preset conditions include:
[0157] The sliding window difference at the last position in the sliding window subsequence is greater than the first threshold, and the sum of the sliding window differences in the sliding window subsequence is greater than the second threshold.
[0158] In some device embodiments, determining the memory monitoring result of the target server according to the overall change trend of the memory usage rate and the memory usage rate in the second time period includes:
[0159] Determining the slope of the overall change trend of the memory usage;
[0160] Determine a first mean of sliding window differences in the sliding window difference sequence corresponding to the second time period, and determine a second mean of sliding window differences in the sliding window difference sequence corresponding to the specified second time period;
[0161] When the slope is greater than the slope threshold, and the first mean value is greater than the second mean value, it is confirmed that an abnormality exists in the memory of the target server.
[0162] In some device embodiments, determining the memory monitoring result of the target server according to the overall change trend of the memory usage rate and the memory usage rate in the second time period may include:
[0163] Determining the slope of the overall change trend of the memory usage;
[0164] Determine a first standard deviation of the sliding window difference values in the sliding window difference value sequence corresponding to the second time period, and determine a second standard deviation of the sliding window difference values in the sliding window difference value sequence corresponding to the specified second time period;
[0165] When the slope is greater than the slope threshold and the first standard deviation is greater than the second standard deviation, it is confirmed that an abnormality exists in the memory of the target server.
[0166] In some device embodiments, determining the slope of the overall change trend of the memory usage rate includes:
[0167] Using the least square method to fit the memory usage change curve in the first time period;
[0168] The slopes of the starting and ending points of the change curve are determined as the slope of the overall change trend of the memory usage rate.
[0169] In some device embodiments, the first period includes the last two weeks.
[0170] In some device embodiments, the second period includes the last three hours.
[0171] In some device embodiments, the designated second time period includes the last three hours of the last week.
[0172] In other embodiments, the above-mentioned server memory dynamic monitoring method and device can also use the monitoring results for memory performance analysis of the server cluster. For example, taking performance analysis as an example, the monitoring results can be sent to the performance analysis platform to visualize memory performance (such as warning records and processing records of memory anomalies, real-time memory data, memory development trends, etc.).
[0173] In other embodiments, the above-mentioned server memory dynamic monitoring method and device can also use the monitoring results to evaluate the load balancing of the server cluster; that is, by evaluating the memory status of each server in the same cluster, it can actively estimate whether the cluster has load balancing abnormalities. If an abnormal cluster is found, professional maintenance personnel can be notified in time to troubleshoot the problem.
[0174] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0175] The embodiments of this specification also provide a computer device. Figure 7As shown, in some embodiments of the present specification, the computer device 702 may include one or more processors 704, such as one or more central processing units (CPUs) or graphics processing units (GPUs), and each processing unit may implement one or more hardware threads. The computer device 702 may also include any memory 706, which is used to store any kind of information such as code, settings, data, etc. In a specific embodiment, the computer program on the memory 706 and can be run on the processor 704, when the computer program is run by the processor 704, can execute the instructions of the memory usage method in the second time period described in any of the above embodiments. Non-limiting, for example, the memory 706 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Further, any memory can provide volatile or non-volatile retention of information. Further, any memory can represent a fixed or removable component of the computer device 702. In one case, when the processor 704 executes an associated instruction stored in any memory or a combination of memories, the computer device 702 can perform any operation of the associated instruction. The computer device 702 also includes one or more drive mechanisms 708 for interacting with any storage, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0176] The computer device 702 may also include an input / output interface 710 (I / O) for receiving various inputs (via input device 712) and for providing various outputs (via output device 714). A specific output mechanism may include a presentation device 716 and an associated graphical user interface 718 (GUI). In other embodiments, the input / output interface 710 (I / O), input device 712, and output device 714 may not be included, and the computer device 702 may be used as a computer device in a network. The computer device 702 may also include one or more network interfaces 720 for exchanging data with other devices via one or more communication links 722. One or more communication buses 724 couple the components described above together.
[0177] The communication link 722 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 722 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc. governed by any protocol or combination of protocols.
[0178] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products of some embodiments of the present specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processor to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processor generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0179] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processor to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0180] These computer program instructions can also be loaded onto a computer or other programmable data processor so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0181] In a typical configuration, a computer device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0182] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0183] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computer device. As defined in this specification, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0184] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0185] The present specification embodiments may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present specification embodiments may also be practiced in distributed computing environments where tasks are performed by remote processors connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0186] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0187] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, in the absence of contradiction, a person skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0188] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A method for dynamically monitoring server memory, characterized in that: include: Obtaining an overall change trend of the memory usage of the target server in the first period, and obtaining the number of memory usage sub-intervals covered by the memory usage of the target server in the second period; When the overall change trend of the memory usage rate is an upward trend, or the number of sub-intervals of the memory usage rate reaches the sharding threshold, determining whether there is a sudden increase in the memory usage rate of the target server during the second time period; When the target server has a sudden increase in memory usage during the second time period, determining a memory monitoring result of the target server according to the overall change trend of the memory usage and the memory usage during the second time period; The determining whether the target server has a sudden increase in memory usage during the second period includes: Determine a sliding window difference sequence of the memory usage of the target server during the second time period; Generate multiple sliding window subsequences according to the sliding window difference sequence; Determine the sum of sliding window differences in each sliding window subsequence; When at least one sliding window subsequence among the multiple sliding window subsequences meets a preset condition, confirming that a sudden increase in memory usage of the target server occurs during the second time period; The preset conditions include: The sliding window difference at the last position in the sliding window subsequence is greater than the first threshold, and the sum of the sliding window differences in the sliding window subsequence is greater than the second threshold.
2. The server memory dynamic monitoring method according to claim 1, characterized in that: The obtaining of the overall change trend of the memory usage of the target server in the first period includes: Obtaining the memory usage of the target server during the first period of time; The memory usage rate in the first time period is input into a preset trend detection algorithm to obtain an overall change trend of the memory usage rate of the target server in the first time period.
3. The server memory dynamic monitoring method according to claim 1, characterized in that: The obtaining the number of memory usage sub-intervals covered by the memory usage of the target server in the second time period includes: Obtaining the memory usage of the target server during the second period; Determining the coverage of the memory usage rate during the second time period; The number of memory usage sub-intervals covered by the coverage range in the memory usage sub-interval set is determined.
4. The server memory dynamic monitoring method according to claim 1, characterized in that: Determining the memory monitoring result of the target server according to the overall change trend of the memory usage rate and the memory usage rate in the second time period includes: Determining the slope of the overall change trend of the memory usage; Determine a first mean of sliding window differences in the sliding window difference sequence corresponding to the second time period, and determine a second mean of sliding window differences in the sliding window difference sequence corresponding to the specified second time period; When the slope is greater than the slope threshold, and the first mean value is greater than the second mean value, it is confirmed that an abnormality exists in the memory of the target server.
5. The server memory dynamic monitoring method according to claim 4, characterized in that: Determining the memory monitoring result of the target server according to the overall change trend of the memory usage rate and the memory usage rate in the second time period includes: Determining the slope of the overall change trend of the memory usage; Determine a first standard deviation of the sliding window difference values in the sliding window difference value sequence corresponding to the second time period, and determine a second standard deviation of the sliding window difference values in the sliding window difference value sequence corresponding to the specified second time period; When the slope is greater than the slope threshold and the first standard deviation is greater than the second standard deviation, it is confirmed that an abnormality exists in the memory of the target server.
6. The server memory dynamic monitoring method according to claim 1, characterized in that: Determining the slope of the overall change trend of the memory usage rate includes: Using the least square method to fit the memory usage change curve within the first time period; The slopes of the starting and ending points of the change curve are determined as the slope of the overall change trend of the memory usage rate.
7. The server memory dynamic monitoring method according to claim 1, characterized in that: The first period includes the last two weeks.
8. The server memory dynamic monitoring method according to claim 1, characterized in that: The second period includes the last three hours.
9. The server memory dynamic monitoring method according to claim 4 or 5, characterized in that: The designated second time period includes the latest three hours of the last week.
10. A server memory dynamic monitoring device, characterized in that: include: An acquisition module, used to acquire the overall change trend of the memory usage of the target server in the first time period, and acquire the number of memory usage sub-intervals covered by the memory usage of the target server in the second time period; A judgment module, configured to judge whether there is a sudden increase in memory usage of the target server during the second time period when the overall change trend of the memory usage is an upward trend or the number of sub-intervals of the memory usage reaches a sharding threshold; A determination module, configured to determine a memory monitoring result of the target server according to an overall change trend of the memory usage and the memory usage in the second time period when a sudden increase in the memory usage of the target server occurs in the second time period; The determining whether the target server has a sudden increase in memory usage during the second period includes: Determine a sliding window difference sequence of the memory usage of the target server during the second time period; Generate multiple sliding window subsequences according to the sliding window difference sequence; Determine the sum of sliding window differences in each sliding window subsequence; When at least one sliding window subsequence among the multiple sliding window subsequences meets a preset condition, confirming that a sudden increase in memory usage of the target server occurs during the second time period; The preset conditions include: The sliding window difference at the last position in the sliding window subsequence is greater than the first threshold, and the sum of the sliding window differences in the sliding window subsequence is greater than the second threshold.
11. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the computer program is executed by the processor, the computer program executes the instructions of the method according to any one of claims 1 to 9.
12. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor of a computer device, the computer program executes the instructions of the method according to any one of claims 1 to 9.
