Pressure testing method, device, electronic device and readable medium
By determining the amount of available memory in the AMD processor server and adjusting the security threshold factor, the problem that memory system stability cannot be reflected in the existing technology in high-load scenarios is solved, and efficient stress testing within the security range is realized, and system downtime is avoided.
Patent Information
- Application Number
- CN202310076993.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-03
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-02-03
AI Technical Summary
The existing stress testing methods cannot effectively reflect the stability of the memory system in high load scenarios, and can easily lead to excessive memory load and system downtime.
By determining the amount of memory available for servers based on AMD processors, the amount of memory used for stress testing is calculated based on the preset initial security threshold factor, and the security threshold factor is adjusted based on the operating status of the server during the test, ensuring that as much memory as possible is used for testing within the safe range.
It realizes participating in stress testing as much as possible within the security range, avoids downtime caused by insufficient system memory, and can truly reflect the stability of the server memory system under high load.
Smart Images

Figure CN116302737B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hardware testing, and in particular to a stress testing method, a stress testing device, an electronic device, and a computer-readable medium. Background Art
[0002] Under existing testing conditions, the test program only utilizes a small amount of memory for stress testing, which is insufficient for stress testing in high-memory load scenarios and fails to demonstrate system stability under high-load conditions. Actual testing has found that under current testing conditions, only approximately 12% of memory is utilized for stress testing. Under these conditions, the stability of memory stress cannot be guaranteed. Furthermore, arbitrarily specifying memory for stress testing can easily lead to excessive memory load, causing memory usage to exceed the maximum capacity and system crashes due to insufficient memory. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a pressure testing method, a pressure testing device, an electronic device, and a computer-readable medium that overcome the above problems or at least partially solve the above problems.
[0004] An embodiment of the present invention discloses a stress testing method applied to an AMD processor-based server, the server comprising a first server and a second server, the first server being an AMD processor-based server used to test a target safety threshold factor; the second server being any AMD processor-based server to be tested for stability, comprising:
[0005] determining an amount of available memory in the first server;
[0006] Determining a first test memory amount for stress testing from the available memory amount of the first server based on a preset initial safety threshold factor;
[0007] Performing a first stress test on the first server using the first test memory amount; the first stress test is used to determine a target safety threshold factor required for performing a stress test on the second server;
[0008] According to whether the first server operates normally during the first stress test, adjusting the initial safety threshold factor from a high value to a low value until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor;
[0009] A stress test request is received from the second server, and a second stress test is performed on the second server using a second test memory amount determined based on the target safety threshold factor, where the second stress test is used to test the stability of the second server.
[0010] Optionally, determining the amount of available memory in the first server includes:
[0011] detecting the available memory amount of the first server multiple times to obtain multiple detected memory amounts;
[0012] An average value of the plurality of detected memory amounts is calculated to obtain the available memory amount.
[0013] Optionally, determining a first test memory amount for stress testing from the available memory amount of the first server based on a preset initial safety threshold factor includes:
[0014] Calculating an initial test memory capacity of the first server using the available memory capacity and an initial safety threshold factor corresponding to the available memory capacity;
[0015] The first test memory amount is calculated according to the initial test memory amount and a preset memory call ratio in the stress testing tool.
[0016] Optionally, according to whether the first server operates normally during the first stress test, adjusting the initial safety threshold factor from a high value to a low value until the first server operates normally during the first stress test, to obtain a target safety threshold factor, includes:
[0017] According to whether the first server operates normally during the first stress test and whether the current first memory usage of the first server meets the stress test requirements, the initial safety threshold factor is adjusted from a high value to a low value until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor.
[0018] Optionally, according to whether the first server operates normally during the first stress test and whether the current first memory usage of the first server meets the stress test requirement, adjusting the initial safety threshold factor from a high value to a low value until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor, including:
[0019] During the first stress test, a log is generated and stored in the first server; the log is used to record memory errors or downtime information during the first stress test;
[0020] Determining whether the first server is operating normally based on whether a memory error message or a crash message appears in the log of the first server;
[0021] When a memory error message or a crash message appears in the log of the first server, adjusting the initial safety threshold factor from a high value to a low value until no memory error message or a crash message appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed;
[0022] Verifying whether the first memory usage rate of the first stress test meets the stress test requirements;
[0023] If the first memory usage rate of the first stress test meets the stress test requirement, the to-be-confirmed safety threshold factor is used as the target safety threshold factor.
[0024] Optionally, verifying whether the first memory usage of the first stress test meets stress test requirements includes:
[0025] checking the first memory usage;
[0026] When a memory error message or a downtime message appears in the log of the first server, a second memory usage rate corresponding to the safety threshold factor to be tested is calculated; the second memory usage rate is a ratio of the amount of test memory to be confirmed corresponding to the safety threshold factor to be confirmed to the amount of available memory;
[0027] Determining whether the first memory usage rate is the same as the second memory usage rate;
[0028] If they are the same, determining that the first stress test is successful; using the to-be-confirmed safety threshold factor as the target safety threshold factor;
[0029] If they are not the same, then troubleshoot the reason why the first stress test failed;
[0030] When the reason for the failure of the first stress test is that the amount of test memory to be confirmed is higher than the amount of available memory, the initial safety threshold factor is adjusted from a high value to a low value, and the first stress test is performed again to determine the target safety threshold factor.
[0031] Optionally, when a memory error message or a crash message appears in the log of the first server, the initial safety threshold factor is adjusted from a high value to a low value until no memory error message or a crash message appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed, including:
[0032] When memory error information or crash information appears in the log of the first server, the initial safety threshold factor is reduced by a preset multiple until no memory error information or crash information appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed.
[0033] Optionally, receiving a stress test request from the second server, and performing a second stress test on the second server using a second test memory amount determined based on the target safety threshold factor, includes:
[0034] A stress test request is received from the second server, and the second stress test is performed on the second server using the second test memory according to a preset number of stress tests.
[0035] An embodiment of the present invention discloses a stress testing device, which is applied to a server based on an AMD processor. The server includes a first server and a second server. The first server is an AMD processor-based server used to test a target safety threshold factor; the second server is any AMD processor-based server whose stability is to be tested, including:
[0036] An available memory amount determining module, configured to determine the amount of available memory in the first server;
[0037] a first test memory amount determining module, configured to determine a first test memory amount for stress testing in the available memory amount of the first server based on a preset initial safety threshold factor;
[0038] a first stress testing module, configured to perform a first stress test on the first server using the first test memory amount; the first stress test is configured to determine a target safety threshold factor required for performing a stress test on the second server;
[0039] an adjustment module, configured to adjust the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test, until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor;
[0040] A second stress test module is used to receive a stress test request from the second server, and perform a second stress test on the second server using a second test memory amount determined based on the target safety threshold factor, wherein the second stress test is used to test the stability of the second server.
[0041] Optionally, the available memory amount determination module includes:
[0042] an available memory amount detection submodule, configured to detect the available memory amount of the first server multiple times to obtain multiple detected memory amounts;
[0043] The available memory amount calculation submodule calculates an average value of the multiple detected memory amounts to obtain the available memory amount.
[0044] Optionally, the first test memory amount determination module includes:
[0045] an initial test memory amount calculation submodule, configured to calculate an initial test memory amount of the first server using the available memory amount and an initial safety threshold factor corresponding to the available memory amount;
[0046] The first test memory amount determination submodule is configured to calculate the first test memory amount according to the initial test memory amount and a preset memory call ratio in the stress testing tool.
[0047] Optionally, the adjustment module includes:
[0048] The adjustment submodule is used to adjust the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test and whether the current first memory usage of the first server meets the stress test requirements, until the first server operates normally during the first stress test, thereby obtaining the target safety threshold factor.
[0049] Optionally, the adjustment submodule includes:
[0050] a log generating unit, configured to generate a log and store the log in the first server during the first stress test; the log is configured to record memory errors or downtime information during the first stress test;
[0051] A server status determining unit, configured to determine whether the first server is operating normally based on whether a memory error message or a downtime message appears in the log of the first server;
[0052] an adjusting unit, configured to adjust the initial safety threshold factor from a high value to a low value when a memory error message or a crash message appears in the log of the first server, until no memory error message or a crash message appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed;
[0053] A verification unit, configured to verify whether the first memory usage rate of the first stress test meets stress test requirements;
[0054] The target safety threshold factor determining unit is configured to use the to-be-confirmed safety threshold factor as a target safety threshold factor if the first memory usage rate of the first stress test meets the stress test requirement.
[0055] Optionally, the verification unit includes:
[0056] A checking unit, configured to check the first memory usage;
[0057] A second memory usage determination unit is configured to calculate a second memory usage corresponding to the safety threshold factor to be tested when a memory error message or a downtime message appears in the log of the first server; the second memory usage is a ratio of the amount of test memory to be confirmed corresponding to the safety threshold factor to be confirmed to the amount of available memory;
[0058] a determining unit, configured to determine whether the first memory usage rate is the same as the second memory usage rate;
[0059] a test success determination unit, configured to determine that the first stress test is successful if the two are the same; and use the safety threshold factor to be confirmed as the target safety threshold factor;
[0060] a test failure cause determination unit, configured to, if they are not the same, troubleshoot the cause of the failure of the first stress test; when the cause of the failure of the first stress test is that the amount of test memory to be confirmed is higher than the amount of available memory, adjust the initial safety threshold factor from a high value to a low value, and re-perform the first stress test to determine the target safety threshold factor.
[0061] Optionally, the adjustment unit includes:
[0062] The reduction unit is used to reduce the initial security threshold factor according to a preset multiple when a memory error message or a crash message appears in the log of the first server, until no memory error message or a crash message appears in the log of the first server, thereby obtaining a security threshold factor to be confirmed.
[0063] Optionally, the second pressure testing module includes:
[0064] The second stress test submodule is configured to receive a stress test request from the second server, and perform the second stress test on the second server using the second test memory according to a preset number of stress tests.
[0065] An embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0066] The memory is used to store computer programs;
[0067] The processor is configured to implement the stress testing method described in the embodiment of the present invention when executing the program stored in the memory.
[0068] The embodiment of the present invention further discloses one or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to perform the stress testing method as described in the embodiment of the present invention.
[0069] The embodiments of the present invention include the following advantages:
[0070] In an embodiment of the present invention, in a server based on an AMD processor, the amount of available memory of a first server is determined, and then based on a preset initial safety threshold factor, a first test memory amount for stress testing is determined from the available memory of the first server. The first test memory amount is used to perform a first stress test on the first server. Based on whether the first server operates normally during the test, the initial safety threshold factor is adjusted from a high value to a low value until the first server operates normally during the first stress test, and a target safety threshold factor is obtained. The second test memory amount determined based on the target safety threshold factor is used to perform a second stress test on the second server. The present invention accurately calculates the test usage for stress testing based on the current available memory amount of the first server, ensuring that as much memory as possible is used to participate in the stress test within a safe range. At the same time, it also avoids the stress test occupying too much system memory to 100%, resulting in a system crash due to insufficient memory. In addition, the amount of memory used for the stress test is supported by data and can truly reflect the stability status of the server memory system. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 This is a flowchart of the steps of a pressure testing method provided in an embodiment of the present invention;
[0072] Figure 2 is a flowchart of another pressure testing method provided in an embodiment of the present invention;
[0073] Figure 3 is a structural block diagram of a pressure testing device provided in an embodiment of the present invention;
[0074] Figure 4 is a block diagram of an electronic device provided in an embodiment of the present invention;
[0075] Figure 5 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0076] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0077] The stress testing method of the present invention uses as much memory as possible to participate in the stress test within a safe range, which can measure the stability of the server under high memory load conditions. Specifically, the amount of available memory of the first server is calculated, and the initial safety threshold factor used for the first stress test is determined based on the corresponding relationship between the amount of available memory and the initial safety threshold factor. The initial safety threshold factor is further adjusted based on whether the first server operates normally after the corresponding stress test, thereby determining a test memory amount that is as much as possible and within a safe range. The stress testing tool then calls as much available memory as possible to participate in the stress test, thereby achieving stress testing of the server using more memory, reflecting the stability of the server under high memory load conditions.
[0078] Reference Figure 1 , shows a flowchart of the steps of a pressure testing method provided in an embodiment of the present invention, which may specifically include the following steps:
[0079] Step 101, determining the amount of available memory in the first server;
[0080] AMD (Advanced Micro Devices) processors are processors produced by AMD. Currently, AMD processors are widely used, and server systems based on AMD processors are also increasing. In the prior art, methods for stress testing servers are mostly for servers based on Intel processors. Traditionally, when performing stress testing on servers based on Intel processors, a certain amount of memory is directly specified for stress testing. However, the stress testing method for servers based on Intel processors is not applicable to servers based on AMD processors. If a higher amount of memory is directly specified for stress testing in a server based on AMD processors, it will cause system memory overflow, causing the server to crash. Therefore, this application proposes a method for stress testing servers based on AMD processors.
[0081] Based on the AMD processor environment, during the stress testing process of the server, the default stress testing tool usually occupies very little memory for stress testing. The existing solution cannot reflect the stability of the memory system under high load conditions. Therefore, this application proposes a stress testing method based on the current available memory of the memory system to accurately calculate as much test memory as possible within a safe range for stress testing.
[0082] In an embodiment of the present invention, a target safety threshold factor for stress testing can be determined for a server and then applied to all AMD processor-based servers. Because the memory system's memory is provided to at least one server component, the current available memory capacity of a server's memory system can be determined before using as much memory as possible for stress testing. This allows the amount of memory to be used for stress testing to be determined based on the current available memory capacity of the server's memory system. This avoids arbitrarily specifying a memory capacity for stress testing, which could result in memory usage exceeding the maximum capacity and system downtime due to insufficient memory.
[0083] Specifically, in this embodiment of the present invention, the server used to determine the target safety threshold factor can be referred to as the first server, and any AMD processor-based server to be tested for stability can be referred to as the second server. The first server can run the command free-m|grep "Mem"|awk-F""'{print$4}' to obtain the amount of available memory in the memory system of the server to be tested.
[0084] Step 102: determining a first test memory amount for stress testing from the available memory amount of the first server based on a preset initial safety threshold factor;
[0085] In an embodiment of the present invention, a sufficient amount of memory can be reserved to maintain the normal operation of the server component. On the basis of maintaining the normal operation of the server component, the amount of free memory in the available memory other than the memory required for the normal operation of other programs is determined as the first test memory amount. The first test memory amount is used for stress testing the memory system, thereby achieving the use of as much memory as possible to participate in the stress test, while also avoiding the stress test occupying too much system memory to reach 100%, resulting in insufficient system memory and system downtime.
[0086] Specifically, an initial safety threshold factor can be preset and used to determine the first test memory amount for the stress test from the available memory amount of the first server. The initial safety threshold factor can be the ratio of the available memory amount used for the stress test and can range from 1 to 99. To avoid other exceptions caused by other system programs being unable to use the remaining memory during the stress test, the initial safety threshold factor can generally be set to 95 to 97.5.
[0087] Step 103: Perform a first stress test on the first server using the first test memory amount; the first stress test is used to determine a target safety threshold factor required for performing a stress test on the second server.
[0088] The AMD processor-based stress testing tool is a tool used to measure server memory system indicator data. Through this application, the performance indicator parameters of the memory can be measured. At the same time, the tool can also measure the stability of the server memory system under different load conditions.
[0089] After the first server determines the first test memory amount for the stress test, the first server may use a stress test tool to perform a stress test on the first server. Specifically, the first server may run the stress test tool and write the first test memory amount into preset memory parameters of the stress test tool, so that the stress test tool can call the first test memory amount to perform a stress test on the first server, thereby determining a target safety threshold factor for stress testing any server based on the test results.
[0090] Step 104: Adjust the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test, until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor.
[0091] After the stress test is performed on the first server, if a server memory error occurs or the server crashes, it may indicate that the amount of memory in the first test is too large, and the initial safety threshold factor needs to be adjusted.
[0092] Specifically, the initial safety threshold factor may be adjusted from a high value to a low value according to whether the first server operates normally, until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor.
[0093] Step 105: Receive a stress test request from the second server, and perform a second stress test on the second server using a second test memory amount determined based on the target safety threshold factor, where the second stress test is used to test the stability of the second server.
[0094] After determining the target safety threshold factor, if a stress test request is received from the second server, the second test memory amount can be determined based on the target safety threshold factor. The second server can run the stress test tool and write the second test memory amount into the preset memory parameters of the stress test tool, so that the stress test tool can call the second test memory amount to perform stress testing on the second server, thereby achieving stress testing of the server using a suitable memory safety threshold, reflecting the stability of the server memory system under high load conditions.
[0095] According to the stress testing method of the embodiment of the present invention, in a server based on an AMD processor, the amount of available memory of a first server is determined, and then, based on a preset initial safety threshold factor, a first test memory amount for stress testing is determined from the available memory of the first server. The first test memory amount is used to perform a first stress test on the first server. The initial safety threshold factor is adjusted from a high value to a low value according to whether the first server operates normally during the test, until the first server operates normally during the first stress test, and a target safety threshold factor is obtained. The second test memory amount determined based on the target safety threshold factor is used to perform a second stress test on the second server. The present invention accurately calculates the test usage for stress testing based on the current available memory amount of the first server, ensuring that as much memory as possible is used for stress testing within a safe range. This also prevents the stress test from occupying too much system memory, reaching 100%, which would cause the system to crash due to insufficient memory. In addition, the amount of memory used for stress testing is supported by data and can truly reflect the stability of the server memory system.
[0096] Reference Figure 2 , shows a flowchart of another pressure testing method provided in an embodiment of the present invention, which may specifically include the following steps:
[0097] Step 201: Detect the available memory amount of the first server multiple times to obtain multiple detected memory amounts;
[0098] In order to avoid a large error caused by a single measurement, the available memory amount of the first server memory system can be detected multiple times, and then the average of the multiple measured available memory amounts can be taken, thereby reducing the error and further improving the measurement accuracy.
[0099] Specifically, in the embodiment of the present invention, the first server may run the free-m|grep "Mem"|awk-F""'{print$4}' command multiple times to obtain the amount of available memory in the memory system of the first server, and obtain multiple detected memory amounts.
[0100] Step 202, calculating the average of the plurality of detected memory amounts to obtain the available memory amount;
[0101] After obtaining multiple test memory amounts, the first server can take the average of the multiple test memory amounts to obtain the available memory amount, and then calculate the test memory amount used for stress testing based on the available memory amount. The test memory amount for stress testing determined based on the average of the available memory amounts of multiple tests has higher accuracy.
[0102] Step 203: determining a first test memory amount for stress testing from the available memory amount of the first server based on a preset initial safety threshold factor;
[0103] In one embodiment of the present invention, determining a first test memory amount for stress testing in the available memory amount of the first server based on a preset initial safety threshold factor includes:
[0104] S11, calculating an initial test memory capacity of the first server using the available memory capacity and an initial safety threshold factor corresponding to the available memory capacity;
[0105] After determining the available memory amount, the first server may use the current available memory amount of the memory system and the initial safety threshold factor corresponding to the available memory amount to calculate the initial test memory amount for stress testing under the load of the initial safety threshold factor.
[0106] Specifically, assuming that the available memory amount is M0, the initial test memory amount for stress testing is M1, and the preset initial safety threshold factor is K, the formula for calculating the initial test memory amount M1 for stress testing is:
[0107] Initial test memory used for stress testing (M1) = available memory (M0) × K / 100
[0108] S12: Calculate the first test memory capacity according to the initial test memory capacity and a preset memory call ratio in the stress test tool.
[0109] The stress test tool's memory call mechanism during stress testing is to adjust the initial test memory amount used for stress testing based on the stress test tool's preset memory call ratio, and then call the adjusted test memory amount to perform the stress test. This application does not impose any restrictions on the value of the stress test tool's preset memory call ratio.
[0110] Therefore, after calculating the initial test memory amount, the first server can multiply the initial test memory amount used for stress testing by the preset memory call ratio of the stress testing tool based on the preset memory call ratio of the stress testing tool to obtain the first test memory amount.
[0111] As a specific example, the preset memory call ratio of the stress test tool may be 1 / 3, and the calculation formula for the first test memory amount is:
[0112] First test memory size (M2) = initial test memory size for stress testing (M1) × 1 / 3
[0113] Step 204: Perform a first stress test on the first server using the first test memory amount; the first stress test is used to determine a target safety threshold factor required for performing a stress test on the second server.
[0114] Step 205: Adjust the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test, until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor.
[0115] In one embodiment of the present invention, adjusting the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor, includes:
[0116] S21, according to whether the first server operates normally during the first stress test and whether the current first memory usage of the first server meets the stress test requirements, adjust the initial safety threshold factor from a high value to a low value until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor.
[0117] After stress testing the first server, the memory usage of this test can be verified to determine whether the memory usage of this stress test reaches the expected memory usage. If it exceeds the expected memory usage, it can be said that the amount of memory in the first test is too large. At this time, the initial safety threshold factor needs to be adjusted.
[0118] Specifically, the initial safety threshold factor can be adjusted from a high value to a low value according to whether the first server operates normally and whether the current first memory usage of the first server meets the stress test requirements, until the first server operates normally during the first stress test, thereby obtaining the target safety threshold factor.
[0119] In one embodiment of the present invention, according to whether the first server operates normally during the first stress test and whether the current first memory usage of the first server meets the stress test requirements, adjusting the initial safety threshold factor from a high value to a low value until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor, includes:
[0120] S31, during the first stress test, generating a log and storing it in the first server; the log is used to record memory errors or downtime information during the first stress test;
[0121] During the first stress test, a log may be generated for the execution result and stored in the first server. The log may record memory errors or downtime information during the first stress test.
[0122] S32, determining whether the first server is operating normally based on whether a memory error message or a downtime message appears in the log of the first server;
[0123] After the log is generated, whether the first server is operating normally can be determined based on whether the log of the first server contains memory error information or crash information. If the log of the first server does not contain memory error information or crash information, it can be determined that the first server is operating normally; if the log of the first server does not contain memory error information or crash information, it can be determined that the first server is operating normally.
[0124] S33, when a memory error message or a crash message appears in the log of the first server, adjusting the initial safety threshold factor from a high value to a low value until no memory error message or a crash message appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed;
[0125] When it is determined that the log of the first server contains memory error information or crash information, the initial safety threshold factor can be adjusted from a high value to a low value until the log of the first server contains no memory error information or crash information, thereby obtaining the safety threshold factor to be confirmed.
[0126] S34, verifying whether the first memory usage rate of the first stress test meets the stress test requirements;
[0127] After obtaining the safety threshold factor to be confirmed, it is possible to further verify whether the first memory usage of the first stress test meets the stress test requirements, so as to determine a suitable target safety threshold factor.
[0128] S35: If the first memory usage rate of the first stress test meets the stress test requirement, the to-be-confirmed safety threshold factor is used as the target safety threshold factor.
[0129] After determining that the first memory usage rate of the first stress test meets the stress test requirement, the to-be-confirmed safety threshold factor may be used as the target safety threshold factor.
[0130] In one embodiment of the present invention, verifying whether the first memory usage of the first stress test meets the stress test requirement includes:
[0131] S41, checking the first memory usage;
[0132] To verify whether the first memory usage of the first stress test meets the stress test requirements, it can be verified by comparing the first memory usage of the first stress test with the second memory usage corresponding to the safety threshold factor to be tested, so the first memory usage of the first stress test can be checked first.
[0133] S42, when a memory error message or a downtime message appears in the log of the first server, calculating a second memory usage rate corresponding to the safety threshold factor to be tested and confirmed; the second memory usage rate is a ratio of the amount of test memory to be confirmed corresponding to the safety threshold factor to be confirmed to the amount of available memory;
[0134] The second memory usage rate is the proportion of the test memory to be confirmed corresponding to the safety threshold factor to be confirmed in the available memory. When it is determined that memory error information or downtime information appears in the log of the first server, the second memory usage rate corresponding to the safety threshold factor to be tested can be calculated to compare the second memory usage rate with the first memory usage rate.
[0135] S43, determining whether the first memory usage rate is the same as the second memory usage rate;
[0136] After obtaining the first memory usage and the second memory usage, the first memory usage and the second memory usage can be compared to determine whether the first memory usage is the same as the second memory usage to determine whether the security threshold factor to be confirmed needs to be adjusted.
[0137] S44: If they are the same, determining that the first stress test is successful; and using the to-be-confirmed safety threshold factor as the target safety threshold factor;
[0138] When the first memory usage rate is the same as the second memory usage rate, it can be determined that the first stress test is successful, and the safety threshold factor to be confirmed is used as the target safety threshold factor.
[0139] S45, if they are not the same, troubleshooting the cause of the failure of the first stress test;
[0140] When the first memory usage rate is different from the second memory usage rate, it can be determined that the first stress test has failed. The reason for the failure of the first stress test can be investigated and the fault that caused the failure can be corrected. After the fault is corrected, the stress test can be performed again to test the stability of the memory system.
[0141] As a specific example of the present invention, the fault that causes the failure may be incomplete installation of the operating system software and failure to install the memory stress test tool. For this fault, the correction method may be to install the missing dependency package according to the prompts, so that in the next test, the stress test will not fail due to this fault.
[0142] As a specific example of the present invention, the fault that causes failure may be that the test memory usage exceeds the total physical memory, resulting in test abnormality. For this fault, the correction method may be to adjust the initial safety threshold factor to be within a more reasonable range, so that in the next test, the stress test will not fail due to this fault.
[0143] S46, when the reason for the failure of the first stress test is that the amount of test memory to be confirmed is higher than the amount of available memory, the initial safety threshold factor is adjusted from a high value to a low value, and the first stress test is re-performed to determine the target safety threshold factor.
[0144] If the reason for the failure of the first stress test is that the amount of memory to be confirmed is higher than the amount of available memory, it can be determined that the amount of memory to be confirmed is too high and can be adjusted. Specifically, when the reason for the failure of the first stress test is that the amount of memory to be confirmed is higher than the amount of available memory, the initial safety threshold factor is adjusted from a high value to a low value, and the first stress test is repeated to determine the target safety threshold factor.
[0145] In one embodiment of the present invention, when a memory error message or a crash message appears in the log of the first server, the initial safety threshold factor is adjusted from a high value to a low value until no memory error message or crash message appears in the log of the first server, and the safety threshold factor to be confirmed is obtained, including:
[0146] S51, when memory error information or downtime information appears in the log of the first server, reduce the initial security threshold factor according to a preset multiple until no memory error information or downtime information appears in the log of the first server, and obtain the security threshold factor to be confirmed.
[0147] If a memory error message or a crash message appears in the log of the first server, it may indicate that the memory system cannot support the normal operation of the server under the current load. In this case, the load can be reduced and the stability of the memory system can be retested.
[0148] In an embodiment of the present invention, the initial safety threshold factor may be lowered so that a stress test is performed using a memory amount corresponding to a smaller safety threshold factor, that is, the stability of the memory system is tested under a load lower than the current load.
[0149] Specifically, the initial safety threshold factor can be reduced by a preset multiple until no memory error information or downtime information appears in the log of the first server, thereby obtaining the safety threshold factor to be confirmed. The preset multiple can be set according to actual conditions and is not limited in this application. For example, it can be 1 / 100, 1 / 50, 1 / 10, 1 / 5, or 1 / 2.
[0150] Step 206: Receive a stress test request from the second server, and perform a second stress test on the second server using a second test memory amount determined based on the target safety threshold factor, where the second stress test is used to test the stability of the second server.
[0151] In one embodiment of the present invention, receiving a stress test request from the second server, and performing a second stress test on the second server using a second test memory amount determined based on the target safety threshold factor, includes:
[0152] A stress test request is received from the second server, and the second stress test is performed on the second server using the second test memory according to a preset number of stress tests.
[0153] A single stress test is relatively short. If you need to test the stability of a server under a high load for a longer period of time, you can perform multiple stress tests on the server. Specifically, after determining the amount of second test memory for the stress test, you can set the number of stress tests. This allows the server to perform at least one stress test on the second server's memory system based on the preset number of stress tests and the amount of second test memory.
[0154] Specifically, a test parameter may be preset in the stress test tool, and the number of times may be directly input in the test parameter preset in the stress test tool; or a self-programmed loop code may be used to set the number of times to run.
[0155] The specific value of the number of pressure tests can be set according to actual needs, and the present invention does not limit this. For example, the number of pressure tests can be 1, 3, 5, 10, 50, or 100.
[0156] According to the stress testing method of the embodiment of the present invention, in a server based on an AMD processor, the amount of available memory of a first server is determined, and then, based on a preset initial safety threshold factor, a first test memory amount for stress testing is determined from the available memory of the first server. The first test memory amount is used to perform a first stress test on the first server. The initial safety threshold factor is adjusted from a high value to a low value according to whether the first server operates normally during the test, until the first server operates normally during the first stress test, and a target safety threshold factor is obtained. The second test memory amount determined based on the target safety threshold factor is used to perform a second stress test on the second server. The present invention accurately calculates the test usage for stress testing based on the current available memory amount of the first server, ensuring that as much memory as possible is used for stress testing within a safe range. This also prevents the stress test from occupying too much system memory, reaching 100%, which would cause the system to crash due to insufficient memory. In addition, the amount of memory used for stress testing is supported by data and can truly reflect the stability of the server memory system.
[0157] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0158] Reference Figure 3 , shows a structural block diagram of a pressure testing device provided in an embodiment of the present invention, which may specifically include the following modules:
[0159] An available memory amount determining module 301 is configured to determine the amount of available memory in the first server;
[0160] a first test memory amount determining module 302, configured to determine a first test memory amount for stress testing from the available memory amount of the first server based on a preset initial safety threshold factor;
[0161] A first stress test module 303 is configured to perform a first stress test on the first server using the first test memory amount; the first stress test is configured to determine a target safety threshold factor required for performing a stress test on the second server;
[0162] an adjusting module 304 configured to adjust the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test, until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor;
[0163] The second stress test module 305 is used to receive a stress test request from the second server, and perform a second stress test on the second server using a second test memory amount determined based on the target safety threshold factor. The second stress test is used to test the stability of the second server.
[0164] Optionally, the available memory amount determination module includes:
[0165] an available memory amount detection submodule, configured to detect the available memory amount of the first server multiple times to obtain multiple detected memory amounts;
[0166] The available memory amount calculation submodule calculates an average value of the multiple detected memory amounts to obtain the available memory amount.
[0167] Optionally, the first test memory amount determination module includes:
[0168] an initial test memory amount calculation submodule, configured to calculate an initial test memory amount of the first server using the available memory amount and an initial safety threshold factor corresponding to the available memory amount;
[0169] The first test memory amount determination submodule is configured to calculate the first test memory amount according to the initial test memory amount and a preset memory call ratio in the stress testing tool.
[0170] Optionally, the adjustment module includes:
[0171] The adjustment submodule is used to adjust the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test and whether the current first memory usage of the first server meets the stress test requirements, until the first server operates normally during the first stress test, thereby obtaining the target safety threshold factor.
[0172] Optionally, the adjustment submodule includes:
[0173] a log generating unit, configured to generate a log and store the log in the first server during the first stress test; the log is configured to record memory errors or downtime information during the first stress test;
[0174] A server status determining unit, configured to determine whether the first server is operating normally based on whether a memory error message or a downtime message appears in the log of the first server;
[0175] an adjusting unit, configured to adjust the initial safety threshold factor from a high value to a low value when a memory error message or a crash message appears in the log of the first server, until no memory error message or a crash message appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed;
[0176] A verification unit, configured to verify whether the first memory usage rate of the first stress test meets stress test requirements;
[0177] The target safety threshold factor determining unit is configured to use the to-be-confirmed safety threshold factor as a target safety threshold factor if the first memory usage rate of the first stress test meets the stress test requirement.
[0178] Optionally, the verification unit includes:
[0179] A checking unit, configured to check the first memory usage;
[0180] A second memory usage determination unit is configured to calculate a second memory usage corresponding to the safety threshold factor to be tested when a memory error message or a downtime message appears in the log of the first server; the second memory usage is a ratio of the amount of test memory to be confirmed corresponding to the safety threshold factor to be confirmed to the amount of available memory;
[0181] a determining unit, configured to determine whether the first memory usage rate is the same as the second memory usage rate;
[0182] a test success determination unit, configured to determine that the first stress test is successful if the two are the same; and use the safety threshold factor to be confirmed as the target safety threshold factor;
[0183] a test failure cause determination unit, configured to, if they are not the same, troubleshoot the cause of the failure of the first stress test; when the cause of the failure of the first stress test is that the amount of test memory to be confirmed is higher than the amount of available memory, adjust the initial safety threshold factor from a high value to a low value, and re-perform the first stress test to determine the target safety threshold factor.
[0184] Optionally, the adjustment unit includes:
[0185] The reduction unit is used to reduce the initial security threshold factor according to a preset multiple when a memory error message or a crash message appears in the log of the first server, until no memory error message or a crash message appears in the log of the first server, thereby obtaining a security threshold factor to be confirmed.
[0186] Optionally, the second pressure testing module includes:
[0187] The second stress test submodule is configured to receive a stress test request from the second server, and perform the second stress test on the second server using the second test memory according to a preset number of stress tests.
[0188] As 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.
[0189] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0190] Memory 403, used for storing computer programs;
[0191] The processor 401 is configured to implement the stress testing method described in the above embodiment when executing the program stored in the memory 403 .
[0192] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0193] The communication interface is used for communication between the above terminal and other devices.
[0194] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0195] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0196] like Figure 5 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 501 is further provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the stress testing method described in the above embodiment.
[0197] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the stress testing method described in the above embodiment.
[0198] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0199] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0200] Each embodiment in this specification is described in a related manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For related parts, refer to the description of the method embodiment.
[0201] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.
Claims
1. A stress testing method, characterized in that: Applied to an AMD processor-based server, the server comprising a first server and a second server, the first server being an AMD processor-based server for testing a target security threshold factor; The second server is any AMD processor-based server to be tested for stability, including: determining an amount of available memory in the first server; Determining a first test memory amount for stress testing from the available memory amount of the first server based on a preset initial safety threshold factor; Performing a first stress test on the first server using the first test memory amount; the first stress test is used to determine a target safety threshold factor required for performing a stress test on the second server; According to whether the first server operates normally during the first stress test, adjusting the initial safety threshold factor from a high value to a low value until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor; A stress test request is received from the second server, and a second stress test is performed on the second server using a second test memory amount determined based on the target safety threshold factor, where the second stress test is used to test the stability of the second server.
2. The method according to claim 1, characterized in that Determining an amount of available memory in the first server includes: detecting the available memory amount of the first server multiple times to obtain multiple detected memory amounts; An average value of the plurality of detected memory amounts is calculated to obtain the available memory amount.
3. The method according to claim 1, characterized in that Determining a first test memory amount for stress testing from the available memory amount of the first server based on a preset initial safety threshold factor includes: Calculating an initial test memory capacity of the first server using the available memory capacity and an initial safety threshold factor corresponding to the available memory capacity; The first test memory amount is calculated according to the initial test memory amount and a preset memory call ratio in the stress testing tool.
4. The method according to claim 1, wherein Adjusting the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor, including: According to whether the first server operates normally during the first stress test and whether the current first memory usage of the first server meets the stress test requirements, the initial safety threshold factor is adjusted from a high value to a low value until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor.
5. The method according to claim 4, characterized in that Adjusting the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test and whether a current first memory usage rate of the first server meets stress test requirements until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor, including: During the first stress test, a log is generated and stored in the first server; the log is used to record memory errors or downtime information during the first stress test; Determining whether the first server is operating normally based on whether a memory error message or a crash message appears in the log of the first server; When a memory error message or a crash message appears in the log of the first server, adjusting the initial safety threshold factor from a high value to a low value until no memory error message or a crash message appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed; Verifying whether the first memory usage rate of the first stress test meets the stress test requirements; If the first memory usage rate of the first stress test meets the stress test requirement, the to-be-confirmed safety threshold factor is used as the target safety threshold factor.
6. The method according to claim 5, characterized in that Verifying whether the first memory usage of the first stress test meets the stress test requirement includes: checking the first memory usage; When a memory error message or a downtime message appears in the log of the first server, a second memory usage rate corresponding to the unconfirmed safety threshold factor is calculated; the second memory usage rate is a ratio of the unconfirmed test memory amount corresponding to the unconfirmed safety threshold factor to the available memory amount; Determining whether the first memory usage rate is the same as the second memory usage rate; If they are the same, determining that the first stress test is successful; using the to-be-confirmed safety threshold factor as the target safety threshold factor; If they are not the same, then troubleshoot the reason why the first stress test failed; When the reason for the failure of the first stress test is that the amount of test memory to be confirmed is higher than the amount of available memory, the initial safety threshold factor is adjusted from a high value to a low value, and the first stress test is performed again to determine the target safety threshold factor.
7. The method according to claim 5, characterized in that When a memory error message or a crash message appears in the log of the first server, the initial safety threshold factor is adjusted from a high value to a low value until no memory error message or a crash message appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed, including: When memory error information or crash information appears in the log of the first server, the initial safety threshold factor is reduced by a preset multiple until no memory error information or crash information appears in the log of the first server, thereby obtaining a safety threshold factor to be confirmed.
8. The method according to claim 1, characterized in that Receiving a stress test request from the second server, and performing a second stress test on the second server using a second test memory amount determined based on the target safety threshold factor, comprising: A stress test request is received from the second server, and the second stress test is performed on the second server using the second test memory according to a preset number of stress tests.
9. A pressure testing device, characterized in that: Applied to an AMD processor-based server, the server comprising a first server and a second server, the first server being an AMD processor-based server for testing a target security threshold factor; The second server is any AMD processor-based server to be tested for stability, including: an available memory amount determining module, configured to determine the amount of available memory in the first server; a first test memory amount determining module, configured to determine a first test memory amount for stress testing in the available memory amount of the first server based on a preset initial safety threshold factor; a first stress testing module, configured to perform a first stress test on the first server using the first test memory amount; the first stress test is configured to determine a target safety threshold factor required for performing a stress test on the second server; an adjustment module, configured to adjust the initial safety threshold factor from a high value to a low value according to whether the first server operates normally during the first stress test, until the first server operates normally during the first stress test, thereby obtaining a target safety threshold factor; A second stress test module is used to receive a stress test request from the second server, and perform a second stress test on the second server using a second test memory amount determined based on the target safety threshold factor, wherein the second stress test is used to test the stability of the second server.
10. An electronic device, characterized in that: comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to implement the stress testing method according to any one of claims 1 to 8 when executing the program stored in the memory.
11. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method of any one of claims 1-8.
Citation Information
Patent Citations
Pressure testing method and system, electronic equipment and readable storage medium
CN108874637A
Pressure testing method and device, computer equipment and computer readable storage medium
CN109815067A