Recently, I was writing a search interface service. After writing the interface, I conducted a stress test. However, when testing with a high thread for a long time, the following errors will be reported:
First, check the server log and find that there are no errors.
Then check the nginx data. It is found that the number of requests is inconsistent with the number of requests sent by the test. The server receives less and thinks of losing requests.
Later, after searching the information, it was found that it was the problem of the windows machine,
Reason: Windows provides 1024-5000 ports for TCP/IP links, and it takes four minutes to recycle them, which causes us to fill up the ports when running a large number of requests in a short time, resulting in an error report.
Solution (operate on the server where JMeter is located):
1. Enter regedit command in CMD to open the registry;
2. In HKEY_LOCAL_Machine\system\currentcontrolset\services\TCPIP\parameters right-click parameters;
3. Add a new DWORD named maxuserport;
4. Double click maxuserport, enter 65534 numerical data, and select decimal base;
5. After completing the above operations, be sure to restart the machine and solve the problem.
No error will be reported for the test results after solution:
Add: I can test normally after modifying the above problems, but the same problem occurs after increasing the number of threads two days. The following configuration will test normally.
After the above three steps, add tcptimedwaitdelay, the value is 30-300, and select decimal.
You still need to restart your computer