Nginx server performance improvement method and device based on large model, medium and equipment

By collecting and preprocessing the operation data of the Nginx server, using pre-trained models to predict future traffic demand and load conditions, optimizing traffic allocation, load balancing and resource allocation strategies, solving the problem of improving Nginx server performance in the existing technology, and realizing the More reasonable resource allocation and performance improvement.

CN119496828APending Publication Date: 2025-02-21SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411449264.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-21

AI Technical Summary

Technical Problem

The prior art is difficult to effectively improve the performance of Nginx servers, especially in terms of traffic allocation, load balancing and resource allocation.

Method used

By collecting operation-related data of Nginx server, preprocessing and feature extraction, inputting it into the pre-trained model, predicting future traffic demand and load conditions, and optimizing traffic allocation, load balancing and resource allocation strategies.

Benefits of technology

The adjustment of traffic allocation policies, load balancing policies and resource allocation policies is realized, making the allocation of traffic, load and resources more reasonable and improving the performance of Nginx servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119496828A_ABST
    Figure CN119496828A_ABST
Patent Text Reader

Abstract

The invention provides an Nginx server performance improvement method and device based on a large model, a medium and equipment. The method comprises the steps of collecting operation related data of an Nginx server in a preset latest time period; the operation related data is preprocessed; carrying out feature extraction from the preprocessed operation related data, carrying out feature selection from the extracted features, and carrying out standardized conversion on the selected features to obtain operation features of the Nginx server; inputting the operation characteristics into a pre-trained first prediction model to obtain a predicted traffic demand and a predicted load condition of the Nginx server in a preset future time period; optimizing a traffic distribution strategy according to the predicted traffic demand; and according to the predicted load condition, optimizing a load balancing strategy of the Nginx server and optimizing a resource allocation strategy. According to the invention, the performance of the Nginx server can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of server technology, and in particular to a method, device, medium and equipment for improving Nginx server performance based on a large model. Background Art

[0002] As a high-performance HTTP and reverse proxy server, Nginx mainly runs on the Linux platform. The performance of the Nginx server is crucial to users, so it is necessary to take some measures to improve the performance of the Nginx server. Summary of the invention

[0003] In response to at least one of the above technical problems, an embodiment of the present invention provides a method, device, medium, and equipment for improving Nginx server performance based on a large model.

[0004] According to the first aspect, the Nginx server performance improvement method based on the large model provided by the embodiment of the present invention includes:

[0005] Collecting operation-related data of the Nginx server within a preset recent time period; wherein the operation-related data includes log data, performance indicators and network traffic data;

[0006] Preprocessing the operation-related data;

[0007] Extract features from the preprocessed operation-related data, select features from the extracted features, and perform standardized conversion on the selected features to obtain the operation features of the Nginx server;

[0008] Inputting the operation characteristics into a pre-trained first prediction model to obtain the predicted traffic demand and predicted load of the Nginx server in a preset future time period;

[0009] Optimizing the traffic distribution strategy according to the predicted traffic demand;

[0010] According to the predicted load situation, the load balancing strategy of the Nginx server is optimized and the resource allocation strategy is optimized.

[0011] In one embodiment, the method further comprises:

[0012] Real-time monitoring of Nginx server traffic data;

[0013] Input the current traffic data into the pre-trained anomaly detection model to obtain the detection result of whether there is abnormal network behavior at present;

[0014] If the detection result is that there is currently abnormal network behavior, the pre-configured protection measures are triggered to execute, the security rules and / or protection strategies are dynamically adjusted, and relevant log data is recorded.

[0015] In one embodiment, the method further comprises:

[0016] Input the current traffic data into the pre-trained analysis model to obtain the current user behavior data;

[0017] Identifying the user's content preferences based on the user behavior data;

[0018] The cache strategy of the Nginx server is adjusted according to the user behavior data and the content preference.

[0019] In one embodiment, the method further comprises:

[0020] Predicting content that will be accessed by the user within a preset future time period based on the current user behavior data;

[0021] Through the pre-fetching technology, the content to be accessed by the user is loaded into the cache before receiving the user's request.

[0022] In one embodiment, the method further comprises:

[0023] Configure a cache invalidation policy and invalidate the content in the cache according to the cache invalidation policy to ensure the freshness of the content in the cache;

