JMeter: address already in use: connect solution

The operating system will reserve a temporary port for TCP/IP services, and JMeter will start every thread (new operation) when running concurrency test


Windows reserves a temporary port for TCP/IP service. When JMeter runs concurrency test, every thread (new socket operation) will occupy a temporary port. If the TCP/IP port is occupied and not released in time (socket. Close() operation can not release the bound port immediately, but set the port to time_ Wait status, it will be released after a period of time, the default is 240s), and address already in use: connect will appear.


To increase the number of ports reserved for TCP/IP service, it is necessary to operate on the system installed with JMeter. This paper introduces the solution on Windows system.

1. Key win + R, enter regedit to open the registry, or enter regedit command in CMD to open the registry;

2. Choose HKEY_ LOCAL_ MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters;

3. Right click parameters to create a new DWORD named maxuserport;

4. Then double-click maxuserport, select decimal base, input value data as 6553465534, which is the maximum value, exceeding     The system uses the closest effective value (min 5000 or max 65534);

5. Right click parameters to create a new DWORD named   TCPTimedWaitDelay;

6. Double click tcptimed waitdelay, select decimal base, input numerical data as 30, set time as 30 seconds, default is 240 seconds;

7. Restart the computer to take effect!!


Read More: