Server overload protection methods, devices, electronic equipment, and storage media
Patent Information
- Application Number
- CN202311265304.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-09-27
AI Technical Summary
[0004]本申请提供一种服务器过载保护方法、装置、电子设备及存储介质,以便解决相关技术中的过载保护方法导致服务器无法为用户提供正常服务的问题
[0043]In this embodiment, a first load value of the server is obtained, and a first target difference is determined based on the first load value and a first load threshold. If the first target difference is less than the first difference threshold, target data in the current pending data of the server is determined, and the target data is sent to the smart network card connected to the server. The smart network card processes the target data and sends the processing result of the target data to the user of the server. Thus, by setting a first difference threshold, when the difference between the server's first load value and the first load threshold (i.e., the first target difference) is less than the first difference threshold, the pending data is reasonably classified according to preset data classification rules, and the classified target data is diverted to the smart network card for processing. The smart network card then sends the processing result of the target data to the user of the server. This reduces the load pressure on the server through the smart network card, allowing the server to provide normal service to the user. Compared with the methods of rate limiting or circuit breaking used in related technologies for server overload protection, the server overload protection method of this embodiment does not impose traffic restrictions, function restrictions, or service shutdowns, nor does it affect the user's access speed during peak server access periods. Therefore, it can improve the server overload protection effect.
Smart Images

