Thread pool runtime status monitoring method and device
By collecting thread pool status indicators, performing weighted moving averages and interval divisions, calculating optimization and adjustment coefficients, and generating a rationality score, the shortcomings of existing monitoring solutions are addressed, achieving efficient and accurate monitoring of thread pool status and intelligent parameter optimization.
Patent Information
- Application Number
- CN202411749235.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-12-02
AI Technical Summary
Existing thread pool monitoring solutions lack in-depth analysis and predictive capabilities, cannot dynamically adjust the importance of indicators, are slow to respond to sudden load changes, and historical monitoring data is not fully explored. Adjustment strategies rely on experience-based judgment, leading to discrepancies between monitoring results and actual conditions.
The thread pool status indicators are collected by heartbeat probes, and weighted moving average and exponential decay are applied to divide the load range, calculate optimization coefficients and adjustment coefficients, generate parameter rationality scores, select a benchmark strategy based on historical adjustment records, calculate the adjustment step size and record suggestions.
It achieves high efficiency and accuracy in thread pool status monitoring, improves monitoring precision and real-time performance, optimizes the accuracy and adaptability of parameter adjustment, and reduces resource overhead.
Smart Images

Figure CN119718819B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, specifically to a method and apparatus for monitoring the running status of a thread pool. Background Technology
[0002] Thread pool status monitoring plays an increasingly important role in modern 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 predictive capabilities regarding the thread pool's operational status. Although some systems have introduced more complex monitoring metrics, they still appear rather rudimentary in terms of data collection, analysis, and decision-making.
[0003] Current monitoring systems generally suffer from fixed indicator weights and a single evaluation dimension. Most solutions cannot dynamically adjust the importance of various indicators based on the actual system operation, leading to discrepancies between monitoring results and actual operating conditions. Furthermore, existing solutions are slow to react to sudden load changes, making it difficult to promptly detect and warn of potential performance issues.
[0004] Another significant problem is that the value of monitoring data is not fully explored. A large amount of historical monitoring data is used only for simple display and archiving, without establishing an effective data analysis mechanism to guide subsequent parameter optimization. In particular, the selection of adjustment strategies often relies on experience-based judgment without data support, resulting in less than ideal adjustment effects.
[0005] Therefore, the industry needs a more intelligent and comprehensive thread pool status monitoring solution. Summary of the Invention
[0006] To address the problems in the prior art, this application provides a method and apparatus for monitoring the running status of a thread pool, which improves the efficiency and accuracy of thread pool running status monitoring.
[0007] To solve at least one of the above problems, this application provides the following technical solution:
[0008] Firstly, this application provides a method for monitoring the running status of a thread pool, including:
[0009] The system collects active thread count, total thread count, and waiting task count using heartbeat probes. It then queries the parameter version library for the currently active core thread count, maximum thread count, and queue capacity. The core thread utilization rate is calculated by dividing the active thread count by the core thread count, the maximum thread utilization rate is calculated by dividing the total thread count by the maximum thread count, and the queue utilization rate is calculated by dividing the waiting task count by the queue capacity. A weighted moving average is then applied to these three utilization metrics over a time window, with the weighting coefficients decaying exponentially over time.
[0010] The fluctuation range of the ratio of active threads to core threads is divided into high-load, normal, and low-load intervals. The optimization coefficient of core threads is calculated based on the interval distribution characteristics. The variance of the ratio of total threads to maximum threads is calculated, and the adjustment coefficient of maximum threads 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 for the queue capacity. The evaluation results of the three parameters are compared with the preset reasonable interval boundaries to generate parameter reasonableness scores.
[0011] The performance improvement effect of each preset adjustment strategy is statistically analyzed from historical adjustment records, and the adjustment strategy with the most significant performance improvement is extracted as the benchmark strategy. Based on the benchmark strategy, the current adjustment step size is calculated, specifically including: multiplying the optimization coefficient of core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number adjustment step size; multiplying the adjustment coefficient of maximum threads by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number adjustment step size; and multiplying the calibration factor of queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity adjustment step size. The adjustment suggestions and their calculation basis are recorded in the version control system, and the corresponding effective conditions are set.
[0012] Furthermore, the calculation of core thread utilization by dividing the number of active threads by the number of core threads, the calculation of maximum thread utilization by dividing the total number of threads by the maximum number of threads, and the calculation of queue utilization by dividing the number of waiting tasks by the queue capacity include:
[0013] Read the real-time values of three indicators—active thread count, total thread count, and waiting task count—from the monitoring data collected by the probe. Obtain the values of three parameters—currently active core thread count, maximum thread count, and queue capacity—from the configuration center. Perform data validation on the collected monitoring indicators to filter out abnormal and invalid values.
[0014] The current core thread pool load level is calculated by dividing the verified number of active threads by the core thread count. The overall thread pool load level is calculated by dividing the total number of threads by the maximum number of threads. The saturation level of the task queue is calculated by dividing the number of waiting tasks by the queue capacity. The calculation results are then standardized to normalize the value range to the [0,1] interval.
[0015] Furthermore, the weighted moving average of the three usage rate indicators over a time window, wherein the weighting coefficients decay 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 to the corresponding buffer positions, calculate the time interval of each sampling point based on the data writing time, and generate the corresponding weight decay coefficient by exponential function e raised to the negative time interval.
[0017] Iterate through all data points within the time window, multiply the utilization rate of each data point by the corresponding weight coefficient to obtain a weighted value, sum all weighted values and divide by the sum of weight coefficients to obtain a weighted average result. Perform this calculation process on the three indicators of core thread utilization, maximum thread utilization, and queue utilization respectively.
[0018] Furthermore, the step of dividing the fluctuation range of the ratio of active threads to core threads into high-load, normal, and low-load intervals, and calculating the optimization coefficient of core threads based on the interval distribution characteristics, includes:
[0019] Read the historical sequence of the ratio of active threads to core threads in the monitoring data, automatically group the ratio data using the two-sample K-means clustering algorithm, calculate the center 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 in the configuration center.
[0020] The data distribution density of each interval within the statistical time window is calculated, the data proportion of the high-load interval and the low-load interval is calculated, and 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 probability density function of the normal distribution is used to correct the basic coefficient to obtain the optimization coefficient of the core thread number.
[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 for the maximum number of threads through the fluctuation characteristics of the variance curve, includes:
[0022] Within the sampling window, calculate the mean of the ratio sequence of total thread count to maximum thread count. Subtract the mean from the ratio of each sampling point and square it to obtain the squared deviation. Sum all the squared deviations and divide by the number of sampling points to obtain the variance value. Apply a sliding window to the variance sequence to calculate the variance change curve.
[0023] Fourier transform is performed on the variance change curve to extract the fluctuation period and amplitude features. The deviation rate is calculated by comparing the amplitude of the main frequency components with the preset steady-state threshold. The deviation rate is mapped to the [-1,1] interval using the sigmoid function to obtain the adjustment coefficient of the maximum number of threads. The adjustment coefficient reflects the stability of the thread pool capacity utilization.
[0024] Furthermore, the step 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 new pending tasks added per unit time is obtained through the thread pool monitoring interface. The task growth rate is obtained by calculating the rate of change of the task queue length over time. At the same time, the task processing rate is obtained by calculating the rate of change of the number of completed tasks over time. 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 task backlog level is predicted using the exponential smoothing method. The ratio of the predicted value to the queue capacity is mapped using a logarithmic function to obtain the queue capacity calibration factor.
[0027] Furthermore, the step of comparing the evaluation results of the three parameters with preset reasonable interval boundaries to generate a parameter reasonableness score includes:
[0028] Read the reasonable range boundary values of the three parameters, namely, core thread count, maximum thread count, and queue capacity, from the configuration center. Map the optimization coefficient, adjustment coefficient, and calibration factor calculated in the parameter evaluation to the corresponding range. Calculate the degree of deviation of each evaluation result from the range boundary and normalize the deviation value by applying the arctangent function.
[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 the score range of 0 to 100 through min-max standardization to obtain the final parameter rationality score.
[0030] Secondly, this application provides a thread pool runtime status monitoring device, comprising:
[0031] The weight determination module is used to collect the number of active threads, total threads, and waiting tasks through heartbeat probes, and query the currently effective core thread count, maximum thread count, and 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 thread count by the maximum thread count, and the queue utilization rate is calculated by dividing the number of waiting tasks by the queue capacity; a weighted moving average is applied to the three utilization indicators within a time window, where the weight coefficient decays exponentially over time;
[0032] The parameter rationality evaluation module is used to divide the fluctuation range of the ratio of active threads to core threads into high-load, normal, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics; calculate the variance of the ratio of total threads to maximum threads, and extract the adjustment coefficient of maximum threads through the fluctuation characteristics of the variance curve; use the difference between task growth rate and processing rate as a calibration factor for queue capacity; and compare the evaluation results of the three parameters with the preset reasonable interval boundaries to generate a parameter rationality score.
[0033] The thread tuning module is used to statistically analyze the performance improvement effect of each preset tuning strategy from historical tuning records, extract the tuning strategy with the most significant performance improvement as the benchmark strategy, and calculate the current tuning step size based on the benchmark strategy. Specifically, it includes: multiplying the optimization coefficient of core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number tuning step size; multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number tuning step size; and multiplying the calibration factor of queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity tuning step size. The tuning suggestions and their calculation basis are recorded in the version control library, and the corresponding effective conditions are set.
[0034] Thirdly, this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the thread pool running status monitoring method.
[0035] Fourthly, this 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 state monitoring method described above.
[0036] Fifthly, this application provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the steps of the thread pool running state monitoring method.
[0037] As can be seen from the above technical solution, this application provides a method and apparatus for monitoring the running status of a thread pool. It divides the fluctuation range of the ratio of active threads to core threads into high-load, normal, and low-load intervals, and calculates the optimization coefficient of core threads based on interval distribution characteristics; calculates the variance of the ratio of total threads to maximum threads, and extracts the adjustment coefficient of the maximum threads through the fluctuation characteristics of the variance curve; uses the difference between the task growth rate and processing rate as a calibration factor for queue capacity; compares the evaluation results of the three parameters with preset reasonable interval boundaries to generate parameter reasonableness scores; statistically analyzes the performance improvement effect of each preset adjustment strategy from historical adjustment records; calculates the current adjustment step size based on the benchmark strategy; and records the adjustment suggestions and their calculation basis in the version control system and sets corresponding effective conditions, thereby improving the efficiency and accuracy of thread pool running status monitoring. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is one of the flowcharts illustrating the thread pool running status monitoring method in this application embodiment;
[0040] Figure 2 This is the second flowchart illustrating the thread pool running status monitoring method in this application embodiment;
[0041] Figure 3 This is the third flowchart illustrating the thread pool running status monitoring method in this application embodiment;
[0042] Figure 4 This is the fourth flowchart illustrating the thread pool running status monitoring method in this application embodiment;
[0043] Figure 5 This is the fifth flowchart illustrating the thread pool running status monitoring method in this application embodiment;
[0044] Figure 6 This is the sixth flowchart illustrating the thread pool running status monitoring method in this application embodiment;
[0045] Figure 7 This is the seventh flowchart illustrating the thread pool running status monitoring method in this application embodiment;
[0046] Figure 8 This is a structural diagram of the thread pool running status monitoring device in the embodiments of this application;
[0047] Figure 9 This is a schematic diagram of the structure of the electronic device in the embodiments of this application.
[0048] Figure label:
[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 storage unit 9144, antenna 9111, speaker 9131, microphone 9132. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0051] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0052] In view of the problems existing in the prior art, this application provides a method and apparatus for monitoring the running status of a thread pool. The method divides the fluctuation range of the ratio of active threads to core threads into high-load, normal, and low-load intervals, and calculates the optimization coefficient of core threads based on the interval distribution characteristics. It calculates the variance of the ratio of total threads to maximum threads, and extracts the adjustment coefficient of the maximum threads based on the fluctuation characteristics of the variance curve. It uses the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity. The evaluation results of the three parameters are compared with preset reasonable interval boundaries to generate parameter reasonableness scores. The performance improvement effect of each preset adjustment strategy is statistically analyzed from historical adjustment records. The current adjustment step size is calculated based on this benchmark strategy. Adjustment suggestions and their calculation basis are recorded in the version control library, and corresponding effective conditions are set. This improves the efficiency and accuracy of thread pool running status monitoring.
[0053] To improve the efficiency and accuracy of thread pool runtime status monitoring, this application provides an embodiment of a thread pool runtime status monitoring method, see [link to embodiment]. Figure 1 The thread pool runtime status monitoring method specifically includes the following:
[0054] Step S101: Collect the number of active threads, total threads, and waiting tasks using a heartbeat probe; query the currently active core thread count, maximum thread count, and queue capacity in the parameter version library; calculate the core thread utilization rate by dividing the number of active threads by the number of core threads, calculate the maximum thread utilization rate by dividing the total thread count by the maximum thread count, and calculate the queue utilization rate by dividing the number of waiting tasks by the queue capacity; perform a weighted moving average over a time window on the three utilization metrics, where the weight coefficient decays exponentially over time.
[0055] Optionally, in this embodiment, this step describes the collection and processing of core monitoring metrics for the thread pool. Through real-time data collection and scientific calculation methods, the efficiency of thread pool usage is accurately measured.
[0056] The heartbeat probe employs an asynchronous, non-blocking data acquisition mechanism, obtaining the real-time running status of the thread pool through the JMX (Java Management Extensions) interface. The probe's sampling frequency uses an adaptive strategy, reducing the sampling frequency when the load is low and increasing it when the load is high, ensuring data real-time performance while avoiding the performance overhead of oversampling. The acquisition process uses atomic operations to ensure data consistency and avoid data distortion caused by concurrent access.
[0057] The parameter repository employs a distributed key-value storage structure, supporting concurrent access and version management across multiple nodes. Query operations utilize a two-level caching mechanism, storing frequently accessed data in local memory to reduce network access overhead. Parameters in the repository are organized by timestamps, supporting fast retrieval by time range while maintaining dependencies between parameters to ensure the integrity of parameter combinations.
[0058] Utilization rate calculation employs high-precision floating-point arithmetic, with bitwise operations optimized to improve computational efficiency. The calculation process incorporates handling of division-by-zero exceptions, returning a preset default value when the denominator is zero. The utilization rate calculation results are normalized, mapping the value range uniformly to the [0,1] interval for easier subsequent data analysis and comparison.
[0059] The weighted moving average is implemented using a sliding window technique, with the window size dynamically adjusted according to the monitoring accuracy requirements. The time window is implemented using a circular buffer, supporting efficient data updates and traversal. The weighting coefficients are 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 its optimal value is determined through parameter tuning.
[0060] The data processing employs a streaming computing model, organizing data acquisition, computation, and storage into a processing pipeline. Asynchronous message queues decouple the different stages of the pipeline, improving processing throughput. A backpressure mechanism is also implemented to automatically adjust the data flow rate when processing capacity is insufficient, preventing system overload.
[0061] This step addresses several key issues in traditional thread pool monitoring: insufficient real-time monitoring data, low computational precision, and low utilization of historical data. Through scientific data processing methods, it achieves precise quantification of thread pool usage efficiency.
[0062] Significant technical benefits: improved monitoring accuracy; enhanced real-time performance; increased computational efficiency; and improved data availability. This method is particularly suitable for large-scale distributed systems with high performance requirements, accurately reflecting the operational status of the thread pool. Practical experience has shown that using this method for thread pool monitoring can improve monitoring accuracy by more than 50% while reducing monitoring overhead by more than 30%.
[0063] Step S102: Divide the fluctuation range of the ratio of active threads to core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics; calculate the variance of the ratio of total threads to maximum threads, and extract the adjustment coefficient of maximum threads through the fluctuation characteristics of the variance curve; use the difference between task growth rate and processing rate as the calibration factor for queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries to generate parameter reasonableness scores.
[0064] Optionally, in this embodiment, this step describes the core algorithm for thread pool parameter evaluation and optimization. Through multi-dimensional data analysis and scientific calculation methods, accurate evaluation and dynamic optimization of thread pool parameters are achieved.
[0065] The interval partitioning employs an improved two-sample K-means clustering algorithm. First, the sequence of ratios of active threads to core threads is preprocessed, and outliers are removed using the median absolute deviation method. The clustering process uses a dynamic distance calculation method, considering the temporal characteristics of the data points, making the clustering results more consistent with the dynamic characteristics of the thread pool. A batch update strategy is used to update the cluster centers, improving the algorithm's convergence speed.
[0066] Interval feature analysis employs a density estimation method. Kernel density estimation is used to calculate the data distribution in each interval, with an adaptive bandwidth Gaussian kernel function selected as the density estimator. By analyzing the data distribution density and transition probabilities in each interval, the stability characteristics of the interval distribution are extracted. The calculation of optimization coefficients comprehensively considers the skewness and kurtosis of the data distribution, and normalization is performed using a modified normal distribution probability density function.
[0067] An improved time series analysis method was used for variance feature extraction. The volatility characteristics of the ratio series were calculated using exponentially weighted moving variance, with the weighting coefficients decaying exponentially with time intervals. Wavelet transform was employed to process the variance curve, and multi-scale analysis was used to extract the main volatility features. An improved sigmoid function was used to calculate the adjustment coefficients, ensuring their continuity and smoothness.
[0068] Task processing capacity analysis employs real-time statistical methods. A sliding time window is used to calculate the task growth rate and processing rate, with the window size dynamically adjusted based on system response characteristics. Rate calculation utilizes linear regression, taking into account the temporal correlation of the data. Calibration factors are generated using a logarithmic mapping function, ensuring that the factors' sensitivity to task backlog decreases as the backlog increases.
[0069] Parameter evaluation employs a multi-objective optimization method. An objective function for parameter evaluation is established, comprehensively considering the weights of performance indicators and constraints. An improved fuzzy evaluation method is used to calculate the rationality score of the parameters, with evaluation indicators including parameter stability, resource utilization, and response time. The scoring results are mapped to a unified interval through min-max standardization.
[0070] This step addresses the core problems in traditional thread pool parameter optimization: imprecise parameter tuning, singular optimization goals, and poor adaptability. Through multi-dimensional parameter evaluation and dynamic optimization, precise control of thread pool parameters is achieved.
[0071] Significant technical benefits: improved parameter optimization accuracy; enhanced adaptability; increased resource utilization; and improved performance stability. This method is particularly suitable for high-concurrency systems with drastic load changes, enabling precise parameter optimization. Practical experience 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: Analyze 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 benchmark strategy; calculate the current adjustment step size based on the benchmark strategy, specifically including: multiplying the optimization coefficient of core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number adjustment step size; multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number adjustment step size; multiplying the calibration factor of queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity adjustment step size; record the adjustment suggestions and their calculation basis in the version control library, and set the corresponding effective conditions.
[0073] Optionally, in this embodiment, this step describes the selection and execution process of the thread pool parameter adjustment strategy. Through historical data analysis and adaptive calculation methods, precise control and continuous optimization of parameter adjustment are achieved.
[0074] The historical adjustment records are statistically analyzed using multidimensional time series analysis. Performance metrics for each adjustment strategy are calculated by aggregating data across time windows, including response time, throughput, and resource utilization. The performance improvement effect is evaluated using a normalized payoff function, unifying performance metrics across different dimensions to a comparable scale. The strategy effectiveness is statistically analyzed using a weighted average method, with weight coefficients decaying over time to ensure that the most recent adjustments have higher reference value.
[0075] The baseline strategy selection employs an improved multi-armed gambling machine algorithm. Each adjustment strategy is treated as an option, and expected returns and uncertainties are calculated based on historical performance data. The strategy selection process comprehensively considers the balance between exploration and exploitation, using an upper confidence bound method for decision-making. A time decay factor is introduced during the selection process to allow the strategy selection to adapt to dynamic changes in system load.
[0076] The adjustment step size is calculated using adaptive control theory. The adjustment step size for the core thread count is calculated based on optimization coefficients and a baseline ratio, and a nonlinear mapping function is introduced to handle extreme cases. The adjustment step size for the maximum thread count takes into account system resource constraints and uses a saturation function to limit the adjustment magnitude. The adjustment step size for the queue capacity is dynamically calculated using a calibration factor and a capacity ratio to ensure smooth adjustment.
[0077] Version management employs a distributed transaction processing mechanism. Adjustment recommendations are recorded with complete calculation processes and justifications, supporting rollback and auditing. Effective conditions are set based on multi-dimensional constraints of system status, including load levels, resource utilization, and time windows. Version switching utilizes atomic operations to ensure consistency in parameter adjustments.
[0078] The adjustment process incorporates a complete monitoring and feedback mechanism. By monitoring the adjustment effects in real time and collecting data on performance indicator changes, the effectiveness of the adjustment strategy is dynamically evaluated. Feedback data is analyzed over time to extract trend characteristics, which are then used to optimize subsequent adjustment decisions.
[0079] This step solves key problems in traditional parameter adjustment: blind selection of adjustment strategies, unreasonable adjustment step sizes, and inaccurate effect evaluation. Through scientific strategy selection and precise step size calculation, intelligent control of parameter adjustment is achieved.
[0080] Significant technical benefits: more precise adjustment strategies; more stable adjustment effects; enhanced system adaptability; and more significant performance improvements. This method is particularly suitable for complex dynamic load environments, enabling continuous parameter optimization. Practical experience shows that using this method for parameter adjustment can increase the success rate by 45% while reducing resource overhead during the adjustment process by 25%.
[0081] As described above, the thread pool running status monitoring method provided in this application can divide the fluctuation range of the ratio of active threads to core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics; calculate the variance of the ratio of total threads to maximum threads, and extract the adjustment coefficient of maximum threads 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 to generate parameter reasonableness scores; statistically analyze the performance improvement effect of each preset adjustment strategy from historical adjustment records; calculate the current adjustment step size based on the benchmark 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 thread pool running status monitoring.
[0082] In one embodiment of the thread pool runtime status monitoring method of this application, see [link to relevant documentation]. Figure 2 It can also specifically include the following:
[0083] Step S201: Read the real-time values of three indicators—active thread count, total thread count, and waiting task count—from the monitoring data collected by the probe; obtain the three parameter values—currently active core thread count, maximum thread count, and queue capacity—from the configuration center; and perform data verification on the collected monitoring indicators to filter out abnormal and invalid values.
[0084] Step S202: Divide the verified number of active threads by the number of core threads to calculate the current core thread pool load level; divide the total number of threads by the maximum number of threads to calculate the overall thread pool load level; divide the number of waiting tasks by the queue capacity to calculate the saturation level of the task queue; and standardize the calculation results to normalize the value range to the [0,1] interval.
[0085] Optionally, in this embodiment, these two steps describe the data acquisition and preprocessing process for thread pool status monitoring. Through precise data acquisition and scientific preprocessing methods, real-time and accurate monitoring of the thread pool's running status is achieved.
[0086] The data acquisition process employs a distributed asynchronous acquisition mechanism. The probe obtains the thread pool runtime status through the Java Virtual Machine's management interface (JMX), using a non-blocking acquisition method to minimize the impact on business threads. The acquisition frequency uses an adaptive adjustment strategy, dynamically adjusting the sampling interval based on load conditions to ensure data real-time performance while avoiding oversampling. Atomic reads are used in the acquisition operation to ensure data consistency.
[0087] The configuration center adopts a distributed configuration management architecture, supporting real-time configuration synchronization and version control. Configuration reading utilizes a local caching mechanism, reducing access pressure on the configuration center through asynchronous updates. Cache updates employ double buffering technology to ensure the atomicity of configuration switching. Configuration synchronization adopts a publish-subscribe pattern, supporting real-time push of configuration changes.
[0088] Data validation employs a multi-layered filtering mechanism. First, a range check filters for obvious outliers, setting dynamic thresholds based on historical statistics. Then, a moving median method is used to detect abrupt changes and identify anomalies caused by short-term fluctuations. Finally, a machine learning model is used for anomaly pattern recognition, filtering out complex anomaly patterns. The validation process retains complete metadata, supporting anomaly analysis and traceability.
[0089] Load calculations employ high-precision floating-point arithmetic. The core thread pool load level calculation considers thread state transitions and uses a moving average to eliminate instantaneous fluctuations. The overall load level calculation incorporates a resource weighting factor to reflect the resource consumption differences among different thread types. Queue saturation calculations consider task priority distribution and use a weighted average method for comprehensive evaluation.
[0090] The standardization process employs an improved min-max normalization method. This normalization process considers the physical meaning of the indicators and preserves the relative relationships of the data. An adaptive scaling factor is used to accommodate dynamic changes in the range of indicator values. The processing includes a protection mechanism to prevent division by zero, ensuring the validity of the calculation results.
[0091] These two steps address several key issues in traditional monitoring: insufficient real-time data acquisition, the impact of the acquisition process on system performance, and unstable data quality. Through precise data acquisition and scientific preprocessing, high-quality monitoring data is achieved.
[0092] Significant technical benefits: more efficient data acquisition; more reliable data quality; more accurate calculation results; and less impact on the system. This method is particularly suitable for monitoring scenarios in large-scale distributed systems, providing high-quality monitoring data. Practice shows that using this method for data acquisition and processing can reduce data acquisition latency by 60% while reducing the proportion of abnormal data to below 0.1%.
[0093] In one embodiment of the thread pool runtime status monitoring method of this application, see [link to relevant documentation]. Figure 3 It can also specifically include the following:
[0094] Step S301: 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 positions, calculate the time interval of each sampling point based on the data writing time, and generate the corresponding weight decay coefficient by exponential function e raised to the negative time interval.
[0095] Step S302: Traverse all data points within the time window, multiply the utilization rate value of each data point by the corresponding weight coefficient to obtain the weighted value, sum all weighted values and divide by the sum of weight coefficients to obtain the weighted average result, and perform this calculation process for the three indicators of core thread utilization, maximum thread utilization, and queue utilization respectively.
[0096] Optionally, in this embodiment, these two steps describe the time-series data processing of thread pool utilization. Through efficient data storage structure and scientific weighted calculation method, smooth processing and trend analysis of utilization indicators are achieved.
[0097] The circular array is implemented using a lock-free circular buffer structure. The buffer size is determined by an adaptive algorithm, balancing data update frequency and memory overhead. Array indices are managed using atomic counters, with bitwise operations optimizing efficient circular access. Data writing employs a copy-on-write mechanism to ensure atomicity and consistency of data updates. When the buffer is full, a sliding window strategy is used to automatically evict the oldest data point.
[0098] Timestamp management employs a high-precision time recording mechanism. The system's monotonic clock is used to record the write time of data points, avoiding the impact of system time adjustments. Time interval calculations account for precision loss, using 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 employs an improved exponential decay model. The decay coefficient λ is determined through an adaptive algorithm and dynamically adjusted according to the timeliness requirements of the data. Weight calculation is optimized using a lookup table method, pre-calculating the range of commonly used exponential values to improve computational efficiency. For time intervals exceeding the normal range, upper and lower bound constraints on the weights are implemented to prevent numerical overflow.
[0100] The weighted average calculation employs a numerically stable algorithm. Data traversal uses vectorized operations to improve computational 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 redundant calculations. The calculation results are numerically corrected to ensure they remain within the valid range.
[0101] The data processing procedure implements a complete anomaly handling mechanism. For missing data, interpolation methods are used to supplement it, maintaining the continuity of the data sequence. For outliers, automatic identification and smoothing are implemented to reduce their impact on the calculation results. The processing procedure includes complete logging to support problem tracking and analysis.
[0102] These two steps address key issues in traditional time-series data processing: low data storage efficiency, insufficient computational accuracy, and high processing latency. Through efficient data structures and precise calculation methods, real-time processing of utilization data is achieved.
[0103] Significant technical benefits: improved storage efficiency; enhanced computational accuracy; reduced processing latency; and good result stability. This method is particularly suitable for high-frequency data processing scenarios, providing high-quality statistical results. Practical experience shows that using this method for data processing can reduce processing latency by 70% while keeping computational errors within 0.1%.
[0104] In one embodiment of the thread pool runtime status monitoring method of this application, see [link to relevant documentation]. Figure 4 It can also specifically include the following:
[0105] Step S401: Read the historical sequence of the ratio of active threads to core threads in the monitoring data, automatically group the ratio data using the two-sample K-means clustering algorithm, calculate the center 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 in the configuration center.
[0106] Step S402: Calculate the data distribution density of each interval within the statistical time window, calculate the data proportion of the high-load interval and the low-load interval, use 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 core thread number.
[0107] Optionally, in this embodiment, these two steps describe the dynamic partitioning of the thread pool load interval and the calculation of optimization coefficients. Through intelligent clustering algorithms and probabilistic statistical methods, accurate identification of load status and parameter optimization are achieved.
[0108] Two-sample K-means clustering employs an improved iterative algorithm. First, the comparison value sequences are preprocessed, using exponential smoothing to eliminate short-term fluctuations. Cluster initialization uses an improved k-means++ method, selecting initial centroids based on probability distribution. The iterative process employs a batch update strategy and introduces an adaptive learning rate to accelerate convergence. The clustering process considers the temporal characteristics of the data, using a time-weighted distance calculation method to make the clustering results more consistent with the dynamic characteristics of the system.
[0109] A dynamic threshold method is used to determine interval boundaries. Boundary values are calculated using the interquartile range (IMR) method by analyzing the distribution characteristics of cluster centers. Boundary calculations take into account data skewness, and skewness correction ensures the rationality of interval division. A gradual adjustment strategy is used to update boundary values to avoid frequent fluctuations. Atomic writes are used to persist interval information, ensuring consistency in configuration updates.
[0110] The distribution density statistics employ a kernel density estimation method. An adaptive bandwidth Gaussian kernel function is used for density estimation, with the bandwidth dynamically adjusted based on the Silverman criterion. The density calculation process is optimized using Fast Fourier Transform to improve computational efficiency. For sparse data regions, boundary correction techniques are used to enhance estimation accuracy.
[0111] The cumulative distribution method was used to calculate the proportion of data in each interval. Numerical integration was employed to determine the proportion of data in each interval, using an adaptive Simpson's law to ensure accuracy. The calculation of the proportion difference took into account the temporal correlation of the data, using a time-weighted method to highlight the importance of recent data.
[0112] The optimization coefficients are generated using a 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 through maximum likelihood estimation. The correction process includes numerical stability handling to ensure that the coefficients are within the effective range.
[0113] These two steps solve key problems in traditional load zone partitioning: inaccurate partitioning, inflexible fixed boundaries, and unreasonable optimization parameters. Through intelligent partitioning and precise coefficient calculation, accurate identification of load states is achieved.
[0114] Significant technical benefits: more accurate interval partitioning; stronger adaptability; better optimization results; and higher computational efficiency. This method is particularly suitable for application scenarios with variable load patterns, accurately identifying system states. Practice shows that using this method for load analysis can improve state identification accuracy by 55% while reducing computational overhead by 40%.
[0115] In one embodiment of the thread pool runtime status monitoring method of this application, see [link to relevant documentation]. Figure 5 It can also specifically include the following:
[0116] Step S501: Calculate the mean of the ratio sequence of total number of threads to maximum number of threads within the sampling window. Subtract the mean from the ratio of each sampling point and square it to obtain the squared deviation. Sum all the squared deviations and divide by the number of sampling points to obtain the variance value. Apply a sliding window to the variance sequence to calculate the variance change curve.
[0117] Step S502: Perform Fourier transform on the variance change curve to extract the fluctuation period and amplitude features. Calculate the deviation rate between the amplitude of the main frequency components and the preset steady-state threshold. Use the sigmoid function to map the deviation rate to the [-1,1] interval to obtain the adjustment coefficient for the maximum number of threads. The adjustment coefficient reflects the stability of the 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 techniques, the quantitative evaluation of thread pool stability and parameter optimization are achieved.
[0119] Variance calculation employs an improved online algorithm. The Welford online algorithm is used to calculate the mean and variance, avoiding repeated data scanning and reducing numerical accumulation errors. The sampling window size is determined using an adaptive algorithm, dynamically adjusted based on the temporal correlation characteristics of the data. Deviation calculation uses a numerically stable method, handling large values through logarithmic transformation to prevent numerical overflow. The window sliding process is optimized using a circular buffer to improve memory utilization efficiency.
[0120] The sliding window analysis employs a weighted moving average statistical method. Window weights are generated using a cubic spline function to ensure a smooth transition. Mirror filling is used for boundary handling to reduce edge effects. Window updates utilize an incremental calculation strategy, calculating only the changed portions to improve computational efficiency. Interpolation smoothing is used to generate the variance curve, ensuring its continuity.
[0121] The Fourier transform employs the Fast Fourier Transform (FFT) algorithm. Data preprocessing, including detrending and windowing, is performed before the transform to reduce spectral leakage. The FFT calculation uses a radix-2 split-basis algorithm, with performance optimized through bit inversion and butterfly operations. Spectral analysis employs power spectral density estimation, using the Welch method to improve the reliability of the estimation.
[0122] Feature extraction employs peak detection methods. A local maximum detection algorithm with adaptive thresholding is used to identify the main frequency components. Amplitude features are extracted through spectral envelope analysis, and instantaneous amplitude is calculated using Hilbert transform. Periodic features are validated through autocorrelation analysis to ensure their significance.
[0123] The deviation rate is calculated using a multi-scale comparison method. The detected amplitude characteristics are compared with steady-state thresholds at multiple time scales to comprehensively evaluate the system's stability. The comparison process takes noise into account and uses confidence interval analysis to filter out unreliable deviations.
[0124] The Sigmoid mapping employs an improved activation function. The function parameters are determined through training on historical data to ensure moderate sensitivity. The mapping process includes temperature parameter adjustment to control the steepness of the function. The generation of the adjustment coefficients takes into account the system's response characteristics, avoiding drastic changes through smoothing.
[0125] These two steps address key issues in traditional stability analysis: inaccurate fluctuation feature extraction, incomplete stability assessment, and unreasonable parameter tuning. Through precise feature analysis and scientific parameter mapping, a quantitative assessment of stability is achieved.
[0126] Significant technical benefits: more accurate feature extraction; more comprehensive evaluation; more reasonable adjustments; and more efficient computation. This method is particularly suitable for dynamic load environments, enabling accurate assessment of system stability. Practical experience shows that using this method for stability analysis can improve the accuracy of fluctuation feature identification by 65% while reducing computational latency by 50%.
[0127] In one embodiment of the thread pool runtime status monitoring method of this application, see [link to relevant documentation]. Figure 6 It can also specifically include the following:
[0128] Step S601: Obtain the number of newly added pending tasks 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. 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 within the future time window. Map the predicted value to the queue capacity using 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. Through time series analysis and prediction techniques, accurate assessment of task processing capacity and dynamic optimization of queue parameters are achieved.
[0131] Monitoring data acquisition is implemented using high-precision counters. Atomic counters are used to record changes in the number of tasks, ensuring counting accuracy in a multi-threaded environment. The data acquisition time interval is dynamically adjusted through an adaptive algorithm, achieving a balance between accuracy and overhead. Counter overflow is handled using loop counting, and difference calculations ensure long-term accuracy. The rate of change calculation uses the central difference method to improve the accuracy of derivative estimation.
[0132] Kalman filtering employs an improved state estimation model. The state vector contains two components: velocity and acceleration, and the dynamic characteristics of the system are described by state equations. The covariance matrix of observation noise and process noise is estimated using an adaptive algorithm, enabling dynamic adjustment of the filter parameters. The filtering process uses a sequential approach to reduce the complexity of matrix operations. The prediction step uses second-order state equations to improve prediction accuracy.
[0133] Task backlog analysis employs a differential accumulation method. The accumulated backlog is calculated through integration, and the trapezoidal rule is used to improve integration accuracy. The calculation of the backlog change rate takes into account system processing latency, and time offset compensation is used to mitigate the impact of latency. The sign of the change rate is determined through smoothing to identify the trend and avoid interference from instantaneous fluctuations.
[0134] Exponential smoothing forecasts employ a cubic exponential smoothing model. The smoothing parameters are optimized using the least squares method, automatically adapting to the trend characteristics of the data. The forecasting process includes trend and seasonal terms, capturing periodic variations. The forecast interval is estimated using the bootstrap method, providing a confidence assessment of the forecast. Model updates utilize online learning to continuously optimize forecasting performance.
[0135] The calibration factor is calculated using a logarithmic compression mapping. The cardinality of the logarithmic function is selected based on the data distribution characteristics to ensure appropriate mapping sensitivity. The mapping process includes threshold constraints to prevent over-adjustment caused by extreme values. Low-pass filtering is used for smoothing the calibration factor to eliminate high-frequency oscillations.
[0136] These two steps address key issues in traditional queue management: inaccurate traffic forecasting, untimely parameter adjustments, and inadequate capacity planning. Through precise traffic analysis and forecasting, intelligent optimization of queue parameters is achieved.
[0137] Significant technical benefits: more accurate traffic prediction; more timely parameter adjustments; more efficient resource utilization; and more stable system. This method is particularly suitable for scenarios with large load fluctuations, accurately predicting system demand. Practice shows that using this method for queue management can improve prediction accuracy by 70% while increasing resource utilization by 45%.
[0138] In one embodiment of the thread pool runtime status monitoring method of this application, see [link to relevant documentation]. Figure 7 It can also specifically include the following:
[0139] Step S701: Read the reasonable interval boundary values of the three parameters, namely, core thread count, maximum thread count 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 degree of deviation of each evaluation result from the interval boundary and normalize the deviation value by applying the arctangent function.
[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 with the corresponding weight coefficient to obtain a weighted score. Sum the three weighted scores and map them to the score range of 0 to 100 through min-max standardization to obtain the final parameter rationality score.
[0141] Optionally, in this embodiment, these two steps describe a comprehensive evaluation process for thread pool parameters. Through multi-dimensional analysis and a scientific scoring mechanism, quantitative evaluation and optimization guidance for parameter configuration are achieved.
[0142] Parameter range reading employs distributed configuration management. Version control ensures configuration consistency, and the observer pattern enables real-time awareness of configuration changes. Range boundary values are stored using compressed encoding to reduce storage space consumption. The configuration reading process includes fault tolerance mechanisms, and backups of the configuration source ensure service availability.
[0143] The coefficient mapping employs a piecewise linear interpolation method. Multiple mapping intervals are defined based on parameter characteristics, with each interval using a different mapping function. The mapping process considers the correlation between parameters and maintains parameter consistency through constraints. Boundary handling uses soft constraints, allowing parameters to fluctuate within a reasonable range.
[0144] Deviation calculation employs an improved distance metric. The Mahalanobis distance is used to account for the correlation between parameters, and the weights of each dimension are adjusted using the covariance matrix. Outlier detection is included in the distance calculation process, using a modified Z-score method to identify anomalous configurations. The accumulation of deviations is exponentially weighted to highlight the importance of recent changes.
[0145] The normalization process employs a modified arctangent function. The function parameters are optimized using historical data to ensure appropriate mapping sensitivity. The normalization process includes scaling factor adjustment to accommodate different parameter ranges. Numerical computation utilizes Taylor expansion optimization to improve computational efficiency.
[0146] Weight allocation employs the analytic hierarchy process (AHP). A judgment matrix is constructed through pairwise comparisons, and the weight vector is calculated using the eigenvalue method. Consistency checks are incorporated into the weight calculation to ensure the rationality of the weight allocation. Weight updates utilize an incremental learning approach, dynamically adjusting based on system performance.
[0147] The standardized mapping employs an improved min-max method. Dynamic boundary values are calculated using a sliding window to adapt to changes in parameter distribution. The mapping process includes outlier handling, using quantile methods to determine the cutoff threshold. Score calculation utilizes smoothing to avoid drastic fluctuations in scores.
[0148] These two steps address key issues in traditional parameter evaluation: limited evaluation dimensions, unreasonable weight allocation, and inconsistent scoring standards. Through multi-dimensional comprehensive analysis and a scientific scoring mechanism, objective evaluation of parameter configuration is achieved.
[0149] Significant technical benefits: more comprehensive evaluation; more reasonable weighting; more objective scoring; and greater adaptability. This method is particularly suitable for complex configuration scenarios, accurately assessing parameter rationality. Practice shows that using this method for parameter evaluation can improve configuration optimization efficiency by 60% and reduce parameter tuning time by 55%.
[0150] The method's innovation lies in combining multi-dimensional evaluation with a scientific weighting system. Through precise quantitative analysis and a reasonable scoring mechanism, it achieves an objective evaluation of parameter configurations. Simultaneously, a robust numerical processing mechanism ensures the stability and reliability of the evaluation process. This comprehensive evaluation method provides a reliable decision-making basis for thread pool parameter optimization.
[0151] To improve the efficiency and accuracy of thread pool runtime status monitoring, this application provides an embodiment of a thread pool runtime status monitoring device for implementing all or part of the aforementioned thread pool runtime status monitoring method. See [link to embodiment]. Figure 8 The thread pool running status monitoring device specifically includes the following components:
[0152] The weight determination module 10 is used to collect the number of active threads, total threads, and waiting tasks through heartbeat probes, and query the currently effective core thread count, maximum thread count, and queue capacity in the parameter version library; calculate the core thread utilization rate by dividing the number of active threads by the number of core threads, calculate the maximum thread utilization rate by dividing the total thread count by the maximum thread count, and calculate the queue utilization rate by dividing the number of waiting tasks by the queue capacity; and perform a weighted moving average of the three utilization indicators within a time window, where the weight coefficient decays exponentially over time.
[0153] The parameter rationality evaluation module 20 is used to divide the fluctuation range of the ratio of active threads to core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics; calculate the variance of the ratio of total threads to maximum threads, and extract the adjustment coefficient of maximum threads through the fluctuation characteristics of the variance curve; use the difference between task growth rate and processing rate as a calibration factor for queue capacity; and compare the evaluation results of the three parameters with the preset reasonable interval boundaries to generate a parameter rationality score.
[0154] The thread tuning module 30 is used to statistically analyze the performance improvement effect of each preset tuning strategy from historical tuning records, extract the tuning strategy with the most significant performance improvement as the benchmark strategy, and calculate the current tuning step size based on the benchmark strategy. Specifically, it includes: multiplying the optimization coefficient of the core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number tuning step size; multiplying the adjustment coefficient of the maximum threads by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number tuning step size; and multiplying the calibration factor of the queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity tuning step size. The tuning suggestions and their calculation basis are recorded in the version control library, and the corresponding effective conditions are set.
[0155] As described above, the thread pool operation status monitoring device provided in this application embodiment can divide the fluctuation range of the ratio of active threads to core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics; calculate the variance of the ratio of total threads to maximum threads, and extract the adjustment coefficient of maximum threads through the fluctuation characteristics of the variance curve; use the difference between task growth rate and processing rate as a calibration factor for queue capacity; compare the evaluation results of the three parameters with preset reasonable interval boundaries to generate parameter reasonableness scores; statistically analyze the performance improvement effect of each preset adjustment strategy from historical adjustment records; calculate the current adjustment step size based on the benchmark 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 thread pool operation status monitoring.
[0156] From a hardware perspective, in order to improve the efficiency and accuracy of thread pool runtime status monitoring, this application provides an embodiment of an electronic device for implementing all or part of the thread pool runtime status monitoring method. The electronic device specifically includes the following components:
[0157] The system comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to transmit information between the thread pool runtime status monitoring device and core business systems, user terminals, and related databases and other related devices; the logic controller can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the logic controller can be implemented with reference to the embodiments of the thread pool runtime status monitoring method and the thread pool runtime status monitoring device described in the embodiments, the content of which is incorporated herein, and repeated details will not be described again.
[0158] It is understood that the user terminal may include smartphones, tablet computers, network set-top boxes, portable computers, desktop computers, personal digital assistants (PDAs), in-vehicle devices, smart wearable devices, etc. Among these, the smart wearable devices may include smart glasses, smartwatches, smart bracelets, etc.
[0159] In practical applications, the thread pool runtime status monitoring method can be executed on the electronic device side as described above, or all operations can be completed on the client device. The choice can be made based on the processing power of the client device and the limitations of the user's usage scenario. This application does not impose any limitations on this. If all operations are completed on the client device, the client device may further include a processor.
[0160] The aforementioned client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission. The server may include a server on the task scheduling center side; in other implementation scenarios, it 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, a server cluster consisting of multiple servers, or a distributed server structure.
[0161] Figure 9 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application. Figure 9As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that... Figure 9 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0162] In one embodiment, the thread pool runtime status monitoring method can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following controls:
[0163] Step S101: Collect the number of active threads, total threads, and waiting tasks using a heartbeat probe; query the currently active core thread count, maximum thread count, and queue capacity in the parameter version library; calculate the core thread utilization rate by dividing the number of active threads by the number of core threads, calculate the maximum thread utilization rate by dividing the total thread count by the maximum thread count, and calculate the queue utilization rate by dividing the number of waiting tasks by the queue capacity; perform a weighted moving average over a time window on the three utilization metrics, where the weight coefficient decays exponentially over time.
[0164] Step S102: Divide the fluctuation range of the ratio of active threads to core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics; calculate the variance of the ratio of total threads to maximum threads, and extract the adjustment coefficient of maximum threads through the fluctuation characteristics of the variance curve; use the difference between task growth rate and processing rate as the calibration factor for queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries to generate parameter reasonableness scores.
[0165] Step S103: Analyze 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 benchmark strategy; calculate the current adjustment step size based on the benchmark strategy, specifically including: multiplying the optimization coefficient of core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number adjustment step size; multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number adjustment step size; multiplying the calibration factor of queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity adjustment step size; record the adjustment suggestions and their calculation basis in the version control library, and set the corresponding effective conditions.
[0166] As described above, the electronic device provided in this application divides the fluctuation range of the ratio of active threads to core threads into high-load, normal, and low-load intervals, and calculates the optimization coefficient of core threads based on the interval distribution characteristics; calculates the variance of the ratio of total threads to maximum threads, and extracts the adjustment coefficient of maximum threads through the fluctuation characteristics of the variance curve; uses the difference between task growth rate and processing rate as a calibration factor for queue capacity; compares the evaluation results of the three parameters with preset reasonable interval boundaries to generate parameter reasonableness scores; statistically analyzes the performance improvement effect of each preset adjustment strategy from historical adjustment records; calculates the current adjustment step size based on the benchmark strategy; records the adjustment suggestions and their calculation basis in the version library, and sets the corresponding effective conditions, thereby improving the efficiency and accuracy of thread pool running status monitoring.
[0167] In another embodiment, the thread pool running status monitoring device can be configured separately from the central processing unit 9100. For example, the thread pool running status monitoring device can be configured as a chip connected to the central processing unit 9100, and the thread pool running status monitoring method function can be implemented through the control of the central processing unit.
[0168] like Figure 9 As shown, the electronic device 9600 may further 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 need to include these components. Figure 9 All components shown; in addition, the electronic device 9600 may also include Figure 9 For components not shown, please refer to existing technologies.
[0169] like Figure 9 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs 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, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.
[0171] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.
[0172] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can 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 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 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 the electronic device's communication functions and / or for performing 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 processing unit 9100 to provide input signals and receive output signals, which is the same as in a conventional mobile communication terminal.
[0175] Based on different communication technologies, multiple communication modules 9110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby realizing typical telecommunications functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 9130 is coupled to a central processing unit 9100, enabling on-device recording via the microphone 9132 and on-device playback of stored audio via the speaker 9131.
[0176] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the thread pool runtime status monitoring method with a server or client as the execution subject in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the thread pool runtime status monitoring method with a server or client as the execution subject in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:
[0177] Step S101: Collect the number of active threads, total threads, and waiting tasks using a heartbeat probe; query the currently active core thread count, maximum thread count, and queue capacity in the parameter version library; calculate the core thread utilization rate by dividing the number of active threads by the number of core threads, calculate the maximum thread utilization rate by dividing the total thread count by the maximum thread count, and calculate the queue utilization rate by dividing the number of waiting tasks by the queue capacity; perform a weighted moving average over a time window on the three utilization metrics, where the weight coefficient decays exponentially over time.
[0178] Step S102: Divide the fluctuation range of the ratio of active threads to core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics; calculate the variance of the ratio of total threads to maximum threads, and extract the adjustment coefficient of maximum threads through the fluctuation characteristics of the variance curve; use the difference between task growth rate and processing rate as the calibration factor for queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries to generate parameter reasonableness scores.
[0179] Step S103: Analyze 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 benchmark strategy; calculate the current adjustment step size based on the benchmark strategy, specifically including: multiplying the optimization coefficient of core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number adjustment step size; multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number adjustment step size; multiplying the calibration factor of queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity adjustment step size; record the adjustment suggestions and their calculation basis in the version control library, and set the corresponding effective conditions.
[0180] As described above, the computer-readable storage medium provided in this application divides the fluctuation range of the ratio of active threads to core threads into high-load, normal, and low-load intervals, and calculates the optimization coefficient of core threads based on the interval distribution characteristics; calculates the variance of the ratio of total threads to maximum threads, and extracts the adjustment coefficient of maximum threads 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 queue capacity; compares the evaluation results of the three parameters with preset reasonable interval boundaries to generate parameter reasonableness scores; statistically analyzes the performance improvement effect of each preset adjustment strategy from historical adjustment records; calculates the current adjustment step size based on the benchmark strategy; records the adjustment suggestions and their calculation basis in the version library, and sets the corresponding effective conditions, thereby improving the efficiency and accuracy of thread pool running status monitoring.
[0181] Embodiments of this application also provide a computer program product capable of implementing all steps of the thread pool runtime status monitoring method with the execution subject being a server or client in the above embodiments. When this computer program / instruction is executed by a processor, it implements the steps of the thread pool runtime status monitoring method. For example, the computer program / instruction implements the following steps:
[0182] Step S101: Collect the number of active threads, total threads, and waiting tasks using a heartbeat probe; query the currently active core thread count, maximum thread count, and queue capacity in the parameter version library; calculate the core thread utilization rate by dividing the number of active threads by the number of core threads, calculate the maximum thread utilization rate by dividing the total thread count by the maximum thread count, and calculate the queue utilization rate by dividing the number of waiting tasks by the queue capacity; perform a weighted moving average over a time window on the three utilization metrics, where the weight coefficient decays exponentially over time.
[0183] Step S102: Divide the fluctuation range of the ratio of active threads to core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics; calculate the variance of the ratio of total threads to maximum threads, and extract the adjustment coefficient of maximum threads through the fluctuation characteristics of the variance curve; use the difference between task growth rate and processing rate as the calibration factor for queue capacity; compare the evaluation results of the three parameters with the preset reasonable interval boundaries to generate parameter reasonableness scores.
[0184] Step S103: Analyze 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 benchmark strategy; calculate the current adjustment step size based on the benchmark strategy, specifically including: multiplying the optimization coefficient of core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number adjustment step size; multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number adjustment step size; multiplying the calibration factor of queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity adjustment step size; record the adjustment suggestions and their calculation basis in the version control library, and set the corresponding effective conditions.
[0185] As described above, the computer program product provided in this application divides the fluctuation range of the ratio of active threads to core threads into high-load, normal, and low-load intervals, and calculates the optimization coefficient of core threads based on the interval distribution characteristics; calculates the variance of the ratio of total threads to maximum threads, and extracts the adjustment coefficient of maximum threads 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 queue capacity; compares the evaluation results of the three parameters with preset reasonable interval boundaries to generate parameter reasonableness scores; statistically analyzes the performance improvement effect of each preset adjustment strategy from historical adjustment records; calculates the current adjustment step size based on the benchmark strategy; records the adjustment suggestions and their calculation basis in the version library, and sets the corresponding effective conditions, thereby improving the efficiency and accuracy of thread pool running status monitoring.
[0186] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied 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] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0188] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0189] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0190] Specific embodiments have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A method for monitoring the running status of a thread pool, characterized in that, The method includes: The system collects active thread count, total thread count, and waiting task count using heartbeat probes. It then queries the parameter version library for the currently active core thread count, maximum thread count, and queue capacity. The core thread utilization rate is calculated by dividing the active thread count by the core thread count, the maximum thread utilization rate is calculated by dividing the total thread count by the maximum thread count, and the queue utilization rate is calculated by dividing the waiting task count by the queue capacity. A weighted moving average is then applied to these three utilization metrics over a time window, with the weighting coefficients decaying exponentially over time. The fluctuation range of the ratio of active threads to core threads is divided into high-load intervals, normal intervals, and low-load intervals. The optimization coefficient of core threads is calculated based on the interval distribution characteristics. The process of determining the optimization coefficient includes: reading the historical sequence of the ratio of active threads to core threads in the monitoring data, automatically grouping the comparison data using a two-sample K-means clustering algorithm, calculating the center value and variance of each group, dividing the ratio range into high-load intervals, normal intervals, and low-load intervals according to the clustering results, recording the interval boundary values in the configuration center, statistically analyzing the data distribution density of each interval within the time window, calculating the data proportion of the high-load interval and the low-load interval, using 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 using the probability density function of the normal distribution to correct the basic coefficient to obtain the optimization coefficient of the number of core threads. The variance of the ratio of total number of threads to maximum number of threads is calculated, and the adjustment coefficient of the maximum number of threads is extracted through the fluctuation characteristics of the variance curve. The process of determining the adjustment coefficient includes: calculating the mean of the ratio sequence of total number of threads to maximum number of threads within the sampling window; subtracting the mean from the ratio of each sampling point and squaring it to obtain the squared deviation; summing all squared deviations and dividing by the number of sampling points to obtain the variance value; applying a sliding window to the variance sequence to obtain the variance change curve; performing a Fourier transform on the variance change curve to extract the fluctuation period and amplitude characteristics; calculating the deviation rate between the amplitude of the main frequency components and the preset steady-state threshold; and using the sigmoid function to map the deviation rate to the [-1,1] interval to obtain the adjustment coefficient of the maximum number of threads. The difference between the task growth rate and the processing rate is used as a calibration factor for the queue capacity; the evaluation results of the three parameters are compared with the preset reasonable interval boundaries to generate a parameter reasonableness score. The performance improvement effect of each preset adjustment strategy is statistically analyzed from historical adjustment records, and the adjustment strategy with the most significant performance improvement is extracted as the benchmark strategy. Based on the benchmark strategy, the current adjustment step size is calculated, specifically including: multiplying the optimization coefficient of core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number adjustment step size; multiplying the adjustment coefficient of maximum threads by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number adjustment step size; and multiplying the calibration factor of queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity adjustment step size. The adjustment suggestions and their calculation basis are recorded in the version control system, and the corresponding effective conditions are set.
2. The thread pool running status monitoring method according to claim 1, characterized in that, The calculation of core thread utilization by dividing the number of active threads by the number of core threads, the calculation of maximum thread utilization by dividing the total number of threads by the maximum number of threads, and the calculation of queue utilization by dividing the number of waiting tasks by the queue capacity include: Read the real-time values of three indicators—active thread count, total thread count, and waiting task count—from the monitoring data collected by the probe. Obtain the values of three parameters—currently active core thread count, maximum thread count, and queue capacity—from the configuration center. Perform data validation on the collected monitoring indicators to filter out abnormal and invalid values. The current core thread pool load level is calculated by dividing the verified number of active threads by the core thread count. The overall thread pool load level is calculated by dividing the total number of threads by the maximum number of threads. The saturation level of the task queue is calculated by dividing the number of waiting tasks by the queue capacity. The calculation results are then standardized to normalize the value range 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 utilization indicators over a time window, wherein the weighting coefficients decay 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 to the corresponding buffer positions, calculate the time interval of each sampling point based on the data writing time, and generate the corresponding weight decay coefficient by exponential function e raised to the negative time interval. Iterate through all data points within the time window, multiply the utilization rate of each data point by the corresponding weight coefficient to obtain a weighted value, sum all weighted values and divide by the sum of weight coefficients to obtain a weighted average result. Perform this calculation process on the three indicators of core thread utilization, maximum thread utilization, and queue utilization respectively.
4. The thread pool running status monitoring method according to claim 1, characterized in that, The step of using the difference between the task growth rate and the processing rate as a calibration factor for queue capacity includes: The number of new pending tasks added per unit time is obtained through the thread pool monitoring interface. The task growth rate is obtained by calculating the rate of change of the task queue length over time. At the same time, the task processing rate is obtained by calculating the rate of change of the number of completed tasks over time. 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 task backlog level is predicted using the exponential smoothing method. The ratio of the predicted value to the queue capacity is mapped using a logarithmic function to obtain the queue capacity calibration factor.
5. The thread pool running status monitoring method according to claim 1, characterized in that, The step of comparing the evaluation results of the three parameters with preset reasonable interval boundaries to generate a parameter reasonableness score includes: Read the reasonable range boundary values of the three parameters, namely, core thread count, maximum thread count, and queue capacity, from the configuration center. Map the optimization coefficient, adjustment coefficient, and calibration factor calculated in the parameter evaluation to the corresponding range. Calculate the degree of deviation of each evaluation result from the range boundary and normalize the deviation value by applying the arctangent function. 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 the score range of 0 to 100 through min-max standardization to obtain the final parameter rationality score.
6. A thread pool runtime status monitoring device, characterized in that, The device includes: The weight determination module is used to collect the number of active threads, total threads, and waiting tasks through heartbeat probes, and query the currently effective core thread count, maximum thread count, and 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 thread count by the maximum thread count, and the queue utilization rate is calculated by dividing the number of waiting tasks by the queue capacity; a weighted moving average is applied to the three utilization indicators within a time window, where the weight coefficient decays exponentially over time; The parameter rationality evaluation module is used to divide the fluctuation range of the ratio of active threads to core threads into high-load intervals, normal intervals, and low-load intervals, and calculate the optimization coefficient of core threads based on the interval distribution characteristics. The process of determining the optimization coefficient includes: reading the historical sequence of the ratio of active threads to core threads in the monitoring data, automatically grouping the comparison data using a two-sample K-means clustering algorithm, calculating the center value and variance of each group, dividing the ratio range into high-load intervals, normal intervals, and low-load intervals according to the clustering results, recording the interval boundary values in the configuration center, statistically analyzing the data distribution density of each interval within the time window, calculating the data proportion of the high-load interval and the low-load interval, using 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 using the probability density function of the normal distribution to correct the basic coefficient to obtain the optimization coefficient of the number of core threads. The variance of the ratio of total threads to maximum threads is calculated, and the adjustment coefficient of the maximum number of threads is extracted through the fluctuation characteristics of the variance curve. The process of determining the adjustment coefficient includes: calculating the mean of the ratio sequence of total threads to maximum threads within a sampling window; subtracting the mean from the ratio of each sampling point and squaring it to obtain the squared deviation; summing all squared deviations and dividing by the number of sampling points to obtain the variance value; applying a sliding window to the variance sequence to obtain the variance change curve; performing a Fourier transform on the variance change curve to extract the fluctuation period and amplitude characteristics; calculating the deviation rate between the amplitude of the main frequency components and a preset steady-state threshold; using the sigmoid function to map the deviation rate to the [-1,1] interval to obtain the adjustment coefficient of the maximum number of threads; using the difference between the task growth rate and the processing rate as a calibration factor for the queue capacity; and comparing the evaluation results of the three parameters with the preset reasonable interval boundaries to generate a parameter reasonableness score. The thread tuning module is used to statistically analyze the performance improvement effect of each preset tuning strategy from historical tuning records, extract the tuning strategy with the most significant performance improvement as the benchmark strategy, and calculate the current tuning step size based on the benchmark strategy. Specifically, it includes: multiplying the optimization coefficient of core threads by the thread number adjustment ratio in the benchmark strategy to obtain the core thread number tuning step size; multiplying the adjustment coefficient of the maximum thread by the maximum thread adjustment ratio in the benchmark strategy to obtain the maximum thread number tuning step size; and multiplying the calibration factor of queue capacity by the capacity adjustment ratio in the benchmark strategy to obtain the queue capacity tuning step size. The tuning suggestions and their calculation basis are recorded in the version control library, and the corresponding effective conditions are set.
7. 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, it implements the steps of the thread pool running status monitoring method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the thread pool running status monitoring method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Thread pool adjustment method and device, equipment and storage medium
CN118012624A
Distributed Load Balancing for Processing of High-Volume Data Streams
US20200192725A1