JMeter - How to solve “java.net.BindException: Address already in use: connect” issue on Windows

分享一個大牛的人工智能教程。零基礎!通俗易懂!風趣幽默!希望你也加入到人工智能的隊伍中來!請點擊http://www.captainbed.net

This problem is Windows based. There is a article at https://support.microsoft.com/kb/q196271, which says Windows XP only will make outbound TCP/IP connections using ports 1024-5000, and takes up to 4 minutes to recycle them. Therefore, if you do a lot of connections in a short amount of time, you can easily eat that port range up if you are running load tests.

Resolution


IMPORTANT This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs.
The default maximum number of ephemeral TCP ports is 5000 in the products that are included in the "Applies to" section. A new parameter has been added in these products. To increase the maximum number of ephemeral ports, follow these steps:

  1. Start Registry Editor.
  2. Locate the following subkey in the registry, and then click Parameters:
     

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

  3. On the Edit menu, click New, and then add the following registry entry:Value Name: MaxUserPort
    Value Type: DWORD
    Value data: 65534
    Valid Range: 5000-65534 (decimal)
    Default: 0x1388 (5000 decimal)
    Description: This parameter controls the maximum port number that is used when a program requests any available user port from the system.
  4. Exit Registry Editor, and then restart the computer.

Note An additional TCPTimedWaitDelay registry parameter determines how long a closed port waits until the closed port can be reused.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章