[0024] The cache performance of the cache is monitored, and the cache invalidation strategy is adjusted according to the cache performance obtained through monitoring.

[0025] In one embodiment, the method further comprises:

[0026] Analyze the load and resource usage of the Nginx server based on the performance indicators;

[0027] According to the load situation and resource usage situation, the configuration parameters of the Nginx server are adjusted; according to the real-time user request, the real-time needs of the user are determined; according to the real-time needs, the configuration parameters of the Nginx server are adjusted; wherein the adjustment operation of the configuration parameters is implemented by an automated script.

[0028] In one embodiment, the method further comprises:

[0029] Inputting the log data and the performance index into a pre-trained second prediction model to obtain predicted problems of the Nginx server in a preset future time period; and performing advance maintenance and optimization on the Nginx server according to the predicted problems;

[0030] Regularly perform health checks on the Nginx server to obtain health check results; and take preventive measures based on potential problems in the health check results.

[0031] According to the second aspect, the Nginx server performance improvement device based on the large model provided by the embodiment of the present invention includes:

[0032] A data collection module is used to collect operation-related data of the Nginx server within a preset recent time period; wherein the operation-related data includes log data, performance indicators and network traffic data;

[0033] A preprocessing module, used for preprocessing the operation-related data;

[0034] A feature extraction module is used to extract features from the preprocessed operation-related data, select features from the extracted features, and perform standardized conversion on the selected features to obtain the operation features of the Nginx server;

[0035] A first prediction module is used to input the operation characteristics into a first prediction model obtained by pre-training to obtain the predicted traffic demand and predicted load of the Nginx server in a preset future time period;

[0036] A first optimization module, configured to optimize a traffic distribution strategy according to the predicted traffic demand;

[0037] The second optimization module is used to optimize the load balancing strategy of the Nginx server and optimize the resource allocation strategy according to the predicted load situation.

[0038] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method provided in the first aspect.

[0039] According to a fourth aspect, an embodiment of the present invention provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0040] The Nginx server performance improvement method and device, medium, and equipment based on a large model provided in an embodiment of the present invention collects operation-related data of the Nginx server in a preset recent time period, pre-processes the operation-related data, obtains the operation characteristics of the Nginx server based on the pre-processed operation-related data, and then inputs the operation characteristics into a first prediction model obtained by pre-training to obtain the predicted traffic demand and predicted load situation of the Nginx server in a preset future time period; then optimizes the traffic distribution strategy based on the predicted traffic demand; and optimizes the load balancing strategy of the Nginx server and the resource allocation strategy based on the predicted load situation. It can be seen that according to the embodiment of the present invention, the traffic distribution strategy, load balancing strategy, and resource allocation strategy can be adjusted, so that the distribution of traffic, load, and resources is more reasonable, thereby improving the performance of the Nginx server. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flow chart of a method for improving Nginx server performance based on a large model in one embodiment of the present invention;

[0042] Figure 2 The present invention is a structural block diagram of a device for improving Nginx server performance based on a large model in one embodiment of the present invention. DETAILED DESCRIPTION

[0043] In the first aspect, the embodiment of the present invention provides a method for improving Nginx server performance based on a large model, see Figure 1 The method comprises the following steps S110 to S160:

[0044] S110, collecting operation-related data of the Nginx server within a preset recent time period; wherein the operation-related data includes log data, performance indicators and network traffic data;

[0045] Among them, log data includes access logs, error logs, cache logs, etc. These logs contain detailed information of user requests, such as request time, request method, request URL, response status code, transmission data size, etc.

[0046] Among them, performance indicators include CPU usage, memory usage, disk I / O, number of connections, etc. These data can be obtained through system monitoring tools or Nginx's built-in status page.

[0047] Among them, network traffic data can be collected through network analysis tools or traffic monitoring tools to understand data flow direction, traffic size, protocol type, etc.

[0048] S120, preprocessing the operation-related data;

[0049] Specifically, preprocessing may include cleaning, formatting, conversion, completion, etc.

[0050] Data cleaning: Cleaning data to remove invalid, erroneous or duplicate records. For example, removing robot traffic or crawler requests from access logs.

[0051] Data formatting: converting data from different sources and formats into a unified format. For example, converting a timestamp into a unified date and time format.

[0052] Among them, data conversion: necessary conversion of data, such as converting IP addresses into geographic information, such as country, city, etc., and extracting useful information from the request URL in the log data, such as the requested page, parameters, etc.

