Method and device for monitoring running state of thread pool
By collecting thread pool status indicators, calculating usage rates and dividing load intervals, calculating optimization coefficients and adjustment coefficients, generating reasonable scores and adjustment step size methods, the shortcomings of thread pool status monitoring in the existing technology are solved, and efficient and accurate thread pool status monitoring is achieved.
Patent Information
- Application Number
- CN202411749235.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-02
AI Technical Summary
The existing thread pool status monitoring scheme has problems such as fixed indicator weights, single evaluation dimensions, slow responses, and undermining the value of monitoring data.
Thread pool status indicators are collected through the heartbeat probe, core thread usage, maximum thread usage, and queue usage are calculated, and weighted moving average processing is performed. The load interval is divided according to these indicators, the optimization coefficient and adjustment coefficient are calculated, the parameter rationality score is generated, and the adjustment step length is calculated based on the historical adjustment record.
It improves the efficiency and accuracy of thread pool status monitoring, enhances the in-depth analysis and prediction capabilities of thread pool operating status, dynamically adjusts the deviation between monitoring results and actual operating status, and promptly discovers and warns of potential performance problems.
Smart Images

Figure CN119718819A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method and device for monitoring the running status of a thread pool. Background Art
[0002] Thread pool status monitoring plays an increasingly important role in current distributed systems, but existing monitoring solutions still have many shortcomings. Traditional monitoring methods are often limited to simple numerical statistics and threshold alarms, lacking in-depth analysis and prediction capabilities of thread pool operation status. Although some systems have introduced more complex monitoring indicators, they are still relatively rough in data collection, analysis, and decision-making.
[0003] Current monitoring systems generally have problems such as fixed indicator weights and single evaluation dimensions. Most solutions cannot dynamically adjust the importance of various indicators according to the actual situation of system operation, resulting in deviations between monitoring results and actual operating conditions. At the same time, existing solutions are slow to respond when dealing with sudden load changes, making it difficult to detect and warn of potential performance problems in a timely manner.
[0004] Another significant problem is that the value of monitoring data has not been fully explored. A large amount of historical monitoring data is only used for simple display and archiving, and no effective data analysis mechanism has been established to guide subsequent parameter optimization. In particular, in the selection of adjustment strategies, it often relies on experience and judgment without data support, resulting in less than ideal adjustment results.
[0005] Therefore, the industry needs a smarter and more comprehensive thread pool status monitoring solution. Summary of the invention
[0006] In response to the problems in the prior art, the present application provides a thread pool running status monitoring method and device, which can improve the efficiency and accuracy of thread pool running status monitoring.
[0007] In order to solve at least one of the above problems, the present application provides the following technical solutions:
[0008] In a first aspect, the present application provides a thread pool running status monitoring method, comprising:
[0009] The number of active threads, total number of threads and number of waiting tasks are collected through the heartbeat probe, and the number of core threads, maximum number of threads and queue capacity currently in effect are queried in the parameter version library; the core thread utilization rate is calculated by dividing the number of active threads by the number of core threads, the maximum thread utilization rate is calculated by dividing the total number of threads by the maximum number of threads, and the queue utilization rate is calculated by dividing the number of waiting tasks by the queue capacity; the weighted moving average of the three utilization rate indicators is performed within the time window, where the weight coefficient decays exponentially with time;
[0010] The fluctuation range of the ratio of the number of active threads to the number of core threads is divided into high-load intervals, normal intervals, and low-load intervals, and the optimization coefficient of the core thread is calculated based on the interval distribution characteristics; the variance of the ratio of the total number of threads to the maximum number of threads is calculated, and the adjustment coefficient of the maximum thread is extracted through the fluctuation characteristics of the variance curve; the difference between the task growth rate and the processing rate is used as the calibration factor of the queue capacity; the evaluation results of the three parameters are compared with the preset reasonable interval boundaries to generate parameter rationality scores;
[0011] The performance improvement effect of each preset adjustment strategy is counted from the historical adjustment records, and the adjustment strategy with the most significant performance improvement is extracted as the baseline strategy; the current adjustment step is calculated based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the calibration factor of the queue capacity by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; the adjustment suggestions and their calculation basis are recorded in the version library, and the corresponding effective conditions are set.
[0012] Furthermore, the core thread usage rate is calculated by dividing the number of active threads by the number of core threads, the maximum thread usage rate is calculated by dividing the total number of threads by the maximum number of threads, and the queue usage rate is calculated by dividing the number of waiting tasks by the queue capacity, including:
[0013] Read the real-time values of the three indicators of active threads, total threads, and waiting tasks from the monitoring data collected by the probe, obtain the three parameter values of the currently effective number of core threads, maximum number of threads, and queue capacity from the configuration center, and perform data verification on the collected monitoring indicators to filter out abnormal values and invalid values;
[0014] Divide the verified number of active threads by the number of core threads to calculate the core thread pool load level at the current moment, divide the total number of threads by the maximum number of threads to calculate the overall load level of the thread pool, divide the number of waiting tasks by the queue capacity to calculate the saturation of the task queue, and normalize the calculation results to the [0,1] interval.
[0015] Furthermore, the weighted moving average of the three usage rate indicators within a time window, wherein the weight coefficient decays exponentially over time, includes:
[0016] Create a fixed-size circular array as a time window buffer, write the real-time calculation results of core thread utilization, maximum thread utilization, and queue utilization into the corresponding buffer location, calculate the time interval of each sampling point based on the data writing time, and generate the corresponding weight attenuation coefficient through the exponential function e to the negative power of the time interval;
[0017] Traverse all data points in the time window, multiply the utilization value of each data point by the corresponding weight coefficient to get the weighted value, accumulate all weighted values and divide them by the sum of the weight coefficients to get the weighted average result, and perform this calculation process for the three indicators of core thread utilization, maximum thread utilization, and queue utilization.
[0018] Furthermore, dividing the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval, and a low-load interval, and calculating the optimization coefficient of the core thread based on the interval distribution characteristics, includes:
[0019] Read the historical sequence of the ratio of the number of active threads to the number of core threads in the monitoring data, automatically group the ratio data using the two-sample K-means clustering algorithm, calculate the central value and variance of each group, divide the ratio range into high-load interval, normal interval and low-load interval according to the clustering results, and record the interval boundary values to the configuration center;
[0020] The data distribution density of each interval in the statistical time window is calculated, and the data proportion of the high-load interval and the low-load interval is calculated. The difference between the proportions of the two intervals and the ratio of the data proportion of the normal interval are used as the basic coefficient. The basic coefficient is corrected using the probability density function of the normal distribution to obtain the optimization coefficient of the number of core threads.
[0021] Furthermore, the calculation of the variance of the ratio of the total number of threads to the maximum number of threads and the extraction of the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve include:
[0022] Calculate the mean of the ratio sequence of the total number of threads to the maximum number of threads within the sampling window, subtract the mean from the ratio of each sampling point and square it to get the square of the deviation, sum all the squares of the deviation and divide it by the number of sampling points to get the variance value, apply the sliding window calculation to the variance sequence to get the variance change curve;
[0023] The variance change curve is subjected to Fourier transform to extract the fluctuation period and amplitude characteristics, the amplitude of the main frequency component is compared with the preset steady-state threshold to calculate the deviation rate, and the sigmoid function is used to map the deviation rate to the [-1,1] interval to obtain the adjustment coefficient of the maximum number of threads, wherein the adjustment coefficient reflects the stability of thread pool capacity utilization.
[0024] Furthermore, the method of using the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity includes:
[0025] The number of newly added tasks to be processed per unit time is obtained through the thread pool monitoring interface, and the rate of change of the task queue length over time is calculated to obtain the task growth rate. At the same time, the rate of change of the number of completed tasks over time is calculated to obtain the task processing rate. Kalman filtering is applied to the two rate sequences to eliminate random fluctuations;
[0026] The task backlog change rate is obtained by subtracting the task processing rate from the smoothed task growth rate. The exponential smoothing method is used to predict the task backlog degree in the future time window. The ratio of the predicted value to the queue capacity is mapped through a logarithmic function to obtain the queue capacity calibration factor.
[0027] Furthermore, the evaluation results of the three parameters are compared with the preset reasonable interval boundaries to generate parameter rationality scores, including:
[0028] Read the reasonable interval boundary values of the three parameters of core thread number, maximum thread number and queue capacity from the configuration center, map the optimization coefficient, adjustment coefficient and calibration factor calculated in the parameter evaluation to the corresponding interval range, calculate the deviation degree of each evaluation result from the interval boundary, and apply the inverse tangent function to normalize the deviation value;
[0029] Different weight coefficients are set for the three parameters to reflect their importance in the thread pool operation. The normalized deviation value is multiplied by the corresponding weight coefficient to obtain a weighted score. The three weighted scores are summed and mapped to a score range of 0 to 100 through min-max normalization to obtain the final parameter rationality score.
[0030] In a second aspect, the present application provides a thread pool operation status monitoring device, comprising:
[0031] The weight determination module is used to collect the number of active threads, the total number of threads and the number of waiting tasks through the heartbeat probe, and query the currently effective number of core threads, the maximum number of threads and the queue capacity in the parameter version library; the core thread utilization rate is calculated by dividing the number of active threads by the number of core threads, the maximum thread utilization rate is calculated by dividing the total number of threads by the maximum number of threads, and the queue utilization rate is calculated by dividing the number of waiting tasks by the queue capacity; the weighted moving average of the three utilization rate indicators is performed within the time window, where the weight coefficient decays exponentially with time;
[0032] The parameter rationality evaluation module is used to divide the fluctuation range of the ratio of the number of active threads to the number of core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as the calibration factor of the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate parameter rationality scores;
[0033] The thread adjustment module is used to count the performance improvement effect of each preset adjustment strategy from the historical adjustment records, and extract the adjustment strategy with the most significant performance improvement as the baseline strategy; calculate the current adjustment step based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the calibration factor of the queue capacity by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; record the adjustment suggestions and their calculation basis in the version library, and set the corresponding effectiveness conditions.
[0034] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the thread pool operation status monitoring method when executing the program.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the thread pool running status monitoring method.
[0036] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which implements the steps of the thread pool operation status monitoring method when executed by a processor.
[0037] It can be seen from the above technical scheme that the present application provides a thread pool operation status monitoring method and device, which divides the fluctuation range of the ratio of the number of active threads to the number of core threads into high-load intervals, normal intervals and low-load intervals, and calculates the optimization coefficient of the core thread based on the interval distribution characteristics; calculates the variance of the ratio of the total number of threads to the maximum number of threads, and extracts the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; uses the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compares the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generates a parameter rationality score; counts the performance improvement effect of each preset adjustment strategy from the historical adjustment records; calculates the current adjustment step based on the baseline strategy; records the adjustment suggestions and their calculation basis in the version library, and sets corresponding effective conditions, thereby improving the efficiency and accuracy of thread pool operation status monitoring. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] Figure 1 This is one of the flow charts of the thread pool running status monitoring method in the embodiment of the present application;
[0040] Figure 2 This is the second flow chart of the thread pool running status monitoring method in the embodiment of the present application;
[0041] Figure 3 The third flowchart of the thread pool running status monitoring method in the embodiment of the present application;
[0042] Figure 4 This is a fourth flow chart of the thread pool running status monitoring method in an embodiment of the present application;
[0043] Figure 5 This is a fifth flow chart of the thread pool running status monitoring method in an embodiment of the present application;
[0044] Figure 6 This is a sixth flow chart of the thread pool running status monitoring method in an embodiment of the present application;
[0045] Figure 7 This is the seventh flow chart of the thread pool running status monitoring method in the embodiment of the present application;
[0046] Figure 8 It is a structural diagram of a thread pool running status monitoring device in an embodiment of the present application;
[0047] Fig. 9 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.
[0048] Reference numerals:
[0049] Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0052] In view of the problems existing in the prior art, the present application provides a thread pool operation status monitoring method and device, which divides the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval and a low-load interval, and calculates the optimization coefficient of the core thread based on the interval distribution characteristics; calculates the variance of the ratio of the total number of threads to the maximum number of threads, and extracts the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; uses the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compares the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generates a parameter rationality score; counts the performance improvement effect of each preset adjustment strategy from the historical adjustment records; calculates the current adjustment step size based on the baseline strategy; records the adjustment suggestions and their calculation basis in the version library, and sets corresponding effective conditions, thereby improving the efficiency and accuracy of thread pool operation status monitoring.
[0053] In order to improve the efficiency and accuracy of thread pool running status monitoring, the present application provides an embodiment of a thread pool running status monitoring method, see Figure 1 , the thread pool running status monitoring method specifically includes the following contents:
[0054] Step S101: collect the number of active threads, the total number of threads and the number of waiting tasks through the heartbeat probe, query the currently effective number of core threads, the maximum number of threads and the queue capacity in the parameter version library; divide the number of active threads by the number of core threads to calculate the core thread utilization rate, divide the total number of threads by the maximum number of threads to calculate the maximum thread utilization rate, and divide the number of waiting tasks by the queue capacity to calculate the queue utilization rate; perform weighted moving average of the three utilization rate indicators within the time window, wherein the weight coefficient decays exponentially with time;
[0055] Optionally, in this embodiment, this step describes the collection and processing process of the core monitoring indicators of the thread pool, and realizes the accurate measurement of the thread pool utilization efficiency through real-time data collection and scientific calculation methods.
[0056] The heartbeat probe uses an asynchronous non-blocking collection mechanism to obtain the real-time running status of the thread pool through the JMX (Java Management Extensions) interface. The probe's collection frequency adopts an adaptive strategy, reducing the sampling frequency when the load is low and increasing the sampling frequency when the load increases, which not only ensures the real-time nature of the data but also avoids the performance overhead caused by oversampling. The collection process uses atomic operations to ensure data consistency and avoid data distortion caused by concurrent access.
[0057] The parameter version library adopts a distributed key-value storage structure, supporting multi-node concurrent access and version management. The query operation uses a secondary cache mechanism, and hot data is stored in local memory to reduce network access overhead. The parameters in the version library are organized by timestamp, supporting fast retrieval by time range, while maintaining the dependency between parameters to ensure the integrity of the parameter combination.
[0058] The usage calculation uses high-precision floating-point operations, and the calculation efficiency is improved through bit operation optimization. The calculation process takes into account the handling of zero division exceptions, and returns the preset default value when the denominator is zero. The usage calculation results are normalized and the value range is uniformly mapped to the [0,1] interval to facilitate subsequent data analysis and comparison.
[0059] The weighted moving average is implemented using sliding window technology, and the window size is dynamically adjusted according to the monitoring accuracy requirements. The time window is implemented using a ring buffer to support efficient data update and traversal. The weight coefficient is calculated using an exponential decay function: w(t) = e^(-λt), where λ is the decay factor and t is the time interval. The decay factor is selected based on the timeliness requirements of the data, and the optimal value is determined through parameter tuning.
[0060] The data processing process adopts a streaming computing model to organize data collection, computing, and storage into a processing pipeline. Asynchronous message queues are used to decouple the pipeline stages to improve processing throughput. At the same time, a back pressure mechanism is implemented to automatically adjust the data flow rate when the processing capacity is insufficient to prevent system overload.
[0061] This step solves several key problems in traditional thread pool monitoring: insufficient real-time monitoring data, low calculation accuracy, low utilization of historical data, etc. Through scientific data processing methods, accurate quantification of thread pool utilization efficiency is achieved.
[0062] The technical effect is significant: improved monitoring accuracy; enhanced real-time performance; improved computing efficiency; improved data availability. This method is particularly suitable for large-scale distributed systems with high performance requirements, and can accurately reflect the running status of the thread pool. Practice has proved that using this method for thread pool monitoring can improve monitoring accuracy by more than 50% and reduce monitoring overhead by more than 30%.
[0063] Step S102: Divide the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval, and a low-load interval, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate parameter rationality scores;
[0064] Optionally, in this embodiment, this step describes the core algorithm for thread pool parameter evaluation and optimization, and realizes accurate evaluation and dynamic optimization of thread pool parameters through multi-dimensional data analysis and scientific calculation methods.
[0065] The improved two-sample K-means clustering algorithm is used for interval division. First, the ratio sequence of the number of active threads to the number of core threads is preprocessed, and the median absolute deviation method is used to remove outliers. The clustering process adopts a dynamic distance calculation method, considering the time characteristics of the data points, so that the clustering results are more in line with the dynamic characteristics of the thread pool. The update of the cluster center adopts a batch update strategy to improve the convergence speed of the algorithm.
[0066] The interval feature analysis adopts the density estimation method. The kernel density estimation technique is used to calculate the data distribution of each interval, and the Gaussian kernel function with adaptive bandwidth is selected as the density estimator. By analyzing the distribution density and transition probability of the data in each interval, the stability characteristics of the interval distribution are extracted. The calculation of the optimization coefficient comprehensively considers the skewness and kurtosis of the data distribution, and normalizes it using the modified normal distribution probability density function.
[0067] The variance feature extraction adopts an improved time series analysis method. The exponentially weighted moving variance is used to calculate the fluctuation characteristics of the ratio sequence, and the weight coefficient decays exponentially with the time interval. The variance curve is processed by wavelet transform, and the main characteristics of the fluctuation are extracted through multi-scale analysis. The calculation of the adjustment coefficient uses an improved sigmoid function to ensure the continuity and smoothness of the coefficient.
[0068] The task processing capacity analysis adopts real-time statistical methods. The task growth rate and processing rate are calculated using a sliding time window, and the window size is dynamically adjusted according to the system response characteristics. The rate calculation adopts a linear regression method, taking into account the temporal correlation of the data. The calibration factor is generated using a logarithmic mapping function to ensure that the sensitivity of the factor to the task backlog decreases as the backlog increases.
[0069] The parameter evaluation adopts a multi-objective optimization method. The objective function of parameter evaluation is established, and the weights and constraints of performance indicators are comprehensively considered. The rationality score of the parameters is calculated using an improved fuzzy evaluation method. The evaluation indicators include parameter stability, resource utilization, and response time. The scoring results are mapped to a unified interval through min-max standardization.
[0070] This step solves the core problems in traditional thread pool parameter optimization: imprecise parameter adjustment, single optimization target, poor adaptability, etc. Through multi-dimensional parameter evaluation and dynamic optimization, precise control of thread pool parameters is achieved.
[0071] The technical effect is significant: improved parameter optimization accuracy; enhanced adaptability; improved resource utilization; improved performance stability. This method is particularly suitable for high-concurrency systems with drastic load changes, and can achieve accurate parameter optimization. Practice shows that using this method for parameter optimization can reduce the average response time of the thread pool by 40% and increase resource utilization by 35%.
[0072] Step S103: Count the performance improvement effect of each preset adjustment strategy from the historical adjustment records, and extract the adjustment strategy with the most significant performance improvement as the baseline strategy; calculate the current adjustment step based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the queue capacity calibration factor by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; record the adjustment suggestions and their calculation basis in the version library, and set corresponding effectiveness conditions.
[0073] Optionally, in this embodiment, this step describes the selection and execution process of the thread pool parameter adjustment strategy, and achieves precise control and continuous optimization of parameter adjustment through historical data analysis and adaptive calculation methods.
[0074] The statistics of historical adjustment records adopt the multi-dimensional time series analysis method. The performance indicators of each adjustment strategy are calculated by time window aggregation, including response time, throughput, resource utilization, etc. The performance improvement effect is evaluated using a normalized benefit function to unify the performance indicators of different dimensions to a comparable scale. The statistics of strategy effects adopt the weighted average method, and the weight coefficient decays over time to ensure that the most recent adjustment effect has a higher reference value.
[0075] The selection of the benchmark strategy adopts the improved multi-armed bandit algorithm. Each adjustment strategy is regarded as an option, and the expected return and uncertainty are calculated based on historical performance data. The strategy selection process comprehensively considers the balance between exploration and exploitation, and uses the upper confidence bound method to make decisions. The time decay factor is introduced in the selection process so that the strategy selection can adapt to the dynamic changes of the system load.
[0076] The calculation of the adjustment step size adopts the adaptive control theory. The adjustment step size of the core thread number is calculated based on the optimization coefficient and the benchmark ratio, and a nonlinear mapping function is introduced to handle extreme cases. The adjustment step size of the maximum thread number takes into account the system resource constraints and uses a saturation function to limit the adjustment range. The adjustment step size of the queue capacity is dynamically calculated through the calibration factor and the capacity ratio to ensure the smoothness of the adjustment.
[0077] Version management uses a distributed transaction processing mechanism. The record of adjustment suggestions contains the complete calculation process and basis, and supports rollback and audit. The setting of effective conditions is based on multi-dimensional constraints of system status, including load level, resource utilization, and time window. Version switching uses atomic operations to ensure the consistency of parameter adjustments.
[0078] The adjustment process implements a complete monitoring and feedback mechanism. By real-time monitoring of the adjustment effect, performance indicator change data is collected to dynamically evaluate the effectiveness of the adjustment strategy. The feedback data is analyzed through time series to extract trend features and is used to optimize subsequent adjustment decisions.
[0079] This step solves the key problems in traditional parameter adjustment: blind selection of adjustment strategy, unreasonable adjustment step length, inaccurate effect evaluation, etc. Through scientific strategy selection and precise step length calculation, intelligent control of parameter adjustment is achieved.
[0080] The technical effect is remarkable: the adjustment strategy is more accurate; the adjustment effect is more stable; the system adaptability is enhanced; and the performance improvement is more significant. This method is particularly suitable for complex dynamic load environments and can achieve continuous optimization of parameters. Practice has proved that using this method for parameter adjustment can increase the adjustment success rate by 45% and reduce the resource overhead of the adjustment process by 25%.
[0081] From the above description, it can be seen that the thread pool operation status monitoring method provided in the embodiment of the present application can divide the fluctuation range of the ratio of the number of active threads to the number of core threads into high-load intervals, normal intervals and low-load intervals, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as the calibration factor of the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate a parameter rationality score; count the performance improvement effect of each preset adjustment strategy from the historical adjustment records; calculate the current adjustment step based on the baseline strategy; record the adjustment suggestions and their calculation basis in the version library, and set the corresponding effective conditions, thereby improving the efficiency and accuracy of the thread pool operation status monitoring.
[0082] In one embodiment of the thread pool running status monitoring method of the present application, see Figure 2 , and can also include the following:
[0083] Step S201: read the real-time values of the three indicators of the number of active threads, the total number of threads, and the number of waiting tasks from the monitoring data collected by the probe, obtain the three parameter values of the currently effective number of core threads, the maximum number of threads, and the queue capacity from the configuration center, and perform data verification on the collected monitoring indicators to filter out abnormal values and invalid values;
[0084] Step S202: Divide the verified number of active threads by the number of core threads to calculate the core thread pool load level at the current moment, divide the total number of threads by the maximum number of threads to calculate the overall load level of the thread pool, divide the number of waiting tasks by the queue capacity to calculate the saturation level of the task queue, and normalize the calculation results to normalize the value range to the interval [0,1].
[0085] Optionally, in this embodiment, these two steps describe the data collection and preprocessing process of thread pool status monitoring, and through precise data collection and scientific preprocessing methods, real-time and accurate monitoring of the thread pool running status is achieved.
[0086] The data collection process uses a distributed asynchronous collection mechanism. The probe obtains the runtime status of the thread pool through the Java virtual machine management interface (JMX) and adopts a non-blocking collection method to minimize the impact on business threads. The collection frequency adopts an adaptive adjustment strategy to dynamically adjust the sampling interval according to the load status to ensure data real-time while avoiding oversampling. The collection operation uses atomic reading to ensure data consistency.
[0087] The configuration center adopts a distributed configuration management architecture, supporting real-time synchronization and version control of configuration. Configuration reading adopts a local cache mechanism, and reduces the access pressure of the configuration center through asynchronous updates. Cache updates use double buffering technology to ensure the atomicity of configuration switching. Configuration synchronization adopts a publish-subscribe model, supporting real-time push of configuration changes.
[0088] Data verification uses a multi-layer filtering mechanism. First, use range checks to filter out obvious outliers and set dynamic thresholds based on historical statistics. Then use the moving median method to detect mutation points and identify anomalies caused by short-term fluctuations. Finally, use machine learning models to identify abnormal patterns and filter complex abnormal patterns. The verification process retains complete metadata to support abnormal analysis and tracing.
[0089] Load calculation uses high-precision floating-point operations. The calculation of the core thread pool load level takes into account the transition characteristics of the thread state and uses a sliding average to eliminate instantaneous fluctuations. The calculation of the overall load level introduces a resource weight factor to reflect the resource consumption differences of different types of threads. The calculation of queue saturation takes into account the distribution of task priorities and uses a weighted average method for comprehensive evaluation.
[0090] The normalization process uses an improved min-max normalization method. The normalization process takes into account the physical meaning of the indicators and maintains the relative relationship of the data. An adaptive scaling factor is used to adapt to the dynamic changes in the indicator value range. The processing process includes a protection mechanism to prevent division by zero to ensure the validity of the calculation results.
[0091] These two steps solve several key problems in traditional monitoring: insufficient real-time data collection, the collection process affecting system performance, unstable data quality, etc. Through precise data collection and scientific preprocessing, high-quality monitoring data can be obtained.
[0092] The technical effect is significant: data collection is more efficient; data quality is more reliable; calculation results are more accurate; and the system impact is smaller. This method is particularly suitable for monitoring scenarios of large-scale distributed systems and can provide high-quality monitoring data. Practice has shown that using this method for data collection and processing can reduce data collection delay by 60% and reduce the proportion of abnormal data to less than 0.1%.
[0093] In one embodiment of the thread pool running status monitoring method of the present application, see Figure 3 , and can also include the following:
[0094] Step S301: Create a fixed-size circular array as a time window buffer, write the real-time calculation results of the core thread utilization, the maximum thread utilization, and the queue utilization into the corresponding buffer location, calculate the time interval of each sampling point based on the data writing time, and generate the corresponding weight attenuation coefficient through the negative time interval power of the exponential function e;
[0095] Step S302: traverse all data points in the time window, multiply the utilization value of each data point by the corresponding weight coefficient to obtain a weighted value, accumulate all weighted values and divide by the sum of the weight coefficients to obtain a weighted average result, and perform this calculation process for the three indicators of core thread utilization, maximum thread utilization, and queue utilization.
[0096] Optionally, in this embodiment, these two steps describe the time series data processing process of the thread pool usage rate, and through an efficient data storage structure and a scientific weighted calculation method, smoothing processing and trend analysis of the usage rate indicator are achieved.
[0097] The implementation of the circular array uses a lock-free ring buffer structure. The buffer size is determined by an adaptive algorithm, based on the balance between data update frequency and memory overhead. The array index is managed by atomic counters, and efficient circular access is achieved through bit operation optimization. Data writing uses a copy-on-write mechanism to ensure the atomicity and consistency of data updates. When the buffer is full, a sliding window strategy is used to automatically eliminate the earliest data points.
[0098] Timestamp management uses a high-precision time recording mechanism. The system monotonic clock is used to record the writing time of the data point to avoid the impact of system time adjustment. The time interval calculation takes into account the precision loss and uses double-precision floating point storage to ensure calculation accuracy. For abnormal time intervals, an automatic correction mechanism is implemented to maintain the continuity of the data sequence.
[0099] The weight calculation adopts an improved exponential decay model. The decay coefficient λ is determined by an adaptive algorithm and dynamically adjusted according to the timeliness requirements of the data. The weight calculation is optimized using a table lookup method, pre-calculating the commonly used exponential value range to improve calculation efficiency. For time intervals beyond the normal range, upper and lower limit constraints on the weight are implemented to avoid value overflow.
[0100] The weighted average calculation is implemented using a numerically stable algorithm. Data traversal uses vectorized operations to improve calculation efficiency. The accumulation process uses the Kahan summation algorithm to reduce floating-point accumulation errors. The weight normalization process uses pre-calculated cumulative weights to avoid repeated calculations. The calculation results are ensured to be within the valid range through numerical correction.
[0101] The data processing process implements a complete exception handling mechanism. For missing data, interpolation methods are used to supplement and maintain the continuity of the data sequence. For outliers, automatic identification and smoothing are implemented to reduce the impact on the calculation results. The processing process includes complete log records to support problem tracking and analysis.
[0102] These two steps solve the key problems in traditional time series data processing: low data storage efficiency, insufficient calculation accuracy, high processing delay, etc. Through efficient data structure and precise calculation method, real-time processing of usage data is achieved.
[0103] The technical effect is remarkable: improved storage efficiency; enhanced calculation accuracy; reduced processing delay; good result stability. This method is particularly suitable for high-frequency data processing scenarios and can provide high-quality statistical results. Practice has shown that using this method for data processing can reduce processing delay by 70% and control calculation errors within 0.1%.
[0104] In one embodiment of the thread pool running status monitoring method of the present application, see Figure 4 , and can also include the following:
[0105] Step S401: read the historical sequence of the ratio of the number of active threads to the number of core threads in the monitoring data, automatically group the ratio data using a two-sample K-means clustering algorithm, calculate the central value and variance of each group, divide the ratio range into a high-load interval, a normal interval, and a low-load interval according to the clustering result, and record the interval boundary values to the configuration center;
[0106] Step S402: Count the data distribution density of each interval in the time window, calculate the data proportion of the high-load interval and the low-load interval, take the difference between the proportions of the two intervals and the ratio of the data proportion of the normal interval as the basic coefficient, and use the probability density function of the normal distribution to correct the basic coefficient to obtain the optimization coefficient of the number of core threads.
[0107] Optionally, in this embodiment, these two steps describe the dynamic division of thread pool load intervals and the optimization coefficient calculation process, and through intelligent clustering algorithms and probabilistic statistical methods, accurate identification of load states and parameter optimization are achieved.
[0108] The two-sample K-means clustering adopts an improved iterative algorithm. First, the comparison value sequence is preprocessed, and the exponential smoothing method is used to eliminate short-term fluctuations. The clustering initialization adopts the improved k-means++ method, and the initial center point is selected through probability distribution. The iterative process uses a batch update strategy and introduces an adaptive learning rate to accelerate the convergence speed. The clustering process takes into account the time series characteristics of the data, and the time-weighted distance calculation method is used to make the clustering results more consistent with the dynamic characteristics of the system.
[0109] The dynamic threshold method is used to determine the interval boundary. The interquartile range method is used to calculate the boundary value by analyzing the distribution characteristics of the cluster center. The boundary calculation takes into account the skewness of the data, and the rationality of the interval division is ensured by skewness correction. The update of the boundary value adopts a gradual adjustment strategy to avoid frequent fluctuations. The persistence of interval information adopts atomic writing to ensure the consistency of configuration updates.
[0110] The kernel density estimation method is used for distribution density statistics. The Gaussian kernel function with adaptive bandwidth is used for density estimation, and the bandwidth selection is dynamically adjusted based on the Silverman criterion. The density calculation process is optimized by fast Fourier transform to improve the calculation efficiency. For data sparse areas, the boundary correction technology is used to improve the estimation accuracy.
[0111] The calculation of interval proportion adopts the cumulative distribution method. The data proportion of each interval is calculated by numerical integration. The integration process uses the adaptive Simpson's rule to ensure the calculation accuracy. The calculation of the proportion difference takes into account the temporal correlation of the data, and uses the time-weighted method to highlight the importance of recent data.
[0112] The generation of optimization coefficients adopts the probability density correction method. The calculation of the basic coefficients comprehensively considers the balance and stability of the interval distribution. The normal distribution correction process uses a standardized probability density function, and the parameters are determined by maximum likelihood estimation. The correction process includes numerical stability processing to ensure that the coefficients are within the valid range.
[0113] These two steps solve the key problems in traditional load interval division: inaccurate interval division, inflexible boundary fixation, unreasonable optimization parameters, etc. Through intelligent interval division and precise coefficient calculation, accurate identification of load status is achieved.
[0114] The technical effect is significant: more accurate interval division; stronger adaptability; better optimization effect; higher computational efficiency. This method is particularly suitable for application scenarios with variable load patterns and can accurately identify system status. Practice has shown that using this method for load analysis can increase the accuracy of state identification by 55% and reduce computational overhead by 40%.
[0115] In one embodiment of the thread pool running status monitoring method of the present application, see Figure 5 , and can also include the following:
[0116] Step S501: Calculate the mean of the ratio sequence of the total number of threads to the maximum number of threads in the sampling window, subtract the mean from the ratio of each sampling point and square it to obtain the square of deviation, sum all the square of deviations and divide it by the number of sampling points to obtain the variance value, apply sliding window calculation to the variance sequence to obtain the variance change curve;
[0117] Step S502: Perform Fourier transform on the variance change curve to extract the fluctuation period and amplitude characteristics, calculate the deviation rate by comparing the amplitude of the main frequency component with the preset steady-state threshold, and use the sigmoid function to map the deviation rate to the [-1,1] interval to obtain the adjustment coefficient of the maximum number of threads, wherein the adjustment coefficient reflects the stability of thread pool capacity utilization.
[0118] Optionally, in this embodiment, these two steps describe the analysis process of thread pool capacity utilization volatility, and through statistical methods and signal processing technology, quantitative evaluation and parameter optimization of thread pool stability are achieved.
[0119] The variance calculation uses an improved online algorithm. The Welford online algorithm is used to calculate the mean and variance to avoid repeated data scanning and reduce numerical accumulation errors. The size of the sampling window is determined by an adaptive algorithm and dynamically adjusted based on the time correlation characteristics of the data. The deviation calculation uses a numerically stable calculation method, and large values are processed through logarithmic transformation to prevent numerical overflow. The window sliding process uses a ring buffer optimization to improve memory usage efficiency.
[0120] The sliding window analysis uses a weighted moving statistics method. The window weight is generated using a cubic spline function to ensure a smooth transition. The boundary processing uses a mirror filling technique to reduce edge effects. The window update uses an incremental calculation strategy to only calculate the changed part to improve the calculation efficiency. The variance curve is generated using interpolation smoothing to ensure the continuity of the curve.
[0121] The Fourier transform uses the fast Fourier transform (FFT) algorithm. The data is preprocessed before the transformation, including detrending and windowing to reduce spectrum leakage. The FFT calculation uses the radix-2 split radix algorithm, and the performance is optimized through bit reversal and butterfly operations. The spectrum analysis uses power spectral density estimation, and the Welch method is used to improve the reliability of the estimation.
[0122] The feature extraction adopts the peak detection method. The local maximum detection algorithm with adaptive threshold is used to identify the main frequency components. The amplitude features are extracted by spectrum envelope analysis and the instantaneous amplitude is calculated using Hilbert transform. The periodic features are verified by autocorrelation analysis to ensure the significance of the features.
[0123] The deviation rate is calculated using a multi-scale comparison method. The detected amplitude characteristics are compared with the steady-state thresholds of multiple time scales to comprehensively evaluate the stability of the system. The comparison process takes into account the influence of noise and filters out unreliable deviations through confidence interval analysis.
[0124] Sigmoid mapping uses an improved activation function. The function parameters are determined through historical data training to ensure that the sensitivity of the mapping is moderate. The mapping process includes temperature parameter adjustment to control the steepness of the function. The generation of the adjustment coefficient takes into account the response characteristics of the system and avoids drastic changes through smoothing.
[0125] These two steps solve the key problems in traditional stability analysis: inaccurate extraction of fluctuation characteristics, incomplete stability assessment, unreasonable parameter adjustment, etc. Through precise feature analysis and scientific parameter mapping, quantitative assessment of stability is achieved.
[0126] The technical effect is significant: feature extraction is more accurate; evaluation is more comprehensive; adjustment is more reasonable; and calculation is more efficient. This method is particularly suitable for dynamic load environments and can accurately evaluate system stability. Practice has shown that using this method for stability analysis can increase the accuracy of fluctuation feature recognition by 65% and reduce calculation delay by 50%.
[0127] In one embodiment of the thread pool running status monitoring method of the present application, see Figure 6 , and can also include the following:
[0128] Step S601: Obtain the number of newly added tasks to be processed per unit time through the thread pool monitoring interface, calculate the rate of change of the task queue length over time to obtain the task growth rate, and at the same time calculate the rate of change of the number of completed tasks over time to obtain the task processing rate, and apply Kalman filtering to the two rate sequences to eliminate random fluctuations;
[0129] Step S602: Subtract the task processing rate from the smoothed task growth rate to obtain the task backlog change rate, use the exponential smoothing method to predict the task backlog level in the future time window, and map the ratio of the predicted value to the queue capacity through a logarithmic function to obtain the queue capacity calibration factor.
[0130] Optionally, in this embodiment, these two steps describe the dynamic analysis process of thread pool task traffic, and through time series analysis and prediction technology, accurate evaluation of task processing capabilities and dynamic optimization of queue parameters are achieved.
[0131] Monitoring data collection is implemented using high-precision counters. Atomic counters are used to record changes in the number of tasks to ensure counting accuracy in a multi-threaded environment. The time interval for data collection is dynamically adjusted through an adaptive algorithm to strike a balance between accuracy and overhead. Counter overflow is processed by cyclic counting, and the accuracy of long-term operation is ensured by difference calculation. The rate of change calculation uses the central difference method to improve the accuracy of derivative estimation.
[0132] Kalman filtering uses an improved state estimation model. The state vector contains two components: rate value and acceleration. The dynamic characteristics of the system are described by the state equation. The covariance matrix of observation noise and process noise is estimated by an adaptive algorithm to achieve dynamic adjustment of the filter parameters. The filtering process uses a sequential processing method to reduce the complexity of matrix operations. The prediction step uses a second-order state equation to improve the prediction accuracy.
[0133] The task backlog analysis uses the differential accumulation method. The cumulative backlog is calculated by integration, and the trapezoidal rule is used to improve the integration accuracy. The calculation of the backlog change rate takes into account the processing delay of the system, and the delay effect is processed by time offset compensation. The positive and negative signs of the change rate are smoothed to determine the trend to avoid the interference of instantaneous fluctuations.
[0134] The exponential smoothing forecast uses a cubic exponential smoothing model. The smoothing parameters are optimized by the least squares method to automatically adapt to the trend characteristics of the data. The forecast process includes trend terms and seasonal terms to capture cyclical changes. The forecast interval is estimated by the Bootstrap method to provide a confidence assessment of the forecast. The model update uses online learning to continuously optimize the forecast performance.
[0135] The calibration factor calculation uses logarithmic compression mapping. The base of the logarithmic function is selected based on the data distribution characteristics to ensure that the sensitivity of the mapping is appropriate. The mapping process includes threshold limits to prevent over-adjustment caused by extreme values. The calibration factor smoothing uses low-pass filtering to eliminate high-frequency oscillations.
[0136] These two steps solve the key problems in traditional queue management: inaccurate traffic prediction, untimely parameter adjustment, unreasonable capacity planning, etc. Through precise traffic analysis and prediction, intelligent optimization of queue parameters is achieved.
[0137] The technical effect is significant: traffic prediction is more accurate; parameter adjustment is more timely; resource utilization is more efficient; and the system is more stable. This method is particularly suitable for scenarios with large load fluctuations and can accurately predict system requirements. Practice has shown that using this method for queue management can increase prediction accuracy by 70% and resource utilization by 45%.
[0138] In one embodiment of the thread pool running status monitoring method of the present application, see Figure 7 , and can also include the following:
[0139] Step S701: Read reasonable interval boundary values of the three parameters of the number of core threads, the maximum number of threads and the queue capacity from the configuration center, map the optimization coefficient, the adjustment coefficient and the calibration factor calculated in the parameter evaluation to the corresponding interval range respectively, calculate the deviation degree of each evaluation result from the interval boundary, and apply the inverse tangent function to normalize the deviation value;
[0140] Step S702: Set different weight coefficients for the three parameters to reflect their importance in the thread pool operation, multiply the normalized deviation value by the corresponding weight coefficient to obtain a weighted score, sum the three weighted scores and map them to a score range of 0 to 100 through min-max normalization to obtain the final parameter rationality score.
[0141] Optionally, in this embodiment, these two steps describe the comprehensive evaluation process of thread pool parameters, and through multi-dimensional analysis and a scientific scoring mechanism, quantitative evaluation and optimization guidance of parameter configuration are achieved.
[0142] Parameter interval reading uses distributed configuration management. Version control mechanism is used to ensure configuration consistency, and observer mode is used to achieve real-time perception of configuration changes. Interval boundary values are stored in compression encoding to reduce storage space usage. The configuration reading process includes a fault-tolerant mechanism to ensure service availability by backing up the configuration source.
[0143] Coefficient mapping uses piecewise linear interpolation. Multiple mapping intervals are divided according to parameter characteristics, and different mapping functions are used in each interval. The mapping process considers the correlation between parameters and maintains the coordination of parameters through constraints. Soft constraints are used for boundary processing to allow parameters to fluctuate within a reasonable range.
[0144] The deviation calculation uses an improved distance metric. The Mahalanobis distance is used to consider the correlation between parameters, and the weights of each dimension are adjusted through the covariance matrix. The distance calculation process includes outlier detection, and the modified Z-score method is used to identify abnormal configurations. The accumulation of deviation values uses an exponential weighting method to highlight the importance of recent changes.
[0145] The normalization process uses an improved inverse tangent function. The function parameters are optimized through historical data to ensure that the sensitivity of the mapping is moderate. The normalization process includes scaling factor adjustment to adapt to the value range of different parameters. The numerical calculation uses Taylor expansion optimization to improve the calculation efficiency.
[0146] The weight allocation adopts the hierarchical analysis method. The judgment matrix is constructed through pairwise comparison, and the weight vector is calculated using the eigenvalue method. The weight calculation takes into account the consistency test to ensure the rationality of the weight allocation. The weight update adopts the incremental learning method and is dynamically adjusted according to the system performance.
[0147] The standardized mapping uses an improved min-max method. The dynamic boundary value is calculated by sliding the window to adapt to the changes in parameter distribution. The mapping process includes outlier processing, and the quantile method is used to determine the truncation threshold. The score calculation uses smoothing to avoid drastic fluctuations in the score.
[0148] These two steps solve the key problems in traditional parameter evaluation: single evaluation dimension, unreasonable weight distribution, inconsistent scoring standards, etc. Through multi-dimensional comprehensive analysis and scientific scoring mechanism, objective evaluation of parameter configuration is achieved.
[0149] The technical effect is significant: the evaluation is more comprehensive; the weight is more reasonable; the scoring is more objective; and the adaptability is stronger. This method is particularly suitable for complex configuration scenarios and can accurately evaluate the rationality of parameters. Practice has shown that using this method for parameter evaluation can increase the configuration optimization efficiency by 60% and shorten the parameter tuning time by 55%.
[0150] The innovation of the method is reflected in the combination of multi-dimensional evaluation methods and scientific weighting systems. Through precise quantitative analysis and a reasonable scoring mechanism, the objective evaluation of parameter configuration is achieved. At the same time, the stability and reliability of the evaluation process are ensured through a perfect numerical processing mechanism. This comprehensive evaluation method provides a reliable decision-making basis for the parameter optimization of the thread pool.
[0151] In order to improve the efficiency and accuracy of thread pool running status monitoring, the present application provides an embodiment of a thread pool running status monitoring device for implementing all or part of the content of the thread pool running status monitoring method, see Figure 8 , the thread pool running status monitoring device specifically includes the following contents:
[0152] The weight determination module 10 is used to collect the number of active threads, the total number of threads and the number of waiting tasks through the heartbeat probe, and query the currently effective number of core threads, the maximum number of threads and the queue capacity in the parameter version library; divide the number of active threads by the number of core threads to calculate the core thread utilization rate, divide the total number of threads by the maximum number of threads to calculate the maximum thread utilization rate, and divide the number of waiting tasks by the queue capacity to calculate the queue utilization rate; perform weighted moving average of the three utilization rate indicators within the time window, wherein the weight coefficient decays exponentially with time;
[0153] The parameter rationality evaluation module 20 is used to divide the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval and a low-load interval, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate a parameter rationality score;
[0154] The thread adjustment module 30 is used to count the performance improvement effect of each preset adjustment strategy from the historical adjustment records, and extract the adjustment strategy with the most significant performance improvement as the baseline strategy; calculate the current adjustment step based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the queue capacity calibration factor by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; recording the adjustment suggestions and their calculation basis in the version library, and setting corresponding effectiveness conditions.
[0155] From the above description, it can be seen that the thread pool operation status monitoring device provided in the embodiment of the present application can divide the fluctuation range of the ratio of the number of active threads to the number of core threads into high-load intervals, normal intervals and low-load intervals, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as the calibration factor of the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate a parameter rationality score; count the performance improvement effect of each preset adjustment strategy from the historical adjustment records; calculate the current adjustment step based on the baseline strategy; record the adjustment suggestions and their calculation basis in the version library, and set the corresponding effective conditions, thereby improving the efficiency and accuracy of the thread pool operation status monitoring.
[0156] From the hardware level, in order to improve the efficiency and accuracy of monitoring the running status of the thread pool, the present application provides an embodiment of an electronic device for implementing all or part of the contents of the thread pool running status monitoring method, and the electronic device specifically includes the following contents:
[0157] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the thread pool operation status monitoring device and related devices such as the core business system, user terminal and related database; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the thread pool operation status monitoring method and the embodiment of the thread pool operation status monitoring device in the embodiment, and the contents thereof are incorporated herein, and the repeated parts are not repeated.
[0158] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.
[0159] In practical applications, part of the thread pool running state monitoring method can be executed on the electronic device side as described above, or all operations can be completed in the client device. Specifically, it can be selected according to the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.
[0160] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.
[0161] Fig. 9 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Fig. 9As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0162] In one embodiment, the thread pool running status monitoring method function may be integrated into the central processing unit 9100. The central processing unit 9100 may be configured to perform the following control:
[0163] Step S101: collect the number of active threads, the total number of threads and the number of waiting tasks through the heartbeat probe, query the currently effective number of core threads, the maximum number of threads and the queue capacity in the parameter version library; divide the number of active threads by the number of core threads to calculate the core thread utilization rate, divide the total number of threads by the maximum number of threads to calculate the maximum thread utilization rate, and divide the number of waiting tasks by the queue capacity to calculate the queue utilization rate; perform weighted moving average of the three utilization rate indicators within the time window, wherein the weight coefficient decays exponentially with time;
[0164] Step S102: Divide the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval, and a low-load interval, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate parameter rationality scores;
[0165] Step S103: Count the performance improvement effect of each preset adjustment strategy from the historical adjustment records, and extract the adjustment strategy with the most significant performance improvement as the baseline strategy; calculate the current adjustment step based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the queue capacity calibration factor by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; record the adjustment suggestions and their calculation basis in the version library, and set corresponding effectiveness conditions.
[0166] From the above description, it can be seen that the electronic device provided in the embodiment of the present application divides the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval and a low-load interval, and calculates the optimization coefficient of the core thread based on the interval distribution characteristics; calculates the variance of the ratio of the total number of threads to the maximum number of threads, and extracts the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; uses the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compares the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generates a parameter rationality score; counts the performance improvement effect of each preset adjustment strategy from the historical adjustment records; calculates the current adjustment step size based on the baseline strategy; records the adjustment suggestions and their calculation basis in the version library, and sets corresponding effectiveness conditions, thereby improving the efficiency and accuracy of thread pool operation status monitoring.
[0167] In another embodiment, the thread pool operation status monitoring device can be configured separately from the central processing unit 9100. For example, the thread pool operation status monitoring device can be configured as a chip connected to the central processing unit 9100, and the thread pool operation status monitoring method function is implemented through the control of the central processing unit.
[0168] like Fig. 9 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Fig. 9 In addition, the electronic device 9600 may also include Fig. 9 For components not shown, reference may be made to the prior art.
[0169] like Fig. 9 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.
[0170] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0171] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0172] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.
[0173] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0174] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0175] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.
[0176] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps in the thread pool running status monitoring method in the above embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps in the thread pool running status monitoring method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0177] Step S101: collect the number of active threads, the total number of threads and the number of waiting tasks through the heartbeat probe, query the currently effective number of core threads, the maximum number of threads and the queue capacity in the parameter version library; divide the number of active threads by the number of core threads to calculate the core thread utilization rate, divide the total number of threads by the maximum number of threads to calculate the maximum thread utilization rate, and divide the number of waiting tasks by the queue capacity to calculate the queue utilization rate; perform weighted moving average of the three utilization rate indicators within the time window, wherein the weight coefficient decays exponentially with time;
[0178] Step S102: Divide the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval, and a low-load interval, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate parameter rationality scores;
[0179] Step S103: Count the performance improvement effect of each preset adjustment strategy from the historical adjustment records, and extract the adjustment strategy with the most significant performance improvement as the baseline strategy; calculate the current adjustment step based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the queue capacity calibration factor by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; record the adjustment suggestions and their calculation basis in the version library, and set corresponding effectiveness conditions.
[0180] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application divides the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval and a low-load interval, and calculates the optimization coefficient of the core thread based on the interval distribution characteristics; calculates the variance of the ratio of the total number of threads to the maximum number of threads, and extracts the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; uses the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compares the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generates a parameter rationality score; counts the performance improvement effect of each preset adjustment strategy from the historical adjustment records; calculates the current adjustment step size based on the baseline strategy; records the adjustment suggestions and their calculation basis in the version library, and sets corresponding effectiveness conditions, thereby improving the efficiency and accuracy of thread pool operation status monitoring.
[0181] The embodiments of the present application also provide a computer program product capable of implementing all the steps in the thread pool running state monitoring method in the above embodiment, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the thread pool running state monitoring method are implemented. For example, the computer program / instruction implements the following steps:
[0182] Step S101: collect the number of active threads, the total number of threads and the number of waiting tasks through the heartbeat probe, query the currently effective number of core threads, the maximum number of threads and the queue capacity in the parameter version library; divide the number of active threads by the number of core threads to calculate the core thread utilization rate, divide the total number of threads by the maximum number of threads to calculate the maximum thread utilization rate, and divide the number of waiting tasks by the queue capacity to calculate the queue utilization rate; perform weighted moving average of the three utilization rate indicators within the time window, wherein the weight coefficient decays exponentially with time;
[0183] Step S102: Divide the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval, and a low-load interval, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate parameter rationality scores;
[0184] Step S103: Count the performance improvement effect of each preset adjustment strategy from the historical adjustment records, and extract the adjustment strategy with the most significant performance improvement as the baseline strategy; calculate the current adjustment step based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the queue capacity calibration factor by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; record the adjustment suggestions and their calculation basis in the version library, and set corresponding effectiveness conditions.
[0185] From the above description, it can be seen that the computer program product provided in the embodiment of the present application divides the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval and a low-load interval, and calculates the optimization coefficient of the core thread based on the interval distribution characteristics; calculates the variance of the ratio of the total number of threads to the maximum number of threads, and extracts the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; uses the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; compares the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generates a parameter rationality score; counts the performance improvement effect of each preset adjustment strategy from the historical adjustment records; calculates the current adjustment step size based on the baseline strategy; records the adjustment suggestions and their calculation basis in the version library, and sets corresponding effectiveness conditions, thereby improving the efficiency and accuracy of thread pool operation status monitoring.
[0186] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention 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 code.
[0187] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device 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.
[0188] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising 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.
[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing 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.
[0190] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A thread pool running status monitoring method, characterized in that: The method comprises: The number of active threads, total number of threads and number of waiting tasks are collected through the heartbeat probe, and the number of core threads, maximum number of threads and queue capacity currently in effect are queried in the parameter version library; the core thread utilization rate is calculated by dividing the number of active threads by the number of core threads, the maximum thread utilization rate is calculated by dividing the total number of threads by the maximum number of threads, and the queue utilization rate is calculated by dividing the number of waiting tasks by the queue capacity; the weighted moving average of the three utilization rate indicators is performed within the time window, where the weight coefficient decays exponentially with time; The fluctuation range of the ratio of the number of active threads to the number of core threads is divided into high-load intervals, normal intervals, and low-load intervals, and the optimization coefficient of the core thread is calculated based on the interval distribution characteristics; the variance of the ratio of the total number of threads to the maximum number of threads is calculated, and the adjustment coefficient of the maximum thread is extracted through the fluctuation characteristics of the variance curve; the difference between the task growth rate and the processing rate is used as the calibration factor of the queue capacity; the evaluation results of the three parameters are compared with the preset reasonable interval boundaries to generate parameter rationality scores; The performance improvement effect of each preset adjustment strategy is counted from the historical adjustment records, and the adjustment strategy with the most significant performance improvement is extracted as the baseline strategy; the current adjustment step is calculated based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the calibration factor of the queue capacity by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; the adjustment suggestions and their calculation basis are recorded in the version library, and the corresponding effective conditions are set.
2. The thread pool running status monitoring method according to claim 1, characterized in that: The core thread utilization rate is calculated by dividing the number of active threads by the number of core threads, the maximum thread utilization rate is calculated by dividing the total number of threads by the maximum number of threads, and the queue utilization rate is calculated by dividing the number of waiting tasks by the queue capacity, including: Read the real-time values of the three indicators of active threads, total threads, and waiting tasks from the monitoring data collected by the probe, obtain the three parameter values of the currently effective number of core threads, maximum number of threads, and queue capacity from the configuration center, and perform data verification on the collected monitoring indicators to filter out abnormal values and invalid values; Divide the verified number of active threads by the number of core threads to calculate the core thread pool load level at the current moment, divide the total number of threads by the maximum number of threads to calculate the overall load level of the thread pool, divide the number of waiting tasks by the queue capacity to calculate the saturation of the task queue, and normalize the calculation results to the [0,1] interval.
3. The thread pool running status monitoring method according to claim 1, characterized in that: The weighted moving average of the three usage rate indicators within the time window, wherein the weight coefficient decays exponentially over time, includes: Create a fixed-size circular array as a time window buffer, write the real-time calculation results of core thread utilization, maximum thread utilization, and queue utilization into the corresponding buffer location, calculate the time interval of each sampling point based on the data writing time, and generate the corresponding weight attenuation coefficient through the exponential function e to the negative power of the time interval; Traverse all data points in the time window, multiply the utilization value of each data point by the corresponding weight coefficient to get the weighted value, accumulate all weighted values and divide them by the sum of the weight coefficients to get the weighted average result, and perform this calculation process for the three indicators of core thread utilization, maximum thread utilization, and queue utilization.
4. The thread pool running status monitoring method according to claim 1, characterized in that: The method divides the fluctuation range of the ratio of the number of active threads to the number of core threads into a high-load interval, a normal interval, and a low-load interval, and calculates the optimization coefficient of the core thread based on the interval distribution characteristics, including: Read the historical sequence of the ratio of the number of active threads to the number of core threads in the monitoring data, automatically group the ratio data using the two-sample K-means clustering algorithm, calculate the central value and variance of each group, divide the ratio range into high-load interval, normal interval and low-load interval according to the clustering results, and record the interval boundary values to the configuration center; The data distribution density of each interval in the statistical time window is calculated, and the data proportion of the high-load interval and the low-load interval is calculated. The difference between the proportions of the two intervals and the ratio of the data proportion of the normal interval are used as the basic coefficient. The basic coefficient is corrected using the probability density function of the normal distribution to obtain the optimization coefficient of the number of core threads.
5. The thread pool running status monitoring method according to claim 1, characterized in that: The calculating the variance of the ratio of the total number of threads to the maximum number of threads and extracting the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve includes: Calculate the mean of the ratio sequence of the total number of threads to the maximum number of threads within the sampling window, subtract the mean from the ratio of each sampling point and square it to get the square of the deviation, sum all the squares of the deviation and divide it by the number of sampling points to get the variance value, apply the sliding window calculation to the variance sequence to get the variance change curve; The variance change curve is subjected to Fourier transform to extract the fluctuation period and amplitude characteristics, the amplitude of the main frequency component is compared with the preset steady-state threshold to calculate the deviation rate, and the sigmoid function is used to map the deviation rate to the [-1,1] interval to obtain the adjustment coefficient of the maximum number of threads, wherein the adjustment coefficient reflects the stability of thread pool capacity utilization.
6. The thread pool running status monitoring method according to claim 1, characterized in that: The method of using the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity includes: The number of newly added tasks to be processed per unit time is obtained through the thread pool monitoring interface, and the rate of change of the task queue length over time is calculated to obtain the task growth rate. At the same time, the rate of change of the number of completed tasks over time is calculated to obtain the task processing rate. Kalman filtering is applied to the two rate sequences to eliminate random fluctuations; The task backlog change rate is obtained by subtracting the task processing rate from the smoothed task growth rate. The exponential smoothing method is used to predict the task backlog degree in the future time window. The ratio of the predicted value to the queue capacity is mapped through a logarithmic function to obtain the queue capacity calibration factor.
7. The thread pool running status monitoring method according to claim 1, characterized in that: The evaluation results of the three parameters are compared with the preset reasonable interval boundaries to generate parameter rationality scores, including: Read the reasonable interval boundary values of the three parameters of core thread number, maximum thread number and queue capacity from the configuration center, map the optimization coefficient, adjustment coefficient and calibration factor calculated in the parameter evaluation to the corresponding interval range, calculate the deviation degree of each evaluation result from the interval boundary, and apply the inverse tangent function to normalize the deviation value; Different weight coefficients are set for the three parameters to reflect their importance in the thread pool operation. The normalized deviation value is multiplied by the corresponding weight coefficient to obtain a weighted score. The three weighted scores are summed and mapped to a score range of 0 to 100 through min-max normalization to obtain the final parameter rationality score.
8. A thread pool operation status monitoring device, characterized in that: The device comprises: The weight determination module is used to collect the number of active threads, the total number of threads and the number of waiting tasks through the heartbeat probe, and query the currently effective number of core threads, the maximum number of threads and the queue capacity in the parameter version library; the core thread utilization rate is calculated by dividing the number of active threads by the number of core threads, the maximum thread utilization rate is calculated by dividing the total number of threads by the maximum number of threads, and the queue utilization rate is calculated by dividing the number of waiting tasks by the queue capacity; the weighted moving average of the three utilization rate indicators is performed within the time window, where the weight coefficient decays exponentially with time; The parameter rationality evaluation module is used to divide the fluctuation range of the ratio of the number of active threads to the number of core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of the core thread based on the interval distribution characteristics; calculate the variance of the ratio of the total number of threads to the maximum number of threads, and extract the adjustment coefficient of the maximum thread through the fluctuation characteristics of the variance curve; use the difference between the task growth rate and the processing rate as the calibration factor of the queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries respectively, and generate parameter rationality scores; The thread adjustment module is used to count the performance improvement effect of each preset adjustment strategy from the historical adjustment records, and extract the adjustment strategy with the most significant performance improvement as the baseline strategy; calculate the current adjustment step based on the baseline strategy, specifically including: multiplying the optimization coefficient of the core thread by the thread number adjustment ratio in the baseline strategy to obtain the core thread number adjustment step, multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the baseline strategy to obtain the maximum thread number adjustment step, and multiplying the calibration factor of the queue capacity by the capacity adjustment ratio in the baseline strategy to obtain the queue capacity adjustment step; record the adjustment suggestions and their calculation basis in the version library, and set the corresponding effectiveness conditions.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the thread pool operation status monitoring method described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the thread pool operation status monitoring method described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Storage system performance optimization method and system, electronic equipment and storage medium
CN112463367A
Task processing-based thread scheduling method, device and equipment
CN115033369A
Method and device for built-in monitoring alarm of dynamic thread pool
CN116560834A
Thread count adjusting method and device
CN117076058A
Dynamic adaptive adjustment method, system and equipment for thread pool and storage medium
CN117707758A
Cited By
Vehicle surround view camera calibration method, system and device and computer medium
CN120525969A
Database thread pool dynamic capacity expansion and contraction method and device and electronic equipment
CN120743883A
Dynamic time window differential message queue monitoring system for adaptive resource scheduling
CN121743132A
A dynamic time window difference message queue monitoring system for adaptive resource scheduling
CN121743132B
Dynamic regular collaborative scheduling processing method for time sequence information data
CN122285231A