Figure CN117240786B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a server overload protection method, device, electronic device and storage medium. Background Technology
[0002] Currently, during peak server access periods, a large number of users may access the server, and the concentrated influx of data can cause server congestion and overload, leading to server lag. Furthermore, when user network demands exceed the server's load capacity, if overload protection is not implemented in time, the accumulated load pressure may cause the server to crash.
[0003] In related technologies, when excessive server load is detected, rate limiting strategies are typically used to restrict server traffic or functionality, or circuit breakers are triggered to stop the server from providing service. However, rate limiting or circuit breaking can prevent the server from providing normal service to users, affecting access speeds during peak server usage periods. Summary of the Invention
[0004] This application provides a server overload protection method, apparatus, electronic device, and storage medium to solve the problem that overload protection methods in related technologies cause servers to be unable to provide normal services to users.
[0005] To solve the above-mentioned technical problems, this application is implemented as follows:
[0006] In a first aspect, embodiments of this application propose a server overload protection method, applied to a server connected to a smart network interface card (NIC), the method comprising:
[0007] Obtain the current first load value of the server, and determine the first target difference based on the first load value and the first load threshold corresponding to the server;
[0008] If the first target difference is less than a preset first difference threshold, target data is determined in the server's data to be processed; wherein, the target data is obtained by classifying the data to be processed according to a preset data classification rule;
[0009] The target data is sent to the smart network interface card (NIC); wherein the smart NIC is used to process the target data and send the processing result to the user of the server.
[0010] Optionally, the method further includes:
[0011] Obtain the current second load value of the smart network card and the second load threshold corresponding to the smart network card, and determine the second target difference based on the second load value and the second load threshold;
[0012] If the second target difference is less than a preset second difference threshold, obtain the latest expansion data of the server;
[0013] When the latest expansion data indicates that the server expansion is complete, stop sending the target data to the smart network card.
[0014] Optionally, the data classification rule is determined based on the data processing priority of the server; before determining the target data in the data to be processed by the server, the method further includes:
[0015] The data to be processed is classified according to the data classification rules to obtain classified data; wherein, the classified data includes at least one of first priority data and other data, and the first priority data has a higher processing priority than the other data in the server;
[0016] Determining the target data in the server's pending data includes:
[0017] If the other data exists in the classified data, the other data will be identified as the target data.
[0018] Optionally, the other data includes second-priority data and third-priority data, wherein the second-priority data has a higher processing priority than the third-priority data in the server; the method further includes:
[0019] Delete the third priority data;
[0020] In the case that the other data exists in the classified data, determining the other data as the target data includes:
[0021] If the second priority data exists in the classified data, the second priority data is determined as the target data.
[0022] Optionally, the server includes a storage device, the storage device includes a pre-configured target storage module, and the smart network interface card (NIC) is communicatively connected to the storage device; the method further includes:
[0023] The first priority data and the second priority data are stored in the target storage module;
[0024] When the first load value is not less than the first load threshold, the first priority data is sent to the smart network card through the target storage module; wherein, the smart network card is also used to store the first priority data;
[0025] Sending the target data to the smart network card includes:
[0026] The second priority data is sent to the smart network card through the target storage module.
[0027] Secondly, embodiments of this application propose a server overload protection method, applied to a smart network interface card (NIC), wherein the smart NIC is connected to a server, and the method includes:
[0028] The server receives target data sent by the server; wherein the target data is determined by the server from the server's current pending data when the first target difference is less than the first difference threshold; the target data is obtained by the server after classifying the pending data according to a preset data classification rule; and the first target difference is determined by the server based on a first load threshold and a first load value obtained.
[0029] The target data is processed, and the processing result is sent to the user of the server.
[0030] Optionally, the server includes a storage device, the storage device includes a pre-configured target storage module, and the smart network interface card (NIC) is communicatively connected to the storage device; the method further includes:
[0031] The server receives and saves the first priority data sent by the server; wherein the server classifies the data to be processed according to the data classification rules to obtain classified data, the classified data including the first priority data and the second priority data; the server saves the first priority data and the second priority data in the target storage module, the first priority data being sent by the server through the target storage module when the first load value is not less than the first load threshold;
[0032] The receiving of the target data sent by the server includes:
[0033] Receive the second priority data sent by the server through the target storage module.
[0034] Thirdly, embodiments of this application provide a server overload protection device, applied to a server, the server being connected to a smart network interface card (NIC), the device comprising:
[0035] The first acquisition module is used to acquire the current first load value of the server and determine a first target difference based on the first load value and the first load threshold corresponding to the server.
[0036] The determining module is used to determine the target data in the server's data to be processed when the first target difference is less than a preset first difference threshold; wherein the target data is obtained by classifying the data to be processed according to a preset data classification rule;
[0037] The first sending module is used to send the target data to the smart network card; wherein the smart network card is used to process the target data and send the processing result to the user of the server.
[0038] Fourthly, embodiments of this application provide a server overload protection device applied to a smart network interface card (NIC), the smart NIC being connected to a server, the device comprising:
[0039] The first receiving module is used to receive target data sent by the server; wherein the target data is determined by the server from the server's current pending data when the first target difference is less than the first difference threshold; the target data is obtained by the server after classifying the pending data according to a preset data classification rule; and the first target difference is determined by the server based on a first load threshold and a first load value obtained.
[0040] The second sending module is used to process the target data and send the processing result to the user of the server.
[0041] Fifthly, embodiments of this application provide an electronic device, including: a processor, a memory, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the server overload protection method as described in the first aspect.
[0042] In a sixth aspect, embodiments of this application provide a storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the server overload protection method as described in the first aspect.
[0043] In this embodiment, a first load value of the server is obtained, and a first target difference is determined based on the first load value and a first load threshold. If the first target difference is less than the first difference threshold, target data in the current pending data of the server is determined, and the target data is sent to the smart network card connected to the server. The smart network card processes the target data and sends the processing result of the target data to the user of the server. Thus, by setting a first difference threshold, when the difference between the server's first load value and the first load threshold (i.e., the first target difference) is less than the first difference threshold, the pending data is reasonably classified according to preset data classification rules, and the classified target data is diverted to the smart network card for processing. The smart network card then sends the processing result of the target data to the user of the server. This reduces the load pressure on the server through the smart network card, allowing the server to provide normal service to the user. Compared with the methods of rate limiting or circuit breaking used in related technologies for server overload protection, the server overload protection method of this embodiment does not impose traffic restrictions, function restrictions, or service shutdowns, nor does it affect the user's access speed during peak server access periods. Therefore, it can improve the server overload protection effect. Attached Figure Description
[0044] Figure 1 This is one of the flowcharts of a server overload protection method provided in this application embodiment;
[0045] Figure 2 This is the second step in the flowchart of a server overload protection method provided in this application embodiment;
[0046] Figure 3 This is a schematic diagram illustrating the location of a data identifier provided in an embodiment of this application;
[0047] Figure 4 This is a schematic diagram of overload processing for a server overload protection method provided in an embodiment of this application;
[0048] Figure 5 This is a schematic diagram of the data flow of a server overload protection method provided in an embodiment of this application;
[0049] Figure 6 This is a flowchart illustrating a server overload protection method provided in an embodiment of this application;
[0050] Figure 7 This is a flowchart of another server overload protection method provided in an embodiment of this application;
[0051] Figure 8 This is a schematic diagram of the structure of a server overload protection device provided in an embodiment of this application;
[0052] Figure 9 This is a schematic diagram of another server overload protection device provided in an embodiment of this application;
[0053] Figure 10 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0054] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0055] It should be noted that a smart network interface card (NIC) is an intelligent network device that meets the network processing needs of storage, computing, and data centers, reduces the burden on the server's central processing unit (CPU), improves computing efficiency, and possesses computing capabilities while being flexibly programmable. A smart NIC not only connects to the network and server for convenient network data transmission and communication, but also has an independent system, thereby reducing the server's CPU consumption and enabling the server to run critical applications more efficiently.
[0056] Figure 1 This is one of the flowcharts of a server overload protection method provided in this application embodiment, such as... Figure 1 As shown, this server overload protection method is applied to a server connected to a smart network interface card (NIC), and the method includes:
[0057] Step 101: Obtain the current first load value of the server, and determine the first target difference based on the first load value and the first load threshold corresponding to the server.
[0058] In this embodiment, the smart network card can be connected to the server's CPU via a high-speed serial computer expansion bus (Peripheral Component Interconnect Express, PCIe) slot, or the smart network card can be connected to an adapter card in the server via a PCIe cable. This is merely an illustrative example, and this embodiment does not impose any limitations.
[0059] In this embodiment, the first load threshold may include thresholds for various load indicators in the server, such as CPU utilization and server memory usage. The actual value of the first load threshold can be preset according to actual application requirements. For example, the server CPU utilization reaches 90% and the memory usage reaches 80%. The first load threshold can be generated through real-time World Wide Web (WEB) configuration information. The load threshold can be set in the WEB configuration information on the WEB page according to actual needs, and automatically sent to the server and taken effect after the WEB configuration information is updated and maintained.
[0060] In this embodiment, a load capture device can be used to capture various load metrics of the server in real time, obtaining the latest load value as the server's current first load value. The load capture device can be executed by software or hardware and can be integrated into the server. The load capture cycle can be preset. For example, the load capture device can be set to capture once every 30 seconds (s). After capturing the first load value, it is compared with the previously captured load value. If the value has not changed, the previously captured load value is directly output; if it has changed, the latest captured load value is output, thus obtaining the server's first load value.
[0061] In this embodiment, the first target difference can be obtained by subtracting the server's current first load value from the server's first load threshold. The first target difference can be positive or negative; a negative value indicates that the server's current first load value exceeds the first load threshold, thus the server is considered "overloaded." Alternatively, the first target difference can be obtained by subtracting the first load threshold from the server's current first load value; a positive first target difference indicates that the server's current first load value exceeds the first load threshold, thus the server is considered "overloaded." The method for obtaining the first target difference can be chosen according to actual needs, and this embodiment does not impose any restrictions on this.
[0062] Step 102: If the first target difference is less than a preset first difference threshold, determine the target data in the server's data to be processed; wherein the target data is obtained by classifying the data to be processed according to a preset data classification rule.
[0063] In this embodiment, the first difference threshold can be the overall load difference threshold of the server, or it can include the individual load difference thresholds for each load indicator of the server. This can be determined according to actual needs, and this embodiment does not impose any restrictions on this. For example, the first difference threshold can be 1%. The first target difference can be compared with the preset first difference threshold. When the first target difference is less than the first difference threshold, it indicates that the server's latest load value, i.e., the first load value, is close to or has exceeded the server's first load threshold. In this case, overload protection is needed to prevent the server's load pressure from continuing to increase.
[0064] In this embodiment of the application, due to the setting of the first difference threshold, when the first target difference is less than the first difference threshold, the current first load value of the server may not have exceeded the first load threshold, or the first load value may have just exceeded the first load threshold. At this time, the server still has a certain data processing capability, so it can perform simple data classification on the data to be processed according to the preset data classification rules.
[0065] In this embodiment, the data classification rule can be the server's own data classification mechanism, which can classify data to be processed according to the server's processing priority for different types of data. For example, the first level is the data stream that is already in the server's first-level data category, i.e., the monitoring data essential for the normal operation of the server; the second level is the data that ensures that users can perform basic operations; and the third level is all data other than the first two. Alternatively, the data classification rule can be a pre-defined custom classification rule, such as classifying device status as the first level, monitoring data as the second level, and operator operation of the device as the third level, etc. This embodiment does not impose any limitations on this.
[0066] In this embodiment of the application, the target data can be data with relatively low priority among the data to be processed after data classification, such as data other than the first level. This part of the data can be diverted to the smart network card for processing as target data. The smart network card can share part of the data processing work of the server, and the server only needs to process the first level data, such as the monitoring data that is essential to ensure the normal operation of the server, thereby reducing the load pressure on the server.
[0067] Step 103: Send the target data to the smart network card; wherein the smart network card is used to process the target data and send the processing result to the user of the server.
[0068] In this embodiment, the server can send target data to the smart network interface card (NIC) via a bus connected to the NIC. The smart NIC also has an internal processor, such as a CPU, which processes the target data to obtain the processing result. Then, the smart NIC can directly send the processing result to the server's client, thereby sending the result to the server's user.
[0069] In this embodiment, a first load value of the server is obtained, and a first target difference is determined based on the first load value and a first load threshold. If the first target difference is less than the first difference threshold, target data in the current pending data of the server is determined, and the target data is sent to the smart network card connected to the server. The smart network card processes the target data and sends the processing result of the target data to the user of the server. Thus, by setting a first difference threshold, when the difference between the server's first load value and the first load threshold (i.e., the first target difference) is less than the first difference threshold, the pending data is reasonably classified according to preset data classification rules, and the classified target data is diverted to the smart network card for processing. The smart network card then sends the processing result of the target data to the user of the server. This reduces the load pressure on the server through the smart network card, allowing the server to provide normal service to the user. Compared to the methods of rate limiting or circuit breaking used in related technologies for server overload protection, the server overload protection method of this embodiment does not impose traffic restrictions, function restrictions, or service shutdowns. Therefore, it does not affect the user's access speed during peak server access periods, thus improving the server overload protection effect.
[0070] Figure 2 This is the second step in the flowchart of a server overload protection method provided in this application embodiment, as follows: Figure 2 As shown, this server overload protection method is applied to a server connected to a smart network interface card (NIC), and the method includes:
[0071] Step 201: Obtain the current first load value of the server, and determine the first target difference based on the first load value and the first load threshold corresponding to the server.
[0072] The specific implementation method of this step can be referred to the relevant description in step 101 of the aforementioned embodiments, and will not be repeated here.
[0073] Optionally, the data classification rule is determined based on the data processing priority of the server; the method further includes:
[0074] Step 202: Classify the data to be processed according to the data classification rules to obtain classified data; wherein, the classified data includes at least one of first priority data and other data, and the first priority data has a higher processing priority than the other data in the server.
[0075] In this embodiment, the data processing priority of the server may include: monitoring data essential for the normal operation of the server is the first priority; data that ensures basic user operations are met is the second priority; and all data other than the first two types is the third priority. The data classification rule can determine the specific priority of the data to be processed within the server based on its attributes. The data to be processed is classified according to the data classification rule to obtain categorized data. The categorized data may include one or more of the first, second, and third priorities, and this embodiment does not impose any limitations on this. First-priority data may be monitoring data essential for the normal operation of the server. First-priority data is processed by the server itself and has a higher processing priority than second-priority and third-priority data. Second-priority and third-priority data can be collectively referred to as other data.
[0076] Step 203: If the first target difference is less than a preset first difference threshold, determine the target data in the server's data to be processed; wherein the target data is obtained by classifying the data to be processed according to a preset data classification rule.
[0077] Optionally, step 203 may include the following steps:
[0078] If the other data exists in the classified data, the other data will be identified as the target data.
[0079] In this embodiment, when the first target difference is less than the first difference threshold, it indicates that the server is nearing or has already become overloaded. In this case, overload protection is needed to prevent the server's load from increasing further. At this time, the data to be processed on the server can be split, with some data sent to the smart network interface card (NIC) for processing. Specifically, after classifying the data to be processed according to the data classification rules, if other data exists within the classified data, the processing priority of these other data on the server is relatively low. Therefore, these other data can be identified as target data and sent to the smart NIC for processing, thus reducing the server's load.
[0080] In this embodiment, the data to be processed is classified according to data classification rules to obtain classified data. Since the data classification rules are determined based on the server's data processing priority, the classified data includes at least one of first-priority data and other data. The first-priority data has a higher processing priority than other data on the server. In this way, the data to be processed can be reasonably classified according to the server's data processing priority to determine whether the data to be processed includes other data with relatively low priority. Then, if other data exists in the classified data, the other data is identified as target data and sent to the smart network card for processing. In this way, the smart network card can share part of the server's data processing work, and the server only needs to process the first-priority data. Therefore, the server's load pressure can be reduced.
[0081] Optionally, the other data includes second-priority data and third-priority data, wherein the second-priority data has a higher processing priority than the third-priority data in the server; when the other data exists in the classified data, determining the other data as the target data includes:
[0082] If the second priority data exists in the classified data, the second priority data is determined as the target data.
[0083] The method further includes:
[0084] Step 204: Delete the third priority data.
[0085] In this embodiment, the second priority data can be data that ensures basic user operations are possible. The third priority data can be all data in the data to be processed except for the first and second priority data. The second priority data has a lower processing priority than the first priority data on the server. However, to avoid impacting user access speed to the server, the second priority data also needs to be processed promptly. Therefore, if second priority data exists in the categorized data, it can be identified as target data and sent to the smart network interface card (NIC) for processing. The NIC's CPU can process the second priority data and send the processing result to the server's client to avoid impacting user access speed during peak server access periods.
[0086] It should be noted that smart network interface cards (NICs) already have a certain load when working normally in a server. Therefore, to avoid the third-priority data consuming the server's storage resources and the smart NIC's resources, the third-priority data can be directly deleted, thereby reducing the impact of data diversion on the smart NIC's own business data processing.
[0087] In this embodiment, categorized data can be encoded and registered. Specifically, data identifiers can be added to first-priority data and second-priority data, such as using aa00 to identify first-priority data and 00aa to identify second-priority data. The range aa-zz contains 676 intervals for data size classification, and the last two digits of the data identifier distinguish the data type, representing 256 data types from 00 to FF. The four-digit identifier provides a total of 173,056 possible data identifiers. This is merely an example, and this embodiment does not impose any limitations.
[0088] In this embodiment, a data identifier field can be added at a preset position in each original data segment obtained after data classification. The data identifier in the data identifier field distinguishes between first-priority data and second-priority data. The data identifier field can be added at the beginning or end of the original data segment; this embodiment does not impose any limitation on this. It should be noted that the data identifier does not lose the original essence of the data. When processing the data, the data identifier field can be deleted, and then the original data segment can continue to be processed without affecting the original data.
[0089] Figure 3 This is a schematic diagram illustrating the location of a data identifier provided in an embodiment of this application, such as... Figure 3 As shown, a data identifier field can be added before the original data segment to differentiate the processing priority of the data in that segment. Data with an added identifier essentially has an "identity" that distinguishes it from ordinary data. The data identifier can be used to locate data with first and second priority. When the server is overloaded, the target data can be retrieved from the server's storage based on the data identifier and routed to the smart network interface card (NIC) for processing. When the smart NIC contains identified data, it indicates that the smart NIC is currently processing the target data routed from the server.
[0090] In this embodiment, other data may include second-priority data and third-priority data. If second-priority data exists in the classified data, it is identified as target data, and the third-priority data is deleted. Since the processing priority of second-priority data in the server is higher than that of third-priority data, the second-priority data can be sent to the smart network card for processing, thereby reducing the load pressure on the server. Directly deleting the third-priority data, which has a relatively lower processing priority, can avoid the third-priority data occupying the server's storage resources and also reduce the load pressure of the third-priority data on the smart network card, thus avoiding the impact on the smart network card's own business data processing.
[0091] Figure 4This is a schematic diagram of overload processing in a server overload protection method provided in an embodiment of this application, as shown below. Figure 4 As shown, when the server load reaches a threshold, such as when the first target difference is less than the first difference threshold, the data to be processed can be classified according to the data classification rules, and data identifiers can be added to the classified data to obtain first-priority data and second-priority data. The first-priority data and second-priority data can then be stored in the target storage module of the storage device. Subsequently, after determining the target data, such as the second-priority data, it can be directly streamed from the target storage module to the smart network interface card (NIC). Furthermore, see [link to relevant documentation]. Figure 4 If the difference between the first target and the first difference threshold is less than the first difference threshold, an alarm message can be generated. The server can then send the alarm message to the client to inform the user that the server is overloaded.
[0092] Optionally, the method further includes:
[0093] Step 205: Obtain the current second load value of the smart network card and the second load threshold corresponding to the smart network card, and determine the second target difference based on the second load value and the second load threshold.
[0094] In this embodiment, the second load threshold may include thresholds for various load indicators in the smart network interface card (NIC), such as CPU utilization and memory occupancy. The actual value of the second load threshold can be preset according to actual application requirements. For example, the CPU utilization and memory occupancy of the smart NIC may both reach 80%. The server can send a load acquisition command to the smart NIC. Upon receiving the command, the smart NIC responds by sending its latest load value (i.e., the current second load value) and the second load threshold to the server. The server can obtain the smart NIC's load threshold when connecting to it and store it as the second load threshold, then periodically update the second load threshold by communicating with the smart NIC. This is merely an example, and this embodiment does not impose limitations. The method for obtaining the second target difference can refer to the method for obtaining the first target difference in the aforementioned embodiments, and will not be repeated here.
[0095] Step 206: If the second target difference is less than a preset second difference threshold, obtain the latest expansion data of the server.
[0096] In this embodiment, the second difference threshold can be the overall load difference threshold of the smart network card, or it can include the individual load difference thresholds of each load indicator of the smart network card. This can be determined according to actual needs, and this embodiment does not impose any restrictions on this. The second target difference can be compared with a preset second difference threshold. When the second target difference is less than the second difference threshold, it indicates that the latest load value of the smart network card, i.e., the second load value, is close to or has exceeded the second load threshold of the smart network card. In this case, appropriate measures need to be taken to prevent the load pressure on the smart network card from continuing to increase.
[0097] In this embodiment, when the smart network interface card (NIC) is nearing or already overloaded, it can detect whether the server has completed its expansion and obtain the latest expansion data. Specifically, a load capture device can capture the latest load status of the server and compare it with the server's original load status to determine whether the server expansion is complete. For example, if the server's latest memory size is larger than its original memory size, it can be determined that the server's memory expansion is complete, and this can be used as the latest expansion data for the server.
[0098] Step 207: If the latest expansion data indicates that the server expansion is complete, stop sending the target data to the smart network card.
[0099] In this embodiment, if the latest expansion data of the server indicates that the server expansion is complete, the sending of target data to the smart network interface card (NIC) can be stopped, i.e., data diversion can be stopped. The smart NIC only needs to process its own business data, thereby relieving the load pressure on the smart NIC. The expanded server can then continue data processing to provide normal access services to users. This can handle peak server access periods and increase server expansion time. Server expansion strategies can be divided into two types: one is to increase the number of servers, and the other is to increase the storage, bandwidth, or computing power of a single server. Server expansion can refer to the implementation methods in related technologies, and this embodiment does not limit this approach.
[0100] In this embodiment, the server's processing capacity, storage capacity, etc., can be updated based on the latest expansion data, and then the actual value of the first load threshold can be re-determined based on the updated data. For example, the server's CPU utilization reaches 95%, and the memory utilization reaches 90%, representing an increase of several percentage points compared to before the expansion. Alternatively, if the first load threshold is in percentage form, it may not need to be updated, and the overload protection strategy can continue to be implemented according to the first load threshold. This is merely an example, and this embodiment does not impose any limitations. The expanded server can also implement overload protection based on the updated first load threshold, which can improve the flexibility of the server overload protection method of this application.
[0101] In this embodiment, the system obtains the current second load value and the corresponding second load threshold of the smart network interface card (NIC), and determines a second target difference based on the second load value and the second load threshold. If the second target difference is less than a preset second difference threshold, the system obtains the latest expansion data from the server. If the latest expansion data indicates that the server expansion is complete, the system stops sending target data to the smart NIC. This allows the server to promptly understand the overload status of the smart NIC and respond accordingly. When the smart NIC is nearing or already overloaded, the server can promptly determine whether the server expansion is complete based on the latest expansion data. Once the server expansion is complete, the system can stop sending target data to the smart NIC, releasing the load pressure on the smart NIC, preventing excessive resource consumption by the target data, and avoiding impact on the smart NIC's own business data processing.
[0102] Optionally, the server includes a storage device, the storage device includes a pre-configured target storage module, and the smart network interface card (NIC) is communicatively connected to the storage device; the method further includes:
[0103] Step 208: Save the first priority data and the second priority data in the target storage module.
[0104] In this embodiment, the server's storage method may include Direct-Attached Storage (DAS), Network Attached Storage (NAS), and Storage Area Network (SAN), etc. The storage device can be directly connected to the server bus via a cable, or connected via a standard network topology such as Ethernet. This is merely an example, and this embodiment does not impose any limitations.
[0105] In this embodiment, a dedicated target storage module can be pre-configured in the storage device to store data with data identification, such as first-priority data and second-priority data. This protects critical data (first-priority data and second-priority data) from loss when the server is nearing or already overloaded. The smart network interface card (NIC) can establish a communication connection with the storage device via a bus, allowing it to directly obtain target data from the storage device without going through the server's CPU. This avoids consuming server CPU resources and reduces server load.
[0106] Step 209: When the first load value is not less than the first load threshold, the first priority data is sent to the smart network card through the target storage module; wherein, the smart network card is also used to store the first priority data.
[0107] In this embodiment of the application, if the first load value is not less than the first load threshold, it indicates that the server is overloaded. In order to avoid the loss of the first priority data, the first priority data can be sent directly to the smart network card through the target storage module in the storage device without going through the server's CPU. The smart network card will then save the first priority data, thereby protecting the first priority data through the smart network card.
[0108] Step 210: Send the target data to the smart network card; wherein the smart network card is used to process the target data and send the processing result to the user of the server.
[0109] Optionally, step 210 may include the following steps:
[0110] The second priority data is sent to the smart network card through the target storage module.
[0111] In this embodiment, after the second priority data is stored in the target storage module, if the first target difference is less than the first difference threshold (i.e., the server is nearing or already overloaded), the data can no longer flow to the server's CPU. After determining the second priority data as the target data, it can be directly streamed to the internal processor of the smart network interface card (NIC) for processing. This avoids impacting normal user access speeds and allows for significant time to be allocated for server expansion.
[0112] Figure 5 This is a schematic diagram of the data flow of a server overload protection method provided in an embodiment of this application, as shown below. Figure 5 As shown, the target storage module stores first-priority data and second-priority data. The first-priority data can be sent from the target storage module to the server's CPU. See also... Figure 5In related technologies, data needs to pass through the CPU before flowing to the smart network interface card (NIC), which consumes the server's CPU processing resources. However, the server overload protection method provided in this application can directly send first-priority data to the smart NIC for storage via the target storage module, and then send second-priority data to the smart NIC for processing. The smart NIC then sends the processing result of the second-priority data to the front-end user to provide access services, thus not affecting the user's normal access speed. After the server expansion is completed, the CPU can obtain the second-priority data from the target storage module, process it, and directly send the processing result to the front-end user to provide normal access services.
[0113] Figure 6 This is a flowchart illustrating a server overload protection method provided in an embodiment of this application, as shown below. Figure 6 As shown, a load monitoring device can be used to monitor the server's load in real time, detecting changes in the server's load value. If the load value changes, it determines whether the load value has reached a set threshold. This is done by comparing the first load value with a first load threshold to obtain a first target difference, and then determining whether this first target difference is less than a first difference threshold. If so, the data to be processed is classified according to data classification rules, and data identifiers are added to the classified data. These identifiers, i.e., first-priority data and second-priority data, are stored in the target storage module. The server only needs to process necessary data, such as the first-priority data. When the target storage module detects the identifier data, if it is stored in the second-priority data, it can identify the second-priority data as the target data and send it to the smart network interface card (NIC) for processing. The smart NIC then sends the processing result to the server user.
[0114] See Figure 6 The server can monitor the load of the smart network interface card (NIC). By obtaining the current second load value and the corresponding second load threshold of the NIC, it can determine whether the NIC is overloaded. If the second target difference is less than the second difference threshold, the server obtains the latest expansion data and determines whether the server expansion is complete based on the latest expansion data. If the server expansion is complete, the temporary data processing function of the smart NIC can be disabled, i.e., sending target data to the smart NIC can be stopped. The server can process data itself and maintain normal operation to provide access services to users. The first load threshold can also be updated according to the latest expansion data. Furthermore, if the first target difference is not less than the first difference threshold, and the smart NIC is detected to be in use, the temporary data processing function of the smart NIC can be disabled, and data processing is transferred back to the server host.
[0115] See Figure 6If the second target difference is not less than the second difference threshold, meaning the smart network interface card (NIC) is not overloaded, the NIC can continue processing data and continuously send alarm messages to the server administrator's terminal to prompt the administrator to expand the server as soon as possible. When the NIC's storage resources are nearing or already overloaded, the NIC can also send newly generated data to the target storage module in the storage device for temporary storage to alleviate the load pressure on the NIC.
[0116] In this embodiment, by storing the first priority data and the second priority data in a pre-set target storage module in the server's storage device, when the first load value is not less than the first load threshold, the first priority data is sent to the smart network card through the target storage module. The smart network card can store the first priority data, thereby protecting the first priority data and preventing its loss due to excessive server load. Since the smart network card is communicatively connected to the storage device, sending the second priority data to the smart network card through the target storage module can directly offload the second priority data from the storage device to the smart network card, reducing the server's processor resource consumption and thus reducing the server's load.
[0117] Figure 7 This is a flowchart illustrating another server overload protection method provided in this application embodiment. The server overload protection method is applied to a smart network interface card (NIC), which is connected to a server. The method includes:
[0118] Step 301: Receive target data sent by the server; wherein the target data is determined by the server from the server's current pending data when the first target difference is less than the first difference threshold; the target data is obtained by the server after classifying the pending data according to a preset data classification rule; and the first target difference is determined by the server based on a first load threshold and a first load value.
[0119] In this embodiment, the smart network card can be connected to the server's CPU via a PCIe slot, or it can be connected to an adapter card in the server via a PCIe cable. This is merely an illustrative example, and this embodiment does not impose any limitations. The server can send target data to the smart network card via a bus connected to it.
[0120] Step 302: Process the target data and send the processing result to the user of the server.
[0121] In this embodiment, the smart network interface card (NIC) includes a processor, such as a CPU, which can process the target data to obtain the processing result. Then, the smart NIC can directly send the processing result of the target data to the server's client, thereby sending the processing result to the server's user.
[0122] In this embodiment, by setting a first difference threshold, when the difference between the server's first load value and the first load threshold (i.e., the first target difference) is less than the first difference threshold, the data to be processed is promptly and reasonably classified according to preset data classification rules. The classified target data is then diverted to the smart network card for processing. The smart network card sends the processing result of the target data to the server's user, thereby reducing the server's load pressure and enabling the server to provide normal services to users. Compared with the methods of rate limiting or circuit breaking used in related technologies for server overload protection, the server overload protection method of this embodiment does not impose traffic restrictions, function restrictions, or service shutdowns. Therefore, it does not affect the user's access speed during peak server access periods and can improve the server's overload protection effect.
[0123] Optionally, the server includes a storage device, the storage device includes a pre-configured target storage module, and the smart network interface card (NIC) is communicatively connected to the storage device; the method further includes:
[0124] Step 303: Receive first priority data sent by the server and save the first priority data; wherein, the server classifies the data to be processed according to the data classification rules to obtain classified data, the classified data including the first priority data and the second priority data; the server saves the first priority data and the second priority data in the target storage module, the first priority data being sent by the server through the target storage module when the first load value is not less than the first load threshold.
[0125] Step 301 may include the following steps:
[0126] Receive the second priority data sent by the server through the target storage module.
[0127] In this embodiment, the smart network interface card (NIC) can establish a communication connection with the storage device via a bus, allowing the NIC to directly obtain target data from the storage device without going through the server's CPU. This avoids consuming server CPU resources and reduces server load. Second-priority data flows directly to the NIC's processor in the form of a data stream, where it is processed. This approach avoids impacting normal user access speeds and allows for significant time to be allocated for server expansion.
[0128] In this embodiment, the first priority data can be protected by a smart network card to prevent the loss of the first priority data due to excessive server load. The second priority data can be diverted from the storage device to the smart network card, which can reduce the processor resource consumption of the server itself, and thus reduce the server load.
[0129] Figure 8 This is a schematic diagram of the structure of a server overload protection device provided in an embodiment of this application, as shown below. Figure 8 As shown, the server overload protection device 40 is applied to a server connected to a smart network card. The device 40 includes:
[0130] The first acquisition module 401 is used to acquire the current first load value of the server and determine the first target difference based on the first load value and the first load threshold corresponding to the server.
[0131] The determining module 402 is used to determine the target data in the server's data to be processed when the first target difference is less than a preset first difference threshold; wherein the target data is obtained by classifying the data to be processed according to a preset data classification rule;
[0132] The first sending module 403 is used to send the target data to the smart network card; wherein the smart network card is used to process the target data and send the processing result to the user of the server.
[0133] Optionally, the device 40 further includes:
[0134] The second acquisition module is used to acquire the current second load value of the smart network card and the second load threshold corresponding to the smart network card, and to determine the second target difference based on the second load value and the second load threshold;
[0135] The third acquisition module is used to acquire the latest expansion data of the server when the second target difference is less than a preset second difference threshold.
[0136] An execution module is configured to stop sending the target data to the smart network card when the latest expansion data indicates that the server expansion is complete.
[0137] Optionally, the data classification rule is determined based on the data processing priority of the server; the device 40 further includes:
[0138] A classification module is used to classify the data to be processed according to the data classification rules before the determination module 402 determines the target data in the data to be processed on the server, and obtain classified data; wherein, the classified data includes at least one of first priority data and other data, and the first priority data has a higher processing priority than the other data on the server;
[0139] The determining module 402 is specifically used for:
[0140] If the other data exists in the classified data, the other data will be identified as the target data.
[0141] Optionally, the other data includes second-priority data and third-priority data, wherein the second-priority data has a higher processing priority than the third-priority data in the server; the device 40 further includes:
[0142] The deletion module is used to delete the third priority data.
[0143] The determining module 402 is further configured to: determine the second priority data as the target data when the second priority data exists in the classified data.
[0144] Optionally, the server includes a storage device, the storage device includes a pre-configured target storage module, and the smart network interface card (NIC) is communicatively connected to the storage device; the device 40 further includes:
[0145] A storage module is used to store the first priority data and the second priority data in the target storage module;
[0146] The third sending module is used to send the first priority data to the smart network card through the target storage module when the first load value is not less than the first load threshold; wherein, the smart network card is also used to store the first priority data;
[0147] The first sending module 403 is specifically used for:
[0148] The second priority data is sent to the smart network card through the target storage module.
[0149] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0150] This server overload protection device has the same advantages as the related technologies and the server overload protection methods described in the foregoing embodiments, and will not be repeated here.
[0151] Figure 9 This is a schematic diagram of another server overload protection device provided in an embodiment of this application, as shown below. Figure 9 As shown, the server overload protection device 50 is applied to a smart network interface card (NIC), which is connected to the server. The device 50 includes:
[0152] The first receiving module 501 is used to receive target data sent by the server; wherein the target data is determined by the server from the server's current pending data when the first target difference is less than the first difference threshold; the target data is obtained by the server after classifying the pending data according to a preset data classification rule; and the first target difference is determined by the server based on a first load threshold and a first load value obtained.
[0153] The second sending module 502 is used to process the target data and send the processing result to the user of the server.
[0154] Optionally, the server includes a storage device, the storage device includes a pre-configured target storage module, and the smart network interface card (NIC) is communicatively connected to the storage device; the device 50 further includes:
[0155] The second receiving module is used to receive first priority data sent by the server and save the first priority data; wherein, the server classifies the data to be processed according to the data classification rules to obtain classified data, the classified data including the first priority data and the second priority data; the server saves the first priority data and the second priority data in the target storage module, the first priority data being sent by the server through the target storage module when the first load value is not less than the first load threshold;
[0156] The first receiving module 501 is specifically used for:
[0157] Receive the second priority data sent by the server through the target storage module.
[0158] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0159] This server overload protection device has the same advantages as the related technologies and the server overload protection methods described in the foregoing embodiments, and will not be repeated here.
[0160] This application also provides an electronic device, see [link to document]. Figure 10 The system includes: a processor 601, a memory 602, and a computer program 6021 stored on the memory 602 and running on the processor 601. When the processor executes the computer program, it implements the server overload protection method of the foregoing embodiments.
[0161] This application also provides a storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the server overload protection method of the foregoing embodiments.
[0162] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. The structure required to construct such a system is obvious from the above description. Furthermore, this application is not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application.
[0163] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0164] Similarly, it should be understood that, in order to simplify this application and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of this application, various features of this application are sometimes grouped together into a single embodiment, figure, or description thereof. However, this method of disclosure should not be construed as reflecting an intention that the claimed application requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of this application.
[0165] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0166] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors can be used in practice to implement some or all of the functions of some or all of the components in the sequencing device according to this application. This application can also be implemented as a device or apparatus program for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can take the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0167] It should be noted that the above embodiments are illustrative of this application and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0168] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0169] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
[0170] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0171] It should be noted that the various data-related processes in the embodiments of this application are carried out in compliance with the relevant data protection laws and policies of the country where the location is located, and with the authorization granted by the owner of the corresponding device.
Claims
1. A method for server overload protection, characterized by, Applied to a server connected to a smart network interface card, the method includes: Obtain the current first load value of the server, and determine the first target difference based on the first load value and the first load threshold corresponding to the server; If the first target difference is less than a preset first difference threshold, target data is determined in the server's data to be processed; wherein, the target data is obtained by classifying the data to be processed according to a preset data classification rule; The target data is sent to the smart network interface card (NIC); wherein the smart NIC is used to process the target data and send the processing result to the user of the server; The data classification rule is determined based on the data processing priority of the server; before determining the target data in the data to be processed by the server, the method further includes: The data to be processed is classified according to the data classification rules to obtain classified data; wherein, the classified data includes at least one of first priority data and other data, and the first priority data has a higher processing priority than the other data in the server; Determining the target data in the server's pending data includes: If the other data exists in the classified data, the other data will be identified as the target data.
2. The server overload protection method of claim 1, wherein, The method further includes: Obtain the current second load value of the smart network card and the second load threshold corresponding to the smart network card, and determine the second target difference based on the second load value and the second load threshold; If the second target difference is less than a preset second difference threshold, obtain the latest expansion data of the server; When the latest expansion data indicates that the server expansion is complete, stop sending the target data to the smart network card.
3. The server overload protection method of claim 1, wherein, The other data includes second-priority data and third-priority data, wherein the second-priority data has a higher processing priority than the third-priority data in the server; the method further includes: Delete the third priority data; In the case that the other data exists in the classified data, determining the other data as the target data includes: If the second priority data exists in the classified data, the second priority data is determined as the target data.
4. The server overload protection method according to claim 3, characterized in that, The server includes a storage device, the storage device includes a pre-configured target storage module, and the smart network interface card is communicatively connected to the storage device; the method further includes: The first priority data and the second priority data are stored in the target storage module; When the first load value is not less than the first load threshold, the first priority data is sent to the smart network card through the target storage module; wherein, the smart network card is also used to store the first priority data; Sending the target data to the smart network card includes: The second priority data is sent to the smart network card through the target storage module.
5. A server overload protection method, characterized in that, Applied to a smart network interface card (NIC), wherein the smart NIC is connected to a server, the method includes: The server receives target data sent by the server; wherein the target data is determined by the server from its current pending data when a first target difference is less than a first difference threshold; the target data is obtained by the server after classifying the pending data according to a preset data classification rule; the first target difference is determined by the server based on a first load threshold and a first load value; the data classification rule is determined by the server based on data processing priority; before determining the target data in the pending data, the server classifies the pending data according to the data classification rule to obtain classified data; wherein the classified data includes at least one of first priority data and other data, the first priority data having a higher processing priority than the other data in the server; if the other data exists in the classified data, the server determines the other data as the target data. The target data is processed, and the processing result is sent to the user of the server.
6. A server overload protection device, characterized in that, Applied to a server, the server being connected to a smart network interface card, the device includes: The first acquisition module is used to acquire the current first load value of the server and determine a first target difference based on the first load value and the first load threshold corresponding to the server. The determining module is used to determine the target data in the server's data to be processed when the first target difference is less than a preset first difference threshold; wherein the target data is obtained by classifying the data to be processed according to a preset data classification rule; A first sending module is used to send the target data to the smart network card; wherein the smart network card is used to process the target data and send the processing result to the user of the server; The data classification rules are determined based on the data processing priority of the server; the server overload protection device further includes: A classification module is used to classify the data to be processed according to the data classification rules before the determining module determines the target data in the data to be processed on the server, and obtain classified data; wherein, the classified data includes at least one of first priority data and other data, and the first priority data has a higher processing priority than the other data on the server; The determining module is specifically used for: If the other data exists in the classified data, the other data will be identified as the target data.
7. A server overload protection device, characterized in that, The device is applied to a smart network interface card (NIC), which is connected to a server, and includes: A first receiving module is configured to receive target data sent by the server; wherein the target data is determined by the server from its current pending data when a first target difference is less than a first difference threshold; the target data is obtained by the server after classifying the pending data according to a preset data classification rule; the first target difference is determined by the server based on a first load threshold and a first load value; the data classification rule is determined by the server based on data processing priority; before the server determines the target data in its pending data, the server classifies the pending data according to the data classification rule to obtain classified data; wherein the classified data includes at least one of first priority data and other data, the first priority data having a higher processing priority than the other data in the server; if the other data exists in the classified data, the server determines the other data as the target data. The second sending module is used to process the target data and send the processing result to the user of the server.
8. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and running on the processor, characterized in that the processor, when executing the computer program, implements the server overload protection method as described in any one of claims 1-5.
9. A storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the server overload protection method according to any one of claims 1-5.
Citation Information
Patent Citations
Communication method, device and system in data center
CN114079625A
Virtual machine migration method and device, upgrading method and server
CN115599494A