[0053] Data completion: For missing or abnormal data, appropriate completion or processing is performed, for example, using the mean, median or mode to fill in missing numerical data.

[0054] S130, extracting features from the preprocessed operation-related data, selecting features from the extracted features, and performing standardization conversion on the selected features to obtain the operation features of the Nginx server;

[0055] It is understandable that feature extraction refers to extracting useful features from raw data. For example, extracting features such as user access frequency, access path, page dwell time, etc. from access logs.

[0056] Specifically, the extracted features may include request type, access frequency, user behavior, time features, request and response features, etc.

[0057] Among them, request type: distinguish different HTTP request methods, such as GET, POST, etc., because they may have different effects on server load.

[0058] Among them, access frequency: counts the access frequency of a specific IP address or user agent, which can help identify abnormal or attack behavior.

[0059] Among them, user behavior: analyze the user's behavior patterns on the website, such as page browsing order, click path, etc. These features can be used for personalized content and recommendation systems.

[0060] Among them, time features: extract the time information of the request, such as hour, day of the week, whether it is a holiday, etc., because these factors may affect the traffic pattern.

[0061] Among them, request and response characteristics: including request size, response time, status code, etc., which are directly related to the performance of the server.

[0062] Specifically, after the features are extracted, feature selection is performed, and the selection methods include statistical analysis, correlation coefficient analysis, information gain, feature importance, etc.

[0063] Among them, statistical analysis: use descriptive statistical methods (such as mean, median, standard deviation, etc.) to analyze the distribution and changes of features, and select features with high correlation with target variables (such as server load).

[0064] Among them, correlation coefficient analysis: calculate the correlation between features, such as using the Pearson correlation coefficient or the Spearman rank correlation coefficient, to identify and deal with multicollinearity problems.

[0065] Among them, information gain: evaluates the contribution of each feature to the improvement of model performance and selects features with high information gain.

[0066] Among them, feature importance: use decision trees, random forests and other models to evaluate the importance of features and select the features that have the greatest impact on model performance.

[0067] Of course, in addition to selecting features, you can also create new features based on existing features, such as extracting seasonal information from timestamps, or combining multiple features to generate new composite features.

[0068] It is understandable that after the features are selected, the features are standardized, including: 1. Normalization and standardization: normalize or standardize the numerical features to eliminate the impact of different dimensions and data sizes on the model. 2. Categorical feature encoding: convert the categorical features into a numerical form that the model can process, such as using One-Hot Encoding or Label Encoding.

[0069] S140, inputting the operation characteristics into a first prediction model obtained by pre-training to obtain a predicted traffic demand and a predicted load condition of the Nginx server in a preset future time period;

[0070] It is understandable that the first prediction model is a pre-trained model. In the training scenario, it is necessary to select a suitable model framework, build a training sample set, a verification sample set and a test sample set, and perform model training and model optimization.

[0071] Among them, there can be many model frameworks: 1. Deep neural network or DNN: suitable for processing complex nonlinear relationships and suitable as a benchmark model. 2. Convolutional neural network or CNN: If the features have local correlation in space or time, such as time series data, CNN can extract local features. 3. Recurrent neural network or RNN: especially its variants LSTM or long short-term memory network and GRU or gated recurrent unit, suitable for processing sequence data, such as log data and traffic patterns. 4. Hybrid model: combines multiple network structures, such as CNN and RNN, which can capture spatial and temporal features at the same time.

[0072] The determination process of the samples in the training sample set, validation sample set and test sample set can refer to the above S110 to S130. The training set is used to train the model, the validation set is used to adjust the model parameters and select the best model, and the test set is used to evaluate the generalization ability of the model.

[0073] Among them, the model training process can include: 1. Parameter tuning: select the appropriate loss function and optimizer, and optimize the model performance by adjusting hyperparameters such as learning rate, batch size, and number of iterations. 2. Regularization: To prevent overfitting, L1 or L2 regularization, dropout and other techniques can be used. 3. Training process: Use the training sample set to train the model, calculate the gradient through forward propagation and back propagation, and update the model weights. 4. Model evaluation: Use the validation sample set to evaluate the model performance and select the model that performs best on the validation sample set.

