Server optimization method and device, electronic equipment and storage medium
By using the performance prediction model in the server to comprehensively analyze the hardware parameters, software configuration and code execution progress, the insufficient performance evaluation of complex server systems is solved, and more efficient performance evaluation and optimization is achieved.
Patent Information
- Application Number
- CN202510396684.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, monitoring systems based on fixed rules cannot meet the performance evaluation requirements of complex server systems, resulting in insufficient evaluation accuracy and poor adaptability.
The performance prediction model is used to comprehensively analyze the server's hardware parameters, software configuration and code execution progress, and build a model through machine learning and deep learning algorithms, capture the association relationship between software and hardware, and generate code optimization and resource adjustment solutions.
It improves the accuracy and optimization efficiency of server performance evaluation, realizes the transformation from passive monitoring to active optimization, and improves resource utilization and system stability.
Smart Images

Figure CN120407355A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to an optimization method, device, electronic device, and storage medium for a server. Background Art
[0002] As the infrastructure supporting modern network services, improving the performance of servers is the current trend in technological development.
[0003] Currently, the performance evaluation of servers is usually carried out based on a rule-based monitoring system. This method relying on fixed rule screening cannot meet the performance evaluation requirements of complex server systems. Summary of the Invention
[0004] This application provides an optimization method, device, electronic device, and storage medium for a server, so as to at least solve the problem that the method relying on fixed rule screening in related technologies cannot meet the performance evaluation requirements of complex server systems.
[0005] This application provides an optimization method for a server, including:
[0006] Obtaining first performance data of the server; wherein, the first performance data includes at least one of hardware parameters, software configuration, and code execution progress;
[0007] Inputting the first performance data into a performance prediction model for performance prediction processing to obtain a performance prediction result of the server, and the performance prediction model predicts the performance of the server through the combined influence of hardware parameters, software configuration, and code execution progress on the server performance;
[0008] Generating a code optimization and resource adjustment plan for the server based on the performance prediction result.
[0009] This application also provides an optimization device for a server, including:
[0010] An obtaining unit, configured to obtain first performance data of the server; wherein, the first performance data includes at least one of hardware parameters, software configuration, and code execution progress;
[0011] A prediction unit, configured to input the first performance data into a performance prediction model for performance prediction processing to obtain a performance prediction result of the server, and the performance prediction model predicts the performance of the server through the combined influence of hardware parameters, software configuration, and code execution progress on the server performance;
[0012] A generating unit, configured to generate a code optimization and resource adjustment plan for the server based on the performance prediction result.
[0013] The present application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the steps of any one of the above server optimization methods when executing the computer program.
[0014] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program implements the steps of any one of the above server optimization methods when executed by a processor.
[0015] The present application also provides a computer program product including a computer program, and the computer program implements the steps of any one of the above server optimization methods when executed by a processor.
[0016] Through the present application, by comprehensively analyzing the hardware parameters, software configurations, and code execution progress of the server using a performance prediction model, the correlation between software and hardware in the server operating state can be dynamically captured. Therefore, the technical problems of insufficient evaluation accuracy and poor adaptability of traditional fixed-rule-based monitoring systems in complex server environments can be solved, achieving the technical effects of improving the accuracy of server performance evaluation and optimization efficiency. The code optimization and resource adjustment solutions generated based on the model prediction results can specifically improve the server operating state, realize the transformation from passive monitoring to active optimization, and effectively improve the server resource utilization rate and system stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] To more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0018] Figure 1 It is a schematic flowchart of a text generation method provided by an embodiment of the present application;
[0019] Figure 2 It is a schematic flowchart of an optimization process of a server provided by an embodiment of the present application;
[0020] Figure 3 It is a schematic flowchart of a data collection process provided by an embodiment of the present application;
[0021] Figure 4 It is a schematic flowchart of a data cleaning process provided by an embodiment of the present application;
[0022] Figure 5 It is a schematic flowchart of a model training process provided by an embodiment of the present application;
[0023] Figure 6Schematic structural diagram of an optimization device for a server provided by an embodiment of the present application;
[0024] Figure 7 Schematic structural diagram of an optimization device for a server provided by an embodiment of the present application. Detailed implementation manners
[0025] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0026] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variation thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements that are not clearly listed, or further includes elements inherent to such a process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0027] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0028] An embodiment of the present application provides an optimization method for a server. The method will be described in detail in conjunction with the execution process of the optimization method for the server.
[0029] Figure 1 Schematic flowchart of a text generation method provided by an embodiment of the present application.
[0030] As Figure 1 shown, the method includes the following steps:
[0031] Step 101, obtain first performance data of the server; wherein, the first performance data includes at least one of hardware parameters, software configurations, and code execution progress.
[0032] Please refer to Figure 2 , Figure 2 Schematic optimization flowchart of a server provided by an embodiment of the present application. As Figure 2As shown, in some embodiments, the underlying hardware operating parameters can be obtained through system-level interface calls or dedicated monitoring tools, including but not limited to specific metrics such as the central processing unit model specifications, number of cores, main frequency fluctuation range, cache hierarchy structure, etc., and also covering key data such as the total capacity of the memory module, current occupancy rate, swap partition usage, etc. For the storage subsystem, it is necessary to record performance counter values such as the composition form of the disk array, single-disk throughput, number of input / output operations, and read / write latency.
[0033] At the software configuration level, scan the operating system kernel version, list of loaded driver modules, running daemon processes and their resource occupancy. In some embodiments, system basic information such as environment variable settings, dynamic link library versions, user permission configurations, etc. can also be collected.
[0034] For the application program environment, runtime parameters such as middleware parameter configurations, service port binding status, thread pool size, upper limit of connection numbers, etc. can be extracted.
[0035] For the monitoring of the code execution progress, runtime metrics such as function call stack traceback information, garbage collection frequency, context switch count, etc. can be captured by implanting performance probes or hooking system call interfaces, and special attention should be paid to the trigger records of blocking operation events and exception handling processes.
[0036] It should be noted that the above description is only an exemplary description and is not a specific limitation on the content of the three aspects of hardware parameters, software configuration, and code execution progress. In actual applications, the data content included in the first performance data can be determined according to actual needs, and the embodiments of the present application do not make any limitations in this regard.
[0037] In some embodiments, the data collection process needs to consider the continuity of the time series, and reasonable sampling intervals can be set to avoid significant impacts of the monitoring behavior itself on system performance. For the distributed system environment, it is also necessary to synchronize the collection clocks among nodes to eliminate the observation biases caused by network latency and establish a reliable benchmark data set for subsequent performance bottleneck location.
[0038] Step 102, input the first performance data into the performance prediction model for performance prediction processing to obtain the performance prediction result of the server. The performance prediction model predicts the performance of the server through the combined influence of hardware parameters, software configuration, and code execution progress on the server performance.
[0039] In some embodiments, the performance prediction model can be established through machine learning and deep learning algorithms such as time series analysis, random forest, neural network, etc. Its internal structure needs to be pre-trained with historical server performance data to learn the non-linear coupling relationship among hardware parameters, software configurations, and code execution progress. The input layer of the model first performs feature encoding on the original performance data, normalizing metrics with different dimensions (such as the gigahertz (GHz) unit of the central processing unit (CPU) main frequency, the percentage value of memory occupancy, the millisecond number of disk latency) into a standardized numerical distribution, and at the same time performing embedded vectorization representation on categorical configuration parameters (such as operating system type, file system format).
[0040] The core computing layer of the model consists of multiple fully connected networks or time series processing units, which can capture the dynamic association between the fluctuations of hardware resource utilization and software configuration strategies. For example, the model can identify the implicit law between the number of CPU cores and task scheduling latency under a specific thread pool size, or predict the differential impact of different garbage collection algorithms on program throughput when the number of input / output operations per second (IOPS) of the disk reaches a threshold. For code execution progress data, the model analyzes the correlation between the hot spot distribution of the function call path and the cache hit rate, and then infers the potential performance degradation trend.
[0041] In some embodiments, an attention mechanism can also be introduced to weight the contribution of different performance metrics to the final prediction result. For example, in a high-concurrency scenario, the weight of network stack parameters is emphasized, while in a compute-intensive task, the consideration of the floating-point arithmetic unit state is strengthened.
[0042] The performance prediction output usually includes multi-dimensional future state estimates, including both the overall performance score change curve and the expected bottleneck points of various resources (computing / storage / network) and their occurrence time windows. In some embodiments, the prediction result is accompanied by a confidence interval evaluation, reflecting the quality of the current input data and the familiarity of the model with this type of working condition, for the operation and maintenance personnel to judge the reliability of the prediction.
[0043] Step 103, generate a code optimization and resource adjustment plan for the server based on the performance prediction result.
[0044] In some embodiments, critical point detection is performed on the performance curve output by the prediction model to identify the time period when the system resources are about to reach the saturation state and the specific bottleneck dimensions. For example, when the CPU usage prediction shows that the set threshold will be exceeded within the next two hours, the system will initiate an optimization analysis for computing resources. For code-level optimization, cross-reference the hot function list in the performance prediction with the static code analysis database to locate algorithm modules with optimization potential. In one possible implementation, special attention is paid to method calls with exponentially increasing execution frequencies within the prediction period. According to the runtime characteristics of the target server, it may be recommended to introduce underlying optimization strategies such as loop unrolling, memory prefetching, or parallel computing modes, and at the same time recommend applicable compiler inlining optimization options or garbage collection parameter tuning in combination with programming language features.
[0045] In terms of adjusting the hardware resource configuration, calculate the resource quota dynamically based on the predicted load fluctuation pattern. If the model shows that memory access will become the main bottleneck, a solution may be proposed to adjust the Non-Uniform Memory Access (NUMA) node binding strategy or expand the Java Virtual Machine (JVM) heap memory space; for the predicted situation of a sharp increase in disk I / O latency, a combined strategy may be generated, including modifying the file system mount parameters, increasing the read / write buffer size, or enabling the asynchronous I / O mechanism.
[0046] When it comes to distributed systems, consider the predicted load imbalance degree of each node and intelligently generate task reallocation suggestions or data sharding adjustment plans. All generated adjustment solutions are accompanied by an expected benefit assessment, that is, an estimate of the improvement amplitude of the performance indicators after implementing the optimization, and are prioritized according to the implementation complexity and return rate. For critical business systems, a progressive implementation plan will also be generated, clarifying the verification steps and rollback conditions for gray release to ensure that the optimization process does not affect the system stability. The final output is in the dual form of a machine-readable configuration change instruction set and a human-readable optimization suggestion report.
[0047] In some embodiments, the first performance data further includes the abnormal data of the server, and obtaining the first performance data of the server includes:
[0048] Monitor the code execution progress based on the agent in the server through a preset data interface;
[0049] When it is determined that there is an abnormality in the code execution progress, obtain the real-time log data of the server;
[0050] Analyze the real-time log data to obtain the abnormal data of the server; wherein, the first performance data of the server includes abnormal data.
[0051] Please refer to Figure 3, Figure 3 A schematic diagram of a data collection process provided by an embodiment of the present application, as Figure 3 shown, the lightweight proxy component deployed inside the server continuously monitors the code execution progress through a preset data collection interface. The proxy is embedded in the runtime environment in a low-intrusive manner and constructs fine-grained execution flow tracking by intercepting system calls, sampling the program counter, or parsing debug symbols. The monitored data is transmitted with zero copy through shared memory or a circular buffer to ensure that the impact on the server system performance is controlled within the range of millisecond-level latency. When the proxy detects that the execution flow deviates from the expected pattern, including but not limited to situations such as abnormal growth of the function call stack, excessive number of loop iterations, and violation of the system call sequence, it immediately triggers a real-time log capture mechanism. This mechanism will break through the conventional log level limit and temporarily activate the output of deep system information such as kernel-level debug logs, dynamic linker loading records, and thread schedulers.
[0052] The obtained real-time log data is immediately parsed by a streaming processing engine. First, known noise patterns are eliminated through log fingerprint matching, and then an incremental clustering algorithm is used to identify the correlation features of abnormal events. The analysis process pays special attention to the spatio-temporal correlation between hardware anomalies (such as a sharp increase in CPU cache misses) and software behaviors (such as deteriorated lock contention), and locates the root cause module by constructing an abnormal propagation graph. The abnormal data is characterized in the form of a multi-dimensional vector, including an abnormal type label (computing / storage / communication), an impact scope assessment (process level / node level / cluster level), and a key metric offset (such as a 15% sudden increase in the branch prediction failure rate). These data are dynamically merged into the first performance dataset to form a performance time series with anomaly marks. The entire processing link uses a sliding window mechanism to maintain data timeliness, ensuring that the subsequent performance prediction model can perceive the latest system anomaly state. The anomaly analysis results are fed back to the proxy monitoring strategy in real time, dynamically adjusting the sampling frequency of the subsequent monitoring granularity to form an adaptive observation closed loop for the abnormal pattern.
[0053] In some embodiments, after obtaining the first performance data of the server, the method further includes:
[0054] Performing data cleaning and normalization on the first performance data. And extracting target performance metrics from the normalized first performance data; wherein, the target performance metrics are predetermined.
[0055] Please refer to Figure 4 , Figure 4 A schematic diagram of a data cleaning process provided by an embodiment of the present application, as Figure 4As shown in the figure, during the process of cleaning the first performance data, the system first establishes a data quality assessment matrix and formulates verification rules for performance indicators in different dimensions such as hardware parameters, software configurations, and abnormal data. Physical rationality checks are required for hardware parameters, including but not limited to whether the CPU temperature value is within the chip design threshold range, whether there are abnormal records of non - negative or over 100% memory occupancy rate, etc.; for software configuration data, it checks whether the version number format conforms to the release specification, whether there are illegal characters in boolean - type parameters, etc.; for code execution progress and abnormal data, it focuses on verifying the continuity of timestamps and the causal logic of event sequences, and eliminates breakpoint data caused by acquisition interruptions. The cleaning process adopts a sliding - window compensation mechanism. For missing values caused by instantaneous acquisition failures, they are reasonably filled through linear interpolation of front - and - back window data or horizontal reference of similar servers to ensure temporal integrity.
[0056] After completing data cleaning, the system performs multi - level normalization processing. For continuous variables, the improved RobustScaler method is used to eliminate the influence of outliers, and scaling is performed through the median and inter - quartile range, so that indicators such as CPU utilization rate and memory occupancy ratio are transformed into dimensionless relative values in the [0,1] interval; for discrete configuration parameters such as thread pool size, a piece - wise normalization strategy based on business knowledge is adopted to map the original value to the relative position coefficient in the preset optimization interval. During the normalization process, the original dimension conversion parameters of each indicator are retained to ensure that the actual physical values can be reversely restored during the optimization plan generation stage.
[0057] The extraction of target performance indicators is based on a predefined performance optimization program. The system loads the indicator weight configuration file, identifies key performance factors from it (such as request throughput in high - concurrency scenarios, instruction - cycle efficiency in compute - intensive tasks, etc.), and locates relevant data streams in the normalized data through a feature - selection algorithm. The extraction process uses dynamic - dimension projection technology to aggregate related indicators scattered in hardware parameters (such as the cache hit rate of Level 3 Cache (L3 cache)), software configurations (such as the connection - pool size of MySQL Database (MySQL)), and abnormal data (such as the frequency of deadlocks) into a composite - indicator vector according to their influence weights on the target performance. At the same time, a causal - graph model between indicators is established to identify the conduction relationship between core indicators (such as database query latency) and derivative indicators (such as the response time of Application Programming Interface (API)), providing a basis for subsequent optimization for dependency - path analysis. In some embodiments, all extracted target performance indicators are attached with data - traceability labels, recording their original data sources and cleaning - transformation histories to support reverse auditing of optimization decisions.
[0058] In some embodiments, before inputting the first performance data into the performance prediction model for performance prediction processing to obtain the performance prediction result of the server, the method further includes:
[0059] Obtain a performance dataset for training; the performance dataset for training includes a training set and a validation set; the training set and the validation set include performance feature data for training;
[0060] Train the performance prediction model according to the training set and the validation set to obtain a trained performance prediction model.
[0061] Please refer to Figure 5 , Figure 5 which is a schematic diagram of a model training process provided by an embodiment of the present application. As Figure 5 shown, in the process of constructing the performance dataset for training, raw performance logs are extracted from the historical monitoring library through methods such as simple random sampling and stratified systematic sampling. These logs cover the running state records of the server under different load patterns, hardware configurations, and software versions, and the time span needs to include typical business cycles (such as quarterly peaks, daily fluctuations, etc.). The raw logs are processed through feature engineering to be transformed into structured training samples. Each sample contains a time-aligned snapshot of hardware parameters (such as the CPU core utilization curve), a software configuration fingerprint (such as the JVM startup parameter hash value), and code execution features (such as the depth of the function call tree). The division of the training set and the validation set adopts a time-aware segmentation strategy to ensure that the validation set samples are completely after the training set on the time line, simulating the time series prediction requirements in the real scenario, and at the same time ensuring the balanced distribution of each abnormal type in the two groups through stratified sampling.
[0062] The construction of the performance feature data for training adopts a multi-granularity feature fusion method: periodic statistics are extracted at the hardware level (such as the 5-minute sliding window percentile of disk I / O), the software configuration is converted into a combined feature of one-hot encoding and numerical parameters, and the code execution progress is transformed into the key path metric of the control flow graph. For abnormal data, in addition to the original abnormal label, high-order features such as the abnormal duration and associated resource types are also derived. All features are subjected to collinearity detection and importance pre-screening, and the redundant dimensions are removed to form the final feature matrix, and batch normalization is performed on the numerical features to make the heterogeneous data of different servers comparable.
[0063] The training of the performance prediction model adopts an incremental learning framework. In the initial stage, the full training set is used to fit the basic model, and an early stopping mechanism is adopted to prevent overfitting, and the convergence of the prediction error is monitored on the validation set. In some embodiments, a physical constraint loss function is further introduced in the training process to force the model to comply with the physical upper limit law of hardware performance (for example, the CPU utilization rate cannot exceed the number of cores × 100%). For features with strong temporal dependencies, a temporal convolutional network or an attention mechanism is embedded inside the model to capture long-range patterns. After each round of training, the system automatically generates a feature contribution report to identify the combination of performance metrics that has the greatest impact on prediction accuracy, and dynamically adjusts the evaluation weights of the validation set accordingly, with a focus on ensuring the prediction accuracy of key business metrics. The finally obtained trained model includes a complete preprocessing pipeline and an inference computation graph, which can receive the input of the original server performance data and output multi-dimensional performance predictions, and at the same time output the confidence estimation of each prediction result. Before the model is deployed, it needs to pass the adversarial test of the validation set to verify its prediction robustness in extreme load scenarios.
[0064] In some embodiments, obtaining the performance dataset for training includes:
[0065] Based on the correlation analysis algorithm, determine the set of dominant features that dominate the server performance changes in the historical dataset, and obtain the performance dataset for training.
[0066] In some embodiments, when performing multi-dimensional correlation analysis, a hybrid method based on information theory and statistics can be used to mine the deep associations between performance metrics. By calculating the mutual information entropy and conditional mutual information entropy, quantify the non-linear dependence relationships between hardware parameters (such as CPU cache miss rate), software configurations (such as thread pool size), and key performance metrics (such as request latency), and test and analyze the leading and lagging effects in the time series to identify the features that truly have predictive value rather than the interference terms that only have surface statistical correlations. For high-dimensional sparse configuration parameters, a sparse linear model based on L1 regularization (L1 Regularization) can be used for feature screening to retain the core parameters with strong explanatory power for performance changes.
[0067] The construction of the dominant feature set adopts an iterative optimization strategy. In the initial stage, the maximum relevance minimum redundancy (mRMR) algorithm is used to select a feature subset that is highly relevant to the performance target but has strong independence from each other. Subsequently, the feature contribution analysis based on the SHapley Additive exPlanations (SHAP) value is introduced to verify the substantial impact of each feature in the context of model prediction. The analysis process pays special attention to the feature interaction effect, and complex patterns such as "the impact of disk I / O on latency under high memory pressure is doubled" are revealed through partial dependence plots, and these interaction terms are incorporated into the dominant set as synthetic features. The final obtained dominant feature set includes static configuration features (such as CPU microarchitecture version), dynamic runtime features (such as the contention rate of Level 2 Cache (L2 cache)), and their cross features (such as the product term of memory bandwidth and virtual machine ballooning factor), and they are hierarchically sorted according to their explanatory power for performance fluctuations.
[0068] During the generation of the performance dataset for training, the system performs a dominant feature projection transformation on the original historical data, retains the most discriminative feature combinations after removing redundant dimensions, and constructs the temporal dependence relationship between samples through a time sliding window operation. The dataset automatically annotates the business scenario types (such as batch processing / online service) of each sample, enabling subsequent model training to distinguish the differences in feature importance under different working conditions. In some embodiments, when the feature correlation changes significantly (such as the introduction of new hardware causing the original performance model to fail), the feature recombination mechanism is triggered to ensure that the training dataset always reflects the true performance driving factors in the current environment.
[0069] In some embodiments, the code optimization and resource adjustment plan for the server generated based on the performance prediction results includes:
[0070] Generating a score for the performance prediction result based on the evaluation rule; wherein, the evaluation rule includes performance feature items; the performance feature items include at least one of response time, throughput, and resource utilization;
[0071] Generating a code optimization and resource adjustment plan for the server according to the scoring result of the performance prediction result to optimize the performance feature items with low scores in the performance prediction result.
[0072] In the process of generating the performance prediction result score, the system quantitatively evaluates the prediction output according to predefined multi-dimensional evaluation rules. The evaluation rules divide performance characteristic items into a core index set and an auxiliary index set. For core indexes such as transaction response time and queries per second, parameters directly reflecting business efficiency adopt the absolute value scoring method. Their predicted values are compared with the thresholds of the Service Level Agreement (SLA), and the compliance percentage is calculated. For auxiliary indexes such as the utilization rate of the Central Processing Unit (CPU) and memory occupancy rate, resource type parameters adopt the dynamic benchmark scoring method, and an elastic scoring range is established according to the server model specifications and historical load patterns. The scoring model specially processes the restrictive relationships between indexes. For example, when high throughput prediction is accompanied by high CPU utilization rate, a resource efficiency coefficient is introduced to reduce the original score to prevent the optimization plan from falling into a local optimum. The score results of all characteristic items are fused through weighting to generate an overall performance index, where the weight configuration can be dynamically adjusted according to business priorities, and this is not limited in the embodiments of this application.
[0073] When generating an optimization plan based on the score results, the system starts the root cause analysis engine. First, it locates the dominant performance characteristic items leading to the low score and their associated subsystems. For the case of deteriorated response time, the plan generator will trace the critical path analysis data in the prediction model. If it is identified that the database query delay is the main bottleneck, it may recommend code-level improvements such as introducing query plan optimization and index reconstruction, and at the same time adjust runtime parameters such as the connection pool size and batch fetch size. When the low score is due to insufficient throughput, the plan may include architectural adjustments such as parallelizing computing tasks and reconstructing asynchronous processing chains, and supporting resource allocation measures such as increasing the core number of the thread pool and expanding the network buffer. The optimization plan for resource utilization rate scoring adopts a closed-loop control strategy. For example, for the situation where the CPU utilization rate prediction is too high but the throughput does not increase synchronously, it may recommend underlying optimizations such as disabling hyper-threading and adjusting the CPU affinity of the process, and at the same time implant improvements to the load balancing algorithm.
[0074] Each generated optimization plan is accompanied by a simulation report of the expected score improvement. Through the sandbox mode of the performance prediction model, the index changes after the implementation of the plan are deduced, and the estimated improvement amplitude of each characteristic item and the overall score gain are calculated. The system ranks the plans according to the improvement potential and implementation cost. High-risk operations such as kernel parameter adjustment will be marked as requiring phased verification. The final output is a combination package of an executable automated change script and a manual for manual review. The code optimization part is accurate to function-level modification suggestions, and the resource adjustment provides a gray release strategy and a rollback plan to ensure that the optimization process progresses gradually within a controllable range. After the plan is executed, the system continuously collects actual performance data and compares it with the predicted values to dynamically correct the weight allocation of the evaluation rules and the effectiveness evaluation model of the optimization strategy.
[0075] In some embodiments, after generating a code optimization and resource adjustment plan for the server based on the performance prediction results, the method further includes:
[0076] Performing optimization and adjustment on the server based on the code optimization and resource adjustment method;
[0077] Obtaining the second performance data of the optimized and adjusted server, comparing the first performance data with the second performance data, and determining that the optimization and adjustment of the server is effective if the second performance data is better than the first performance data.
[0078] When executing the code optimization and resource adjustment plan, the system adopts a phased control strategy to ensure the security and observability of the server optimization process. First, a complete system snapshot of the target server is created, including memory state dump, process tree information, and all kernel parameter configurations, as the rollback benchmark point. The code optimization is released in a gray manner through a continuous delivery pipeline. In the initial stage, only part of the traffic or computing tasks are enabled with the new code path, while keeping the old logic as a fallback option; for resource adjustment, a progressive change mechanism is adopted. For example, the memory parameter adjustment is incremented step by step at a rate of 10%, and a performance monitoring window is embedded in each adjustment cycle to detect the change trend of key metrics in real time. All change operations are recorded as atomic transactions through the configuration management system to ensure that they have a complete transaction identifier (Identifier, ID) and change timestamp.
[0079] After the optimization and adjustment are implemented, the system collects the second performance data through an enhanced monitoring agent to capture short-term performance fluctuation characteristics. The second performance data not only includes the metric set that exactly corresponds to the first performance data, but also additionally records specific observation points triggered by the optimization plan, such as the execution time statistics of the new code path, the utilization rate of the adjusted resource allocation, etc. The data collection continuously covers the complete business cycle to avoid evaluation distortion caused by temporary load fluctuations.
[0080] The comparative analysis adopts a dual-verification mechanism: at the statistical level, a paired-sample Student's t-test (T-test) is performed on the first and second performance data sets to confirm the significance of the differences in key indicators; at the engineering level, the degree of agreement between the actual improvement rate and the predicted improvement rate of each performance characteristic item is calculated. The comparison process pays special attention to the balance between indicators. For example, the improvement of response time is not achieved at the cost of excessive increase in CPU utilization. The optimization is determined to be effective when the following conditions are met: the core business indicators (such as throughput) reach the preset improvement threshold; the resource utilization indicators are within the safety margin range; the incidence of abnormal events is significantly reduced. The effective optimization plan will be standardized as a new baseline configuration, and its parameters will be incorporated into the training data set of the performance prediction model; if the result does not meet the expectation, the system will automatically trigger the root cause analysis process to locate the key link where the optimization fails (such as the code optimization does not cover the actual bottleneck point), and generate a revised secondary optimization plan. The entire verification result forms a closed-loop feedback, which is used to calibrate the generation logic of subsequent optimization strategies and the parameter weights of the performance prediction model.
[0081] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0082] An embodiment of the present application further provides an optimization device for a server. Figure 6 As shown in the structural schematic diagram of an optimization device for a server provided by an embodiment of the present application, Figure 6 it includes:
[0083] An acquisition unit 21, configured to acquire first performance data of the server; wherein, the first performance data includes at least one of hardware parameters, software configuration, and code execution progress;
[0084] A prediction unit 22, configured to input the first performance data into a performance prediction model for performance prediction processing to obtain a performance prediction result of the server. The performance prediction model predicts the performance of the server through the combined influence of hardware parameters, software configuration, and code execution progress on the server performance;
[0085] A generation unit 23, configured to generate a code optimization and resource adjustment plan for the server based on the performance prediction result.
[0086] Further, in a possible implementation manner of an embodiment of the present application, the first performance data further includes abnormal data of the server, and the acquisition unit 21 is further configured to:
[0087] Monitor the code execution progress based on an agent in the server through a preset data interface;
[0088] When an exception occurs in determining the code execution progress, obtain the real-time log data of the server;
[0089] Analyze the real-time log data to obtain the abnormal data of the server; among them, the first performance data of the server includes abnormal data.
[0090] Further, in a possible implementation manner of the embodiment of the present application, the device further includes:
[0091] The obtaining unit 21 is further configured to, after the obtaining unit 21 obtains the first performance data of the server, perform data cleaning and normalization processing on the first performance data. And extract the target performance metrics from the normalized first performance data; where the target performance metrics are predetermined.
[0092] Further, in a possible implementation manner of the embodiment of the present application, as Figure 7 shown, the device further includes:
[0093] The obtaining unit 21 is further configured to obtain the training performance data set before the prediction unit inputs the first performance data into the performance prediction model for performance prediction processing to obtain the performance prediction result of the server; the training performance data set includes a training set and a validation set; the training set and the validation set include training performance feature data;
[0094] The training unit 24 is configured to train the performance prediction model according to the training set and the validation set to obtain a trained performance prediction model.
[0095] Further, in a possible implementation manner of the embodiment of the present application, the obtaining unit 21 is further configured to:
[0096] Based on the correlation analysis algorithm, determine the dominant feature set that dominates the server performance change in the historical data set to obtain the training performance data set.
[0097] Further, in a possible implementation manner of the embodiment of the present application, the generating unit 23 is further configured to:
[0098] Generate a score for the performance prediction result based on the evaluation rule; where the evaluation rule includes performance feature items; the performance feature items include at least one of response time, throughput, and resource utilization;
[0099] Generate a code optimization and resource adjustment plan for the server according to the scoring result of the performance prediction result to optimize the performance feature items with low scores in the performance prediction result.
[0100] Further, in a possible implementation manner of the embodiment of the present application, as Figure 7 shown, the device further includes:
[0101] An adjustment unit 25, configured to perform optimization adjustment on the server based on the code optimization and resource adjustment solution of the server generated by the generation unit 23 after the performance prediction result;
[0102] The acquisition unit 21 is further configured to acquire second performance data of the optimized server, compare the first performance data with the second performance data, and determine that the optimization adjustment of the server is effective when the second performance data is better than the first performance data.
[0103] For the description of the features in the corresponding embodiments of the server optimization device, reference can be made to the relevant descriptions in the corresponding embodiments of the server optimization method, which will not be elaborated here one by one.
[0104] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above embodiments of the server optimization method.
[0105] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above embodiments of the server optimization method when running.
[0106] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disk, magnetic disk or optical disc, and other various media that can store computer programs.
[0107] An embodiment of the present application further provides a computer program product. The computer program product includes a computer program, and the steps in any of the above embodiments of the server optimization method are implemented when the computer program is executed by a processor.
[0108] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and the steps in any of the above embodiments of the server optimization method are implemented when the computer program is executed by a processor.
[0109] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered as exceeding the scope of this application.
[0110] The above has introduced in detail an optimization method, device, electronic device, and storage medium provided by this application. Specific examples are used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. An optimization method for a server, characterized in that including: Obtain the first performance data of the server; wherein, the first performance data includes at least one of hardware parameters, software configuration, and code execution progress; Input the first performance data into a performance prediction model for performance prediction processing to obtain the performance prediction result of the server, and the performance prediction model predicts the performance of the server based on the collaborative influence of the hardware parameters, software configuration, and code execution progress on the server performance; Generate a code optimization and resource adjustment plan for the server based on the performance prediction result.
2. The optimization method of the server according to claim 1, wherein The first performance data further includes abnormal data of the server, and the obtaining of the first performance data of the server includes: Monitor the code execution progress based on the agent in the server through a preset data interface; When it is determined that there is an abnormality in the code execution progress, obtain the real-time log data of the server; Analyze the real-time log data to obtain the abnormal data of the server; wherein, the first performance data of the server includes the abnormal data.
3. The optimization method of the server according to claim 2, wherein After obtaining the first performance data of the server, the method further includes: Perform data cleaning and normalization processing on the first performance data, and extract target performance indicators from the normalized first performance data; wherein, the target performance indicators are pre-determined.
4. The optimization method of the server according to claim 1, wherein Before inputting the first performance data into a performance prediction model for performance prediction processing to obtain the performance prediction result of the server, the method further includes: Obtain a performance dataset for training; the performance dataset for training includes a training set and a validation set; the training set and the validation set include training performance feature data; Train the performance prediction model according to the training set and the validation set to obtain the trained performance prediction model.
5. The optimization method of the server according to claim 4, characterized in that, The obtaining of the performance dataset for training includes: Based on a correlation analysis algorithm, determine a dominant feature set that dominates the performance change of the server in the historical dataset to obtain the performance dataset for training.
6. The optimization method of the server according to claim 1, wherein The generating of the code optimization and resource adjustment plan for the server based on the performance prediction result includes: Generate a score for the performance prediction result based on an evaluation rule; wherein, the evaluation rule includes performance feature items; the performance feature items include at least one of response time, throughput, and resource utilization; Generate a code optimization and resource adjustment plan for the server according to the scoring result of the performance prediction result to optimize the performance feature items with low scores in the performance prediction result.
7. The optimization method of the server according to any one of claims 1-6, characterized in that After generating the code optimization and resource adjustment plan for the server based on the performance prediction result, the method further includes: Perform optimization and adjustment on the server based on the code optimization and resource adjustment method; Obtain the second performance data of the optimized and adjusted server, compare the first performance data with the second performance data, and determine that the optimization and adjustment of the server is effective when the second performance data is better than the first performance data.
8. An optimization device for a server, characterized in that, including: An obtaining unit for obtaining the first performance data of the server; wherein, the first performance data includes at least one of hardware parameters, software configuration, and code execution progress; A prediction unit, configured to input the first performance data into a performance prediction model for performance prediction processing to obtain a performance prediction result of the server, where the performance prediction model predicts the performance of the server based on the collaborative influence of the hardware parameters, software configuration, and code execution progress on the server performance; A generation unit, configured to generate a code optimization and resource adjustment plan for the server based on the performance prediction result.
9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to implement the steps of the optimization method of the server according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program implements the steps of the optimization method of the server according to any one of claims 1 to 7 when executed by a processor.