When you recently launched a large number of request requests using NODEJS, you receive the following error message:
| The code is as follows |
Copy Code |
1.{[Error:connect eaddrinuse] Code: ' Eaddrinuse ', errno: ' Eaddrinuse ', Syscall: ' Connect '} 3 operating system: Win Server 2003 x64 |
According to traditional thinking, eaddrinuse error should mean the address is occupied. But when requesting a request, where does the address occupy a say?
At first always thought is Nodejs itself bug, later found Nodejs official GitHub on the discussion, just know this is the operating system level problem.
Search on the Internet, find a few articles about TCP handshake, personal ability is limited, and there is no time to go into.
Try the solution directly, the solution is as follows:
Windows system, add the following two registry entries:
| The code is as follows |
Copy Code |
1.[hkey_local_machinesystemcurrentcontrolsetservicestcpipparameters]2. " TcpTimedWaitDelay "=dword:0000001e3." MaxUserPort "=dword:0000fffflinux system: |
1.echo ">/proc/sys/net/ipv4/tcp_fin_timeout after testing, the above scheme is very reliable, after operation restart the system, the problem is solved perfectly!"
If you have this problem, try the above solution.