A method, device, equipment and storage medium for locating performance bottlenecks
By collecting and structured analysis of the operation logs in real time, judging performance bottlenecks with historical time period information, and positioning bottlenecks, the problems of high resource consumption and low efficiency in the existing technology are solved, and efficient and accurate performance bottleneck positioning is achieved.
Patent Information
- Application Number
- CN202311528295.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-16
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2043-11-16
AI Technical Summary
When positioning performance bottlenecks in the prior art, resource consumption is high and efficiency and accuracy are low.
By collecting the operation logs in real time, the structured analysis obtains the service module information, sorts the operation logs, finds historical time period information, determines whether there is a performance bottleneck, and locates the bottleneck position based on the service module information.
Reduces the resource consumption of performance bottleneck positioning work and improves the efficiency and accuracy of positioning.
Smart Images

Figure CN117573491B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method, device, equipment and storage medium for locating a performance bottleneck. Background Art
[0002] Apps and application programs are usually composed of a series of functional modules. Each functional module provides external services through a series of web pages and API interfaces.
[0003] Due to the requirement of high availability, the above functional modules are usually deployed in multiple virtual machines or containers in a distributed cluster manner. The resulting operation and maintenance problems are that user access services are unavailable or difficult to use. The performance bottleneck causing the above operation and maintenance problems may be a problem with a user's client, a problem with a functional module, a problem with the entire App or application, or a problem with the operating environment such as a virtual machine or container.
[0004] At present, when locating the performance bottleneck of the above-mentioned operation and maintenance problems, the existing technology performs one-to-one monitoring on each functional module used by the user, collects the operation information of all users, analyzes the slowest operation according to the user's usage of each function, and finally analyzes and checks one by one according to the indicators to locate the performance bottleneck. This method not only has a slow positioning speed and low positioning accuracy for locating the performance bottleneck, but also the one-to-one monitoring of the user's functional modules also increases the consumption of system resources, so that the user's equipment cannot perform at its maximum performance, thereby causing performance and resource waste. Summary of the invention
[0005] The present invention provides a performance bottleneck positioning method, device, equipment and storage medium, which can solve the problems of high resource consumption of performance bottleneck positioning work and low efficiency and accuracy of performance bottleneck positioning in the prior art when positioning the performance bottleneck.
[0006] In a first aspect, an embodiment of the present invention provides a method for locating a performance bottleneck, the method comprising:
[0007] Collect each operation log in real time, and perform structured analysis on each operation log to obtain service module information of the operation log set within the target time period; wherein the service module information includes the module call relationship within the target time period, the number of calls of each module call relationship, and the module structure information;
[0008] By parsing each running log, the running time matching each running log is obtained, and each running log is sorted according to the length of the running time;
[0009] Searching for a target number of historical time period information matching the target time period in the historical running time set, and judging whether there is a performance bottleneck in the target time period based on the historical time period information and the running time of each sorted running log;
[0010] When it is determined that a performance bottleneck exists, the position of the performance bottleneck is located according to the service module information.
[0011] In a second aspect, an embodiment of the present invention provides a device for locating a performance bottleneck, the device comprising:
[0012] The operation log collection module is used to collect various operation logs in real time and perform structured analysis on each operation log to obtain the service module information of the operation log set within the target time period; wherein the service module information includes the module call relationship within the target time period, the number of calls of each module call relationship, and the module structure information;
[0013] The operation log sorting module is used to obtain the operation time matching each operation log by parsing each operation log, and sort each operation log according to the length of the operation time;
[0014] A performance bottleneck determination module is used to search for a target number of historical time period information matching the target time period in the historical running time set, and determine whether there is a performance bottleneck in the target time period based on the historical time period information and the running time of each sorted running log;
[0015] The performance bottleneck locating module is used to locate the position of the performance bottleneck according to the service module information when it is determined that a performance bottleneck exists.
[0016] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for locating a performance bottleneck described in any embodiment of the present invention.
[0020] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a method for locating a performance bottleneck described in any embodiment of the present invention when executing the computer instructions.
[0021] The technical solution of the embodiment of the present invention first collects each operation log in real time and performs structured analysis on each operation log to obtain service module information of the operation log set within the target time period, then obtains the operation time matching each operation log by parsing each operation log, and sorts each operation log according to the length of the operation time, then searches for the target number of historical time period information matching the target time period in the historical operation time set, and judges whether there is a performance bottleneck within the target time period based on the historical time period information and the operation time of each sorted operation log, and finally, when it is judged that there is a performance bottleneck, locates the position of the performance bottleneck according to the service module information, solves the problem that the prior art has high resource consumption in the performance bottleneck locating work when locating the performance bottleneck, and the efficiency and accuracy of the performance bottleneck locating are both low, can locate the position of the performance bottleneck based on the operation log, reduces the resource consumption of the performance bottleneck locating work, and improves the efficiency and accuracy of the performance bottleneck locating.
[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a flow chart of a method for locating a performance bottleneck provided according to Embodiment 1 of the present invention;
[0025] Figure 2 is a flow chart of a method for locating a performance bottleneck provided according to Embodiment 2 of the present invention;
[0026] Figure 3 is a schematic diagram of the structure of a performance bottleneck positioning device provided according to Embodiment 3 of the present invention;
[0027] Figure 4 It is a structural schematic diagram of an electronic device for implementing a method for locating a performance bottleneck according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 A flowchart of a method for locating a performance bottleneck provided in Example 1 of the present invention. This embodiment is applicable to the situation of locating the performance bottleneck of a system. The method can be executed by a performance bottleneck locating device. The performance bottleneck locating device can be implemented in the form of hardware and / or software. The performance bottleneck locating device can be configured in a terminal or server with a performance bottleneck locating function.
[0032] like Figure 1 As shown, the method includes:
[0033] S110 , collecting each operation log in real time, and performing structured analysis on each operation log to obtain service module information of the operation log set within a target time period.
[0034] The service module information includes module call relationships within a target time period, call times of each module call relationship, and module structure information.
[0035] Among them, the module calling relationship can be a calling relationship obtained by sorting all service modules called by a thread of the current interface within the target time period to execute the thread service in the calling order; exemplarily, if the current thread first responds to the calling command of the thread when completing the current service, and then calls the static module, and then the static module calls the assets module, and calls the bootstrap module through the assets module, and then the bootstrap module calls newcss, and finally the newcss module calls bootstrap.css to complete the current service. In the above case, the module calling relationship is: static-assets-bootstrap-newcss-bootstrap.css; it should be noted that the above situation is only a specific implementation scenario provided in this embodiment. In actual applications, the module calling relationship is determined by the actual situation of the thread implementing the service, and this embodiment does not limit this.
[0036] Furthermore, within the target time period, there may be a situation where multiple service modules are called, that is, there are multiple module calling relationships or the same module calling relationship is called multiple times within the target time period, and the number of times each module calling relationship is called is the number of times each module calling relationship is called.
[0037] Among them, the module structure information is determined by the access behavior of the current module; specifically, if only the out feature appears in all the access behaviors of the current module, the module structure information of the module is assigned to the out type; if only the in feature appears in all the access behaviors of the current module, the module structure information of the module is assigned to the in type; if both in and out values appear in all the access behaviors of the current module, the module structure information of the module is assigned to the in / out type; further, the module structure information can be obtained from the access behavior of the current module by parsing each operation log.
[0038] The real-time collection of various operation logs specifically includes: collecting all log files generated through a specific interface within a target time period.
[0039] Specifically, the structured analysis of each operation log to obtain the service module information of the operation log set within the target time period includes: determining whether each operation log is in a standard coding format, and converting the operation log in a non-standard coding format into a standard coding format based on a preset model; segmenting each operation log in a standard coding format based on a preset rule to obtain each standard segmentation matching each operation log; stratifying each standard segmentation based on the position order of each standard segmentation in each operation log and obtaining a module call relationship matching the operation log based on the stratification result.
[0040] S120 , obtaining the running time matching each running log by parsing each running log, and sorting each running log according to the length of the running time.
[0041] Among them, the running time of each running log can be considered as the total time taken for the current log file to be created and edited; further, the running time of the running log can be obtained by parsing the specific data content of the current running log. Obtaining the running time corresponding to the log according to the data content of the log is a mature existing technology, which will not be elaborated in this embodiment.
[0042] S130, searching for a target number of historical time period information matching the target time period in the historical running time set, and judging whether there is a performance bottleneck in the target time period based on the historical time period information and the running time of each sorted running log.
[0043] The performance bottleneck may be a performance defect of the software or system. For example, a developer develops a payment processing program. During testing, it is found that the payment processing program can only process concurrent payment requests sent by users in serial but not in parallel, resulting in a very long processing response time for the payment transaction. In this case, it can be considered that a performance bottleneck has occurred in the application.
[0044] In this embodiment, specifically, the historical time set includes multiple historical time periods and historical time values matching each historical time period.
[0045] Among them, judging whether there is a performance bottleneck within the target time period based on the information of each historical time period and the running time of each sorted running log includes: parsing the information of each historical time period to obtain each historical time value matching each historical time period; extracting the target time value matching the target time period based on the running time of each running log; calculating the ratio of the target time value to each historical time value respectively, and judging whether there is a target historical time value whose ratio exceeds a preset threshold range; when judging that there is a historical time value whose ratio exceeds the preset threshold range, counting the number of target historical time values whose ratio exceeds the preset threshold range, and when the number of the target historical time values exceeds the threshold, judging that there is a performance bottleneck within the target time period.
[0046] Exemplarily, after sorting each operation log according to the length of the operation time, the median of the operation time corresponding to all the operation logs is extracted as the target time value according to the preset rules; then, the target time period is identified as 09:00-09:05 on November 3, 2023, then 31 sections from 09:00-09:05 on October 3, 2023 to 09:00-09:05 on November 2, 2023 are searched in the historical time set as historical time sections; 31 historical time values matching the above 31 historical time sections are matched in the historical time set respectively, and the ratio of the target time value to each historical time value is calculated respectively, and it is determined whether there is a target historical time value whose ratio exceeds the preset threshold range; when it is determined that there is a historical time value whose ratio exceeds the preset threshold range, the number of target historical time values whose ratio exceeds the preset threshold range is counted, and when the number of the target historical time values exceeds the threshold, it is determined that there is a performance bottleneck within the target time period.
[0047] Optionally, after sorting each operation log according to the length of the operation time, the preset rules can be manually adjusted according to the actual accuracy requirements; illustratively, in addition to extracting the median of the operation time corresponding to all operation logs as the target time value, it can also be: taking the operation time corresponding to the operation log ranked 500th as the target time value, etc. This embodiment does not impose any restrictions on this.
[0048] Optionally, in this embodiment, after sorting each operation log according to the length of the operation time, the operation time corresponding to a certain operation log can be extracted according to the preset rules as the historical time value corresponding to the target time period; for example, if the current target time period is 09:00-09:05 on November 3, 2023, and the operation time of a specific log corresponding to the time period extracted according to the preset rules is 0.003, then the target time period 09:00-09:05 on November 3, 2023 is updated to the historical time period, and 0.003 is updated to a historical time value matching the above historical time period and stored in the historical time set.
[0049] The steps of respectively calculating the ratio of the target time value to each historical time value and determining whether there is a target historical time value whose ratio exceeds a preset threshold range; when determining that there is a historical time value whose ratio exceeds the preset threshold range, counting the number of target historical time values whose ratio exceeds the preset threshold range, and when the number of the target historical time values exceeds the threshold, determining that there is a performance bottleneck in the target time period includes:
[0050] The threshold value can be set and adjusted manually, and in the prior art, the threshold value is usually limited to 3. In a specific implementation of this embodiment, the threshold range of the ratio is set to 3, the threshold number of the historical time value is 3, the current target time period is: 9:00-9:05 on October 7, 2023, 1000 requests occurred during this time period, the target time value corresponding to the target time period obtained according to the preset rule is 0.003, and the historical time period is: September 6, 2023-October 6, 2023, every day from 9:00 to 9:05, and 30 historical time values matching the 30 historical time periods can be obtained through the historical time set; if there are more than 3 values of the preset threshold value less than or equal to 0.001 among the 30 historical time values, that is, there are more than 3 historical time values whose ratio to the target time value exceeds the preset threshold range of 3 among the 30 historical time values, then a performance bottleneck alarm is triggered, and it is determined that a performance bottleneck occurs.
[0051] S140: When it is determined that a performance bottleneck exists, locate the position of the performance bottleneck according to the service module information.
[0052] Specifically, when it is determined that there is a performance bottleneck, the position of the performance bottleneck is located according to the service module information, including: sorting the module call relationships according to the number of calls of each module call relationship in the service module information; identifying the module call relationship with the largest number of calls and outputting it as the location result of the performance bottleneck.
[0053] Exemplarily, after identifying the module call relationship with the most calls as the location result of the performance bottleneck and outputting it, all the operation logs matching the module call relationship can be obtained, and the data content of the operation log can be analyzed through a preset model, so as to obtain the ISP, region and terminal type of the access source of the operation log corresponding to the performance bottleneck, three attribute fields, group ranking statistics, and locate the client or server characteristics affected when the performance bottleneck occurs; among them, ISP is used to locate which operator is affected, including China Unicom, China Telecom, att.com, verizon.com and other value ranges; region is used to locate which city is affected, including Los Angeles, The value range is Jincheng, Nanjing, Beijing, etc.; the terminal type is used to locate which type of client or server is affected, including the value range of Windows7, Windows10, Andriod, iOS, etc.; further, the method of group ranking statistics can be specifically: take the operation log related to the performance bottleneck in the corresponding target time period, arrange it in descending order based on the file content of the operation log according to the upstream_resp_time field value, and use the above-mentioned ISP, region and terminal type three fields to group and aggregate the statistical rankings, and the top 10 statistical values are the client or server feature distribution caused by the performance bottleneck, that is, the positioning result of the performance bottleneck.
[0054] In this embodiment, optionally, after identifying the module call relationship with the largest number of calls as the location result of the performance bottleneck and outputting it, it also includes: parsing the location result, generating a module impact report matching the location result and pushing it to a display device for display; and: based on the module structure information matching the location result, generating an external provision method report and pushing it to a display device for display.
[0055] Among them, the module impact report can show which other modules will be affected by the module call relationship of the current performance bottleneck; wherein, the external provision method report can show the types of access behaviors affected by the modules matching the module call relationship of the current performance bottleneck, so as to facilitate relevant personnel to repair the modules matching the module call relationship according to the location of the performance bottleneck.
[0056] The technical solution of the embodiment of the present invention first collects each operation log in real time and performs structured analysis on each operation log to obtain service module information of the operation log set within the target time period, then obtains the operation time matching each operation log by parsing each operation log, and sorts each operation log according to the length of the operation time, then searches for the target number of historical time period information matching the target time period in the historical operation time set, and judges whether there is a performance bottleneck within the target time period based on the historical time period information and the sorted operation time of each operation log, and finally, when it is judged that there is a performance bottleneck, locates the position of the performance bottleneck according to the service module information, reduces the resource consumption of the performance bottleneck locating work, and improves the efficiency and accuracy of the performance bottleneck locating.
[0057] Embodiment 2
[0058] Figure 2 A flowchart of a method for locating a performance bottleneck provided in Example 2 of the present invention. This embodiment is refined based on the above-mentioned embodiment. In this embodiment, the method of performing structured analysis on each operation log to obtain service module information of the operation log set within the target time period is specifically refined.
[0059] like Figure 2 As shown, the method includes:
[0060] S210: Collect each operation log in real time, determine whether each operation log is in a standard coding format, and convert the operation log in a non-standard coding format into a standard coding format based on a preset model.
[0061] Specifically, the URL information in the operation log may be in three situations: normal encoding, URL encoding, and Base64 encoding. In the present embodiment, the normal encoding is set as the standard format encoding; further, when it is detected that the operation log is URL encoded, the non-standard encoding format is converted into the standard encoding format based on the URLdecode function; further, when it is detected that the operation log is Base64 encoded, the non-standard encoding format is converted into the standard encoding format based on the Base64 function.
[0062] S220: Segment the operation logs in the standard coding formats based on preset rules to obtain standard segmentations matching the operation logs.
[0063] Relevant personnel in this field should know that the normal encoding is a structure containing " / string" / , ". string", and there is at least one structure content; further, when the operation logs of each standard encoding format are segmented based on the preset rules, the " / " mark is used to perform word segmentation processing, and the word number after each word segmentation is marked; illustratively, if the specific data content of a line of the operation log is: request_path = / static / assets / bootstrap / newcss / bootstrap.css, then the " / " mark is used to perform word segmentation processing and mark the word number to obtain the standard word segmentation results: req_L1 = static; req_L2 = assets; req_L3 = bootstrap; req_L4 = newcss;
[0064] req_L5=bootstrap.css.
[0065] S230 , based on the position sequence of each standard segmentation word in each operation log, each standard segmentation word is layered and based on the layering result, a module call relationship matching the operation log is obtained.
[0066] Optionally, after stratifying each standard word based on the position order of each standard word in each operation log and obtaining the module call relationship matching the operation log based on the stratification result, it also includes: aggregating the number of calls of each module call relationship corresponding to the operation log set according to all module call relationships of all operation logs.
[0067] In this embodiment, before stratifying each standard participle based on the position order of each standard participle in each operation log and obtaining the module call relationship matching the operation log based on the stratification result, it also includes: filtering and re-stratifying each standard participle based on preset rules.
[0068] Specifically, based on the above steps, when the L1 field value is a domain name structure (such as liuxiaodo.u.rizhiyi.com) or an IP address, it is represented as a service name provided to the outside world, and there is no need to participate in the derivation and calculation of the service module level. The division after L1 is raised by one layer as a whole, that is, L2 becomes L1, L3 becomes L2, and L4 becomes L3; for example, if the current word segmentation result is req_L1=liuxiaodo.u.rizhiyi.com; req_L2=assets; req_L3=bootstrap; req_L4=newcss; req_L5=bootstrap.css, then the new hierarchical results obtained after filtering and re-stratification are req_L1=assets; req_L2=bootstrap; req_L3=newcss;
[0069] req_L4=bootstrap.css.
[0070] Further, based on the above filtering and re-stratification, for non-L1 fields, if they meet the preset characteristics, the current stratum is determined to be a leaf node, the stratum is deleted, and after the module call relationship is extracted through standard word segmentation, the modules included in the stratum are not extracted; wherein the preset characteristics are: 1) the character length is greater than 50 characters; 2) it meets the file name characteristics, such as mysq.rar; 3) it contains a structure composed of characters such as ?, =, %, &, etc., such as
[0071] &type=timeline&filters=&exist_fields=&_t=1506043471376, etc.
[0072] On the basis of the above steps, based on the position order of each standard word segmentation in each operation log, each standard word segmentation is layered and based on the layered result, a module calling relationship matching the operation log is obtained, including: based on the final word segmentation result of each log file, a module calling relationship matching the operation log is obtained, that is, an upper-level module calls a lower-level module; exemplarily, if the layered result of a certain operation log obtained based on the above steps is: req_L1=assets; req_L2=bootstrap; req_L3=newcss; req_L4=bootstrap.css, then the module calling relationship corresponding to the current operation log is assets-bootstrap-newcss-bootstrap.css.
[0073] Optionally, after stratifying each standard word based on the position order of each standard word in each operation log and obtaining the module call relationship matching the operation log based on the stratification result, it also includes: parsing each operation log to obtain characteristic attributes of each module matching each operation log; and obtaining module structure information of the operation log set based on the characteristic attributes of each module.
[0074] S240: parse each operation log to obtain the operation time that matches each operation log, and sort each operation log according to the length of the operation time.
[0075] S250, searching for a target number of historical time period information matching the target time period in the historical running time set, and judging whether there is a performance bottleneck in the target time period based on the historical time period information and the running time of each sorted running log.
[0076] S260: When it is determined that a performance bottleneck exists, locate the position of the performance bottleneck according to the service module information.
[0077] The technical solution of the embodiment of the present invention first collects each operation log in real time, determines whether each operation log is in a standard coding format, and converts the operation log in a non-standard coding format into a standard coding format based on a preset model, then performs word segmentation on each operation log in a standard coding format based on a preset rule to obtain each standard word segmentation matching each operation log, then layers each standard word segmentation based on the position sequence of each standard word segmentation in each operation log, and obtains a module call relationship matching the operation log based on the layering result, then obtains the running time matching each operation log by parsing each operation log, and sorts each operation log according to the length of the running time, then searches for each historical time period information of a target number matching the target time period in the historical running time set, and determines whether there is a performance bottleneck in the target time period based on each historical time period information and the running time of each sorted operation log, and finally, when it is determined that there is a performance bottleneck, locates the position of the performance bottleneck according to the service module information, reduces the resource consumption of the performance bottleneck positioning work, and improves the efficiency and accuracy of the performance bottleneck positioning.
[0078] Embodiment 3
[0079] Figure 3 A schematic diagram of the structure of a device for locating a performance bottleneck provided in Embodiment 3 of the present invention.
[0080] like Figure 3 As shown, the device comprises:
[0081] The operation log collection module 310 is used to collect various operation logs in real time and perform structured analysis on each operation log to obtain service module information of the operation log set within the target time period; wherein the service module information includes the module call relationship within the target time period, the number of calls of each module call relationship, and the module structure information;
[0082] The operation log sorting module 320 is used to obtain the operation time matching each operation log by parsing each operation log, and sort each operation log according to the length of the operation time;
[0083] The performance bottleneck determination module 330 is used to search for a target number of historical time period information matching the target time period in the historical running time set, and determine whether there is a performance bottleneck in the target time period based on the historical time period information and the running time of each sorted running log;
[0084] The performance bottleneck locating module 340 is used to locate the position of the performance bottleneck according to the service module information when it is determined that a performance bottleneck exists.
[0085] The technical solution of the embodiment of the present invention first collects each operation log in real time and performs structured analysis on each operation log to obtain service module information of the operation log set within the target time period, then obtains the operation time matching each operation log by parsing each operation log, and sorts each operation log according to the length of the operation time, then searches for the target number of historical time period information matching the target time period in the historical operation time set, and judges whether there is a performance bottleneck within the target time period based on the historical time period information and the sorted operation time of each operation log, and finally, when it is judged that there is a performance bottleneck, locates the position of the performance bottleneck according to the service module information, reduces the resource consumption of the performance bottleneck locating work, and improves the efficiency and accuracy of the performance bottleneck locating.
[0086] Based on the above embodiment, the performance bottleneck determination module 330 further includes:
[0087] A historical time parsing unit, used to parse the information of each historical time period and obtain each historical time value matching each historical time period;
[0088] A target time value matching unit, configured to extract a target time value matching the target time period based on the running time of each running log;
[0089] a ratio calculation unit, used to calculate the ratio of the target time value to each historical time value, and determine whether there is a target historical time value whose ratio exceeds a preset threshold range;
[0090] A threshold judgment unit is used to count the number of target historical time values whose ratios exceed the preset threshold range when it is judged that there are historical time values whose ratios exceed the preset threshold range. When the number of the target historical time values exceeds the threshold, it is determined that there is a performance bottleneck within the target time period.
[0091] Based on the above embodiment, the performance bottleneck location module 340 further includes:
[0092] A module sorting unit, used to sort the calling relationships of each module according to the calling times of each module calling relationship in the service module information;
[0093] The performance bottleneck output unit is used to identify the calling relationship of the module with the most calling times and output it as the positioning result of the performance bottleneck.
[0094] Based on the above embodiment, the performance bottleneck location module 340 is also used to: identify the module call relationship with the largest number of calls and output it as the location result of the performance bottleneck, parse the location result, generate a module impact report matching the location result and push it to the display device for display; and: based on the module structure information matching the location result, generate an external provision method report and push it to the display device for display.
[0095] Based on the above embodiment, the operation log collection module 310 further includes:
[0096] A transcoding unit, used to determine whether each operation log is in a standard encoding format, and convert the operation log in a non-standard encoding format into a standard encoding format based on a preset model;
[0097] A word segmentation unit, used for segmenting the operation logs in each standard coding format based on preset rules to obtain each standard word segmentation matching each operation log;
[0098] The stratification unit is used to stratify each standard segmentation word based on the position sequence of each standard segmentation word in each operation log and obtain the module call relationship matching the operation log based on the stratification result.
[0099] Based on the above embodiment, the operation log collection module 310 is also used to: based on the position order of each standard word in each operation log, stratify each standard word and obtain the module call relationship matching the operation log based on the stratification result, and then aggregate the number of calls of each module call relationship corresponding to the operation log set according to all module call relationships of all operation logs.
[0100] On the basis of the above-mentioned embodiment, the operation log collection module 310 is also used for: it is characterized in that based on the position order of each standard word in each operation log, each standard word is layered and based on the layering result, the module call relationship matching the operation log is obtained, and then each operation log is parsed to obtain the characteristic attributes of each module matching each operation log; based on the characteristic attributes of each module, the module structure information of the operation log set is obtained.
[0101] A performance bottleneck locating device provided in an embodiment of the present invention can execute a performance bottleneck locating method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0102] Embodiment 4
[0103] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0104] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0105] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0106] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for locating a performance bottleneck.
[0107] Accordingly, the method comprises:
[0108] Collect each operation log in real time, and perform structured analysis on each operation log to obtain service module information of the operation log set within the target time period; wherein the service module information includes the module call relationship within the target time period, the number of calls of each module call relationship, and the module structure information;
[0109] By parsing each running log, the running time matching each running log is obtained, and each running log is sorted according to the length of the running time;
[0110] Searching for a target number of historical time period information matching the target time period in the historical running time set, and judging whether there is a performance bottleneck in the target time period based on the historical time period information and the running time of each sorted running log;
[0111] When it is determined that a performance bottleneck exists, the position of the performance bottleneck is located according to the service module information.
[0112] In some embodiments, a method for locating a performance bottleneck may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for locating a performance bottleneck described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute a method for locating a performance bottleneck in any other appropriate manner (e.g., by means of firmware).
[0113] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0115] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0116] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0117] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0118] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0119] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
Claims
1. A method for locating a performance bottleneck, characterized in that: include: Collect each operation log in real time, and perform structured analysis on each operation log to obtain service module information of the operation log set within the target time period; wherein the service module information includes the module call relationship within the target time period, the number of calls of each module call relationship, and the module structure information; By parsing each operation log, the operation time matching each operation log is obtained, and each operation log is sorted according to the length of the operation time; wherein the operation time of each operation log is the total time taken from the creation to the completion of editing of the current log file; Searching for a target number of historical time period information matching the target time period in the historical running time set, and judging whether there is a performance bottleneck in the target time period based on the historical time period information and the running time of each sorted running log; When it is determined that there is a performance bottleneck, locating the position of the performance bottleneck according to the service module information; Among them, judging whether there is a performance bottleneck within the target time period based on the information of each historical time period and the running time of each sorted running log includes: parsing the information of each historical time period to obtain each historical time value matching each historical time period; extracting the target time value matching the target time period based on the running time of each running log; calculating the ratio of the target time value to each historical time value respectively, and judging whether there is a target historical time value whose ratio exceeds a preset threshold range; when judging that there is a target historical time value whose ratio exceeds the preset threshold range, counting the number of target historical time values whose ratio exceeds the preset threshold range, and when the number of the target historical time values exceeds the threshold, judging that there is a performance bottleneck within the target time period; wherein, the target time value includes: the median of the running time corresponding to all the running logs or the running time corresponding to the running logs with a set ranking.
2. The method according to claim 1, characterized in that When it is determined that there is a performance bottleneck, locating the position of the performance bottleneck according to the service module information includes: Sort the module call relationships according to the number of calls of each module call relationship in the service module information; The calling relationship of the module with the most calling times is identified and output as the location result of the performance bottleneck.
3. The method according to claim 2, characterized in that After identifying the calling relationship of the module with the most calls as the location result of the performance bottleneck and outputting it, it also includes: Analyze the positioning result, generate a module impact report matching the positioning result, and push it to a display device for display; And, based on the module structure information matching the positioning result, a report on the external provision method is generated and pushed to a display device for display.
4. The method according to claim 1, characterized in that: Perform structured analysis on each operation log to obtain the service module information of the operation log set within the target time period, including: Determine whether each operation log is in a standard encoding format, and convert the operation log in a non-standard encoding format into a standard encoding format based on a preset model; Segment the operation logs in each standard coding format based on preset rules to obtain each standard segmentation matching the operation log; Based on the position sequence of each standard segmentation word in each operation log, each standard segmentation word is layered and based on the layering result, a module call relationship matching the operation log is obtained.
5. The method according to claim 4, characterized in that After stratifying each standard segmentation word based on the position sequence of each standard segmentation word in each operation log and obtaining a module call relationship matching the operation log based on the stratification result, the method further includes: According to all module call relations of all operation logs, the call times of each module call relation corresponding to the operation log set are obtained by aggregation.
6. The method according to claim 4, characterized in that After stratifying each standard segmentation word based on the position sequence of each standard segmentation word in each operation log and obtaining a module call relationship matching the operation log based on the stratification result, the method further includes: Parse each operation log to obtain characteristic attributes of each module that match each operation log; The module structure information of the operation log set is obtained based on the characteristic attributes of each module.
7. A device for locating a performance bottleneck, characterized in that: include: The operation log collection module is used to collect various operation logs in real time and perform structured analysis on each operation log to obtain the service module information of the operation log set within the target time period; wherein the service module information includes the module call relationship within the target time period, the number of calls of each module call relationship, and the module structure information; A running log sorting module is used to obtain the running time matching each running log by parsing each running log, and sort each running log according to the length of the running time; wherein the running time of each running log is the total time taken from the creation to the completion of editing of the current log file; A performance bottleneck determination module is used to search for a target number of historical time period information matching the target time period in the historical running time set, and determine whether there is a performance bottleneck in the target time period based on the historical time period information and the running time of each sorted running log; A performance bottleneck locating module, used to locate the position of the performance bottleneck according to the service module information when it is determined that there is a performance bottleneck; Among them, the performance bottleneck judgment module includes: a historical time parsing unit, which is used to parse the information of each historical time period to obtain each historical time value matching each historical time period; a target time value matching unit, which is used to extract the target time value matching the target time period based on the running time of each running log; a ratio calculation unit, which is used to calculate the ratio of the target time value to each historical time value, and judge whether there is a target historical time value whose ratio exceeds a preset threshold range; a threshold judgment unit, which is used to count the number of target historical time values whose ratio exceeds the preset threshold range when judging that there is a target historical time value whose ratio exceeds the preset threshold range, and when the number of the target historical time values exceeds the threshold, it is determined that there is a performance bottleneck in the target time period; wherein, the target time value includes: the median of the running time corresponding to all running logs or the running time corresponding to the running log with a set ranking.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for locating a performance bottleneck according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a method for locating a performance bottleneck according to any one of claims 1 to 6 when executing the computer instructions.
Citation Information
Patent Citations
Performance monitoring and tuning system and method for distributed storage system
CN106126407A
Calling relation tracking method, device and apparatus and computer readable storage medium
CN112131070A