[0074] Among them, the performance indicators involved in the model optimization process may include accuracy, recall, F1 score, mean square error, etc. The model optimization process is based on the performance feedback of the validation sample set, adjusts the model structure and hyperparameters, and performs iterative training. Of course, if possible, model fusion techniques such as ensemble learning can be used to combine the prediction results of multiple models to improve the final performance.

[0075] Finally, the model is saved as a file for subsequent deployment and use. The trained model is integrated into the Nginx server or related services for application. In this way, in the application scenario, the operation characteristics are input into the first prediction model obtained by pre-training, and the predicted traffic demand and predicted load of the Nginx server in a preset future time period can be obtained.

[0076] S150, optimizing the traffic allocation strategy according to the predicted traffic demand;

[0077] For example, the traffic pattern of the Nginx server is known according to the predicted traffic demand, and high-value user requests can be allocated to the Nginx server with better performance reflected by the traffic pattern. Of course, high-value user requests can also be directly allocated to the Nginx server with higher predicted traffic demand, and low-value user requests can be allocated to the Nginx server with lower predicted traffic demand.

[0078] Among them, the traffic pattern can be request frequency, access path, user behavior, etc.

[0079] The first prediction model may be a supervised learning model, such as a classifier, an unsupervised learning model, etc. The classifier may be a random forest, a support vector machine, etc.

[0080] Understandably, optimizing the traffic distribution strategy can reduce the response time of the Nginx server, improve throughput, and ensure that all Nginx servers are effectively utilized.

[0081] S160. Optimize the load balancing strategy of the Nginx server and optimize the resource allocation strategy according to the predicted load condition.

[0082] For example, for load balancing strategies, if the forecast shows that a server is about to face high load, some requests can be transferred to other servers in advance.

[0083] It is understandable that adjustments to the load balancing strategy may include changing server weights, modifying load balancing algorithms (such as polling, minimum number of connections, IP hashing, etc.), or enabling backup servers.

[0084] For example, for resource allocation strategies, more CPU and memory resources can be allocated to upcoming high-traffic requests. By optimizing resource allocation, it can be ensured that the server can still provide stable services under high-traffic conditions.

[0085] It can be seen that according to the embodiment of the present invention, the traffic distribution strategy, load balancing strategy and resource allocation strategy can be adjusted, so that the distribution of traffic, load and resources is more reasonable, thereby improving the performance of the Nginx server.

[0086] In one embodiment, the method may further include:

[0087] Real-time monitoring of Nginx server traffic data;

[0088] Input the current traffic data into the pre-trained anomaly detection model to obtain the detection result of whether there is abnormal network behavior;

[0089] If the detection result is that there is currently abnormal network behavior, the pre-configured protection measures are triggered to execute, the security rules and / or protection strategies are dynamically adjusted, and relevant log data is recorded.

[0090] As can be seen, real-time monitoring of traffic data is performed, and real-time traffic data is input into the trained anomaly detection model to detect whether there is abnormal behavior. Abnormal behavior may include abnormally high request frequency, access to uncommon pages, sudden changes in user behavior patterns, etc. Once an anomaly is detected, immediate measures are taken for protection. For example, the request frequency from a specific IP address can be limited to block suspicious requests. For confirmed malicious traffic, more stringent measures can be taken, such as direct blocking, adding to blacklists, etc. Dynamically adjust security rules and protection strategies based on anomaly detection results and network security situation. If a certain type of attack is detected to occur frequently, the protection rules for this type of attack can be temporarily strengthened. Once a major anomaly is detected, the security operation and maintenance personnel are notified immediately for rapid response. For detected abnormal behavior, detailed log information is recorded to facilitate subsequent analysis and auditing.

[0091] In one embodiment, the method may further include:

[0092] Input the current traffic data into the pre-trained analysis model to obtain the current user behavior data;

[0093] Identifying the user's content preferences based on the user behavior data;

[0094] The cache strategy of the Nginx server is adjusted according to the user behavior data and the content preference.

[0095] It can be seen that the analysis model is used to analyze the user's behavior data, such as access frequency, access path, page dwell time, etc. Through these data, it is possible to identify which content the user is interested in and which content is hot content, that is, to determine the user's content preference. Then, according to the user behavior data and the content preference, the cache strategy of the Nginx server is adjusted. For example, for frequently accessed content, a longer cache time can be set to reduce the server load. For infrequently accessed content, the cache time can be reduced, or lazy loading technology can be used to load content only when needed.

