Nodejs Request Eaddrinuse Solution

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.