[0096] In one embodiment, the method may further include:

[0097] Based on the current user behavior data, the content to be accessed by the user in a preset future time period is predicted; through pre-fetching technology, the content to be accessed by the user is loaded into the cache before receiving the user request.

[0098] Specifically, the prediction model can be used to predict the content that will be accessed by the user in a preset future time period. The content that is predicted to be accessed can be loaded into the cache in advance. In this way, when the user actually requests the content, it can be quickly obtained from the cache, reducing the user's waiting time. Pre-loading is achieved through pre-fetching technology, that is, actively loading the content into the cache before the user actually requests it.

[0099] In one embodiment, the method may further include:

[0100] Configure a cache invalidation policy, and invalidate the content in the cache according to the cache invalidation policy to ensure the freshness of the content in the cache; monitor the cache performance of the cache, and adjust the cache invalidation policy based on the cache performance obtained through monitoring.

[0101] It can be seen that setting a reasonable cache invalidation strategy ensures the freshness of cached content. For example, you can use a cache invalidation mechanism based on the last modified time, or use etag to verify content changes. Monitor cache performance in real time, such as cache hit rate, cache response time, etc., and continuously adjust and optimize cache invalidation strategies based on these data. Through performance monitoring, you can also promptly discover problems with cache invalidation strategies and take measures to resolve them.

[0102] In one embodiment, the method may further include:

[0103] Analyze the load and resource usage of the Nginx server based on the performance indicators;

[0104] According to the load situation and resource usage situation, the configuration parameters of the Nginx server are adjusted; according to the real-time user request, the real-time needs of the user are determined; according to the real-time needs, the configuration parameters of the Nginx server are adjusted; wherein the adjustment operation of the configuration parameters is implemented by an automated script.

[0105] Specifically, machine learning models can be used to analyze server performance data, such as CPU usage, memory usage, disk I / O, etc. By analyzing this data, you can understand the server load and resource usage trends. According to the analysis results, the configuration parameters of Nginx are automatically adjusted. For example, according to the CPU usage, adjust the number of worker processes or threads; according to the memory usage, adjust the memory allocation. Adjusting the configuration parameters can improve the performance and resource utilization of the server and ensure stability and security. In addition, the configuration parameters of the Nginx server are dynamically adjusted according to real-time user needs. For example, increase the number of worker processes during peak hours to handle more concurrent requests; reduce the number of worker processes during off-peak hours to save resources. Dynamically adjusting server settings can ensure that the server can provide stable services under different load conditions.

[0106] Among them, write automation scripts to realize the automation of configuration management. These scripts can be run regularly or when triggered by specific events to realize automatic adjustment of Nginx configuration. Automation scripts can be integrated into existing automation operation and maintenance tools, such as Ansible, Puppet, etc., to achieve more comprehensive automation operation and maintenance.

[0107] In one embodiment, the method may further include:

[0108] Inputting the log data and the performance index into a pre-trained second prediction model to obtain predicted problems of the Nginx server in a preset future time period; and performing advance maintenance and optimization on the Nginx server according to the predicted problems;

[0109] Regularly perform health checks on the Nginx server to obtain health check results; and take preventive measures based on potential problems in the health check results.

[0110] It can be seen that the second prediction model is used to predict possible problems based on the performance data and log information of the Nginx server, so that potential problems such as performance degradation trends, abnormal resource usage, and error log patterns can be identified. According to the predicted problems, maintenance and optimization are carried out in advance. For example, the server resources that are about to have bottlenecks are upgraded, or the configuration is adjusted to improve performance. Preventive maintenance can reduce the probability of failure and improve the reliability and stability of the system. Regularly perform health checks on the Nginx server, including hardware checks, software checks, and performance checks. The inspection can find potential problems, such as hardware aging, software vulnerabilities, performance bottlenecks, etc. According to the results of the health check, measures are taken to prevent potential failures. For example, replace aging hardware, fix software vulnerabilities, and optimize performance bottlenecks. Fault prevention can avoid the occurrence of failures and improve the reliability and stability of the system.

[0111] It is understandable that the above process involves multiple models. In order to ensure the accuracy of the model output, the model can be incrementally trained regularly using incremental data to facilitate continuous learning and optimization of the model. Continuous learning and optimization can help the model better predict or analyze and improve the accuracy and reliability of the output.

[0112] In actual scenarios, for dynamically generated content, computing tasks can be pre-placed on the server or edge node through technologies such as server-side rendering or edge computing to reduce client processing time. For static content, a content delivery network can be used to accelerate content distribution.

[0113] The above involves a variety of technical knowledge:

[0114] 1. Machine Learning: An artificial intelligence (AI) technology that allows computer systems to learn from data and automatically improve their performance.

[0115] 2. Deep Learning: A subfield of machine learning that focuses on building and training artificial neural networks with multiple layers (or "depth").

[0116] 3. Convolutional Neural Network (CNN): A special deep learning architecture commonly used in image recognition and processing. It uses convolutional layers to extract local features in images.

[0117] 4. Recurrent Neural Network, RNN: An artificial neural network that can process sequential data and remember past information. Long short-term memory network LSTM and gated recurrent unit are two common variants of RNN.

[0118] 5. Feature Engineering: Involves extracting and constructing features from raw data for use by machine learning models.

[0119] 6. Anomaly detection: A data analysis technique used to identify anomalies or unusual behavior in data, often used to detect cyber attacks or system failures.

[0120] 7. Load balancing: In a distributed system, incoming requests are distributed across multiple servers to optimize resource utilization and improve system availability.

[0121] 8. Cache: Store frequently accessed data in fast access memory to facilitate quick retrieval and reduce access to original data.

[0122] 9. Predictive maintenance: A preventive maintenance strategy that reduces downtime and maintenance costs by predicting potential equipment failures.

[0123] 10. Performance monitoring: Monitor system performance in real time to identify performance bottlenecks, resource consumption trends, and potential problems.

[0124] 11. Automation: Using computer programs or automated tools to perform repetitive or highly complex tasks to improve efficiency and reduce human error.

[0125] 12. Ensemble learning: A machine learning technique that improves overall performance by combining the prediction results of multiple models.

[0126] In the embodiment of the present invention, the following key operations are involved:

[0127] 1. Intelligent analysis and prediction: Using large models to conduct intelligent data analysis can conduct in-depth analysis of traffic patterns, user behaviors, etc., and predict future traffic demand.

[0128] 2. Dynamic resource allocation: Dynamically adjust server resource allocation based on real-time data and prediction results, such as adjusting the number of working processes and threads, to adapt to different load conditions.

[0129] 3. Automated fault detection and recovery: Monitor server performance indicators in real time, quickly detect abnormal behavior, and automatically execute recovery measures, such as restarting services, switching to backup servers, etc.

[0130] 4. Content optimization and caching strategy: Optimize content caching strategy based on user behavior and content access patterns, such as loading hot content into the cache in advance to reduce user waiting time.

[0131] 5. Security enhancement: Use large models to detect abnormal traffic and identify patterns to improve the security of the Nginx server and prevent potential attacks and abuse.

[0132] 6. Log analysis and performance tuning: Analyze the log data generated by Nginx, identify performance bottlenecks, and provide optimization suggestions, such as adjusting network configuration and server settings.

[0133] 7. Predictive maintenance: Predict possible problems with the Nginx server, perform maintenance and optimization in advance, prevent potential failures, and improve system stability and reliability.

[0134] 8. Personalized user experience: By analyzing user behavior and preferences, we provide personalized content recommendations and customized user experience to improve user satisfaction and retention rate.

[0135] 9. Automated configuration management: Use models to analyze server resource usage, automatically adjust Nginx configuration parameters, and dynamically adjust server settings based on real-time needs.

[0136] 10. Real-time response capability: It can respond to traffic changes in real time, dynamically adjust load balancing strategies, optimize resource allocation, and improve website performance. These features enable the Nginx performance improvement method based on the large model to operate more intelligently and efficiently to adapt to the ever-changing and growing needs of Internet services.

[0137] From the perspective of scientific innovation and social impact, the embodiments of the present invention not only improve server performance, but also promote the progress of science and technology, promote social development and improve the quality of human life. The following are detailed descriptions of several aspects:

[0138] (1) Scientific innovation:

[0139] 1. Promote the development of AI technology: By applying large models in Nginx, we can push the boundaries of artificial intelligence and machine learning technologies, especially in processing high-concurrency, real-time data streams.

[0140] 2. Research and application of data science: Big data analysis can provide a deep understanding of user behavior and network traffic patterns, providing new perspectives and practical scenarios for data science research.

[0141] 3. Interdisciplinary integration: This invention involves multiple disciplines, such as computer science, network engineering, artificial intelligence, etc., and promotes knowledge integration and innovation in these fields.

[0142] (2) Social impact:

[0143] 1. Improve Internet service quality and user experience: By optimizing Nginx performance, you can provide faster and more reliable Internet services, which directly affects the user's online experience.

[0144] 2. Infrastructure to support digital society: With the acceleration of digital transformation, high-performance web servers are the basis for supporting various online services and are crucial for e-commerce, remote work, online education, etc.

[0145] 3. Promote economic growth: By improving the usability and responsiveness of the website, it can help companies attract and retain customers, thereby promoting economic growth and business success.

[0146] 4. Enhanced network security: With the increase in cyber attacks, enhancing the security of Nginx through AI will help protect the data security of individuals and enterprises and reduce the risk of cybercrime.

[0147] (3) Sustainability and environmental impact:

[0148] 1. Optimize resource usage: Through intelligent resource allocation and predictive maintenance, energy consumption and hardware waste can be reduced, which has a positive impact on the environment.

[0149] 2. Support Green IT: The application of this technology will help promote the sustainable development of the IT industry and reduce carbon footprint.

[0150] In the second aspect, the embodiment of the present invention provides a Nginx server performance improvement device based on a large model, see Figure 2 , the device 100 comprises:

[0151] The data collection module 110 is used to collect the operation-related data of the Nginx server within a preset recent time period; wherein the operation-related data includes log data, performance indicators and network traffic data;

[0152] A preprocessing module 120, used for preprocessing the operation-related data;

[0153] A feature extraction module 130 is used to extract features from the preprocessed operation-related data, select features from the extracted features, and perform standardization conversion on the selected features to obtain the operation features of the Nginx server;

[0154] A first prediction module 140 is used to input the operation characteristics into a pre-trained first prediction model to obtain a predicted traffic demand and a predicted load condition of the Nginx server in a preset future time period;

[0155] A first optimization module 150, configured to optimize a traffic distribution strategy according to the predicted traffic demand;

[0156] The second optimization module 160 is used to optimize the load balancing strategy of the Nginx server and optimize the resource allocation strategy according to the predicted load situation.

[0157] In one embodiment, the device may further include:

[0158] The anomaly detection module is used to monitor the traffic data of the Nginx server in real time; input the current traffic data into the pre-trained anomaly detection model to obtain the detection result of whether there is currently abnormal network behavior; if the detection result is that there is currently abnormal network behavior, it triggers the execution of pre-configured protection measures, dynamically adjusts security rules and / or protection strategies, and records relevant log data.

[0159] In one embodiment, the device may further include:

[0160] The preference determination module is used to input the current traffic data into the pre-trained analysis model to obtain the current user behavior data; identify the user's content preference based on the user behavior data; and adjust the cache strategy of the Nginx server based on the user behavior data and the content preference.

[0161] In one embodiment, the device may further include:

[0162] The preloading module is used to predict the content to be accessed by the user in a preset future time period based on the current user behavior data; through the pre-fetching technology, the content to be accessed by the user is loaded into the cache before receiving the user request.

[0163] In one embodiment, the device may further include:

[0164] The invalidation processing module is used to configure the cache invalidation strategy and invalidate the content in the cache according to the cache invalidation strategy to ensure the freshness of the content in the cache; monitor the cache performance of the cache and adjust the cache invalidation strategy according to the cache performance obtained by monitoring.

[0165] In one embodiment, the device may further include:

[0166] The parameter configuration module is used to analyze the load and resource usage of the Nginx server according to the performance indicators; trigger the adjustment of the configuration parameters of the Nginx server according to the load and resource usage; determine the real-time needs of users according to real-time user requests; trigger the adjustment of the configuration parameters of the Nginx server according to the real-time needs; wherein the adjustment operation of the configuration parameters is implemented by an automated script.

[0167] In one embodiment, the device may further include:

[0168] The problem prediction module is used to input the log data and the performance indicators into a pre-trained second prediction model to obtain predicted problems that may occur in the Nginx server within a preset future time period; perform advance maintenance and optimization on the Nginx server based on the predicted problems; perform health checks on the Nginx server regularly to obtain health check results; and take preventive measures based on potential problems in the health check results.

[0169] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0170] In a third aspect, an embodiment of the present invention provides a computer-readable medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0171] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can read and execute the program code stored in the storage medium.

[0172] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0173] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0174] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0175] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0176] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0177] In a fourth aspect, an embodiment of the present specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any embodiment of the specification.

[0178] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0179] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0180] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0181] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for improving Nginx server performance based on a large model, characterized in that: include: Collecting operation-related data of the Nginx server within a preset recent time period; wherein the operation-related data includes log data, performance indicators and network traffic data; Preprocessing the operation-related data; Extract features from the preprocessed operation-related data, select features from the extracted features, and perform standardization conversion on the selected features to obtain the operation features of the Nginx server; Inputting the operation characteristics into a pre-trained first prediction model to obtain the predicted traffic demand and predicted load of the Nginx server in a preset future time period; Optimizing the traffic distribution strategy according to the predicted traffic demand; According to the predicted load situation, the load balancing strategy of the Nginx server is optimized and the resource allocation strategy is optimized.

2. The method according to claim 1, characterized in that Also includes: Real-time monitoring of Nginx server traffic data; Input the current traffic data into the pre-trained anomaly detection model to obtain the detection result of whether there is abnormal network behavior at present; If the detection result is that there is currently abnormal network behavior, the pre-configured protection measures are triggered to execute, the security rules and / or protection strategies are dynamically adjusted, and relevant log data is recorded.

3. The method according to claim 2, characterized in that Also includes: Input the current traffic data into the pre-trained analysis model to obtain the current user behavior data; Identifying the user's content preferences based on the user behavior data; The cache strategy of the Nginx server is adjusted according to the user behavior data and the content preference.

4. The method according to claim 3, characterized in that Also includes: Predicting content that will be accessed by the user within a preset future time period based on the current user behavior data; Through the pre-fetching technology, the content to be accessed by the user is loaded into the cache before receiving the user's request.

5. The method according to claim 3, characterized in that: Also includes: Configure a cache invalidation policy and invalidate the content in the cache according to the cache invalidation policy to ensure the freshness of the content in the cache; The cache performance of the cache is monitored, and the cache invalidation strategy is adjusted according to the cache performance obtained through monitoring.

6. The method according to claim 1, characterized in that Also includes: Analyze the load and resource usage of the Nginx server based on the performance indicators; According to the load situation and resource usage situation, the configuration parameters of the Nginx server are adjusted; according to the real-time user request, the real-time needs of the user are determined; according to the real-time needs, the configuration parameters of the Nginx server are adjusted; wherein the adjustment operation of the configuration parameters is implemented by an automated script.

7. The method according to claim 1, characterized in that Also includes: Inputting the log data and the performance index into a pre-trained second prediction model to obtain prediction problems that may occur in the Nginx server within a preset future time period; According to the predicted problem, the Nginx server is maintained and optimized in advance; Regularly perform health checks on the Nginx server to obtain health check results; Take preventive measures based on potential problems found in the health check results.

8. A device for improving Nginx server performance based on a large model, characterized in that: include: A data collection module is used to collect operation-related data of the Nginx server within a preset recent time period; wherein the operation-related data includes log data, performance indicators and network traffic data; A preprocessing module, used for preprocessing the operation-related data; A feature extraction module is used to extract features from the preprocessed operation-related data, select features from the extracted features, and perform standardized conversion on the selected features to obtain the operation features of the Nginx server; A first prediction module is used to input the operation characteristics into a first prediction model obtained by pre-training to obtain the predicted traffic demand and predicted load of the Nginx server in a preset future time period; A first optimization module, configured to optimize a traffic distribution strategy according to the predicted traffic demand; The second optimization module is used to optimize the load balancing strategy of the Nginx server and optimize the resource allocation strategy according to the predicted load situation.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

10. A computing device, characterized in that The method comprises a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Identification analysis node load balancing device based on machine learning

    CN111930511A

  • Traffic detection method and device, equipment and storage medium

    CN114666162A

  • Resource acceleration method and system

    CN116700994A

  • Cloud service resource dynamic prediction management method

    CN117076882A

  • Server health diagnosis method and system, electronic equipment and storage medium

    CN117194188A