You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ohaya <oh...@yahoo.com.INVALID> on 2023/03/29 22:16:51 UTC

Strange problem - Simple Jmeter test to Apache server getting "java.net.BindException: Address already in use: connect"

Hi,

We are trying to a JMeter testm one machine to an Apache server on another machine.  

The JMeter version is 5.2.1 and both the JMeter and the Apache server on are separate Windows 2016 machines in AWS.

The Java version on the machine where the JMeter is installed is Windows 1.8 202(2) or 11.0.14 (we tried several different Java versions and had the same problem with all of them).

When we run the test, we noted that the first time we start JMeter, all the requests up to near the end of the run are successful, but then all the requests near the end of the run get errors:

java.net.BindException: Address already in use: connect

at java.base/java.net.PlainSocketImpl.connect0(Native Method)

at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)

at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)

at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)

at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)

at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.base/java.net.Socket.connect(Socket.java:608)

at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)

at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)

at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionOperator.connect(HTTPHC4Impl.java:326)

at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)

at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)

at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)

at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)

at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)

at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)

at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)

at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)

at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:850)

at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:561)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:67)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1282)

at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1271)

at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627)

at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551)

at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490)

at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)

at java.base/java.lang.Thread.run(Thread.java:834)

(i.e., since most of the requests succeed in that first run, seems like there isn't a connectivity problem).

Then if we try to run the same test again, almost all the tests in the 2nd run fail the same way as above..

The test plan is really simple with just:

Thread group
  - HTTP Cookie Manager
  - CSV Data Set Config 
  - Keystore Configuration
  - HTTP Request
  - View Test Results
  - Summary


When we run the same Jmeter test plan/.jmx on another AWS Windows server (same Windows 2016 version and same Java), but this "other" AWS Windows server is our main/shared terminal server, so they don't want us to run the Jmeter on it.

Does anyone have any idea why Jmeter might be getting those bind errors, but only when the Jmeter is run from the 1st Windows machine?

Thanks!

Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Strange problem - Simple Jmeter test to Apache server getting "java.net.BindException: Address already in use: connect"

Posted by ohaya <oh...@yahoo.com.INVALID>.
 We've tried running the Jmeter from different machines on AWS, and we think (a theory) that it seems to depend on which machine the Jmeter is running on/being hosted on, but we still haven't been able to figure out what specifically is making the difference yet.

Jim


     On Thursday, March 30, 2023, 02:30:08 AM EDT, Dmitri T <gl...@live.com> wrote:  
 
 ohaya wrote:
> Hi,
>
> We are trying to a JMeter testm one machine to an Apache server on another machine.
>
> The JMeter version is 5.2.1 and both the JMeter and the Apache server on are separate Windows 2016 machines in AWS.
>
> The Java version on the machine where the JMeter is installed is Windows 1.8 202(2) or 11.0.14 (we tried several different Java versions and had the same problem with all of them).
>
> When we run the test, we noted that the first time we start JMeter, all the requests up to near the end of the run are successful, but then all the requests near the end of the run get errors:
>
> java.net.BindException: Address already in use: connect
>
> at java.base/java.net.PlainSocketImpl.connect0(Native Method)
>
> at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)
>
> at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
>
> at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
>
> at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
>
> at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
>
> at java.base/java.net.Socket.connect(Socket.java:608)
>
> at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
>
> at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionOperator.connect(HTTPHC4Impl.java:326)
>
> at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
>
> at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
>
> at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
>
> at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
>
> at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
>
> at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
>
> at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
>
> at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:850)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:561)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:67)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1282)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1271)
>
> at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627)
>
> at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551)
>
> at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490)
>
> at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
>
> at java.base/java.lang.Thread.run(Thread.java:834)
>
> (i.e., since most of the requests succeed in that first run, seems like there isn't a connectivity problem).
>
> Then if we try to run the same test again, almost all the tests in the 2nd run fail the same way as above..
>
> The test plan is really simple with just:
>
> Thread group
>    - HTTP Cookie Manager
>    - CSV Data Set Config
>    - Keystore Configuration
>    - HTTP Request
>    - View Test Results
>    - Summary
>
>
> When we run the same Jmeter test plan/.jmx on another AWS Windows server (same Windows 2016 version and same Java), but this "other" AWS Windows server is our main/shared terminal server, so they don't want us to run the Jmeter on it.
>
> Does anyone have any idea why Jmeter might be getting those bind errors, but only when the Jmeter is run from the 1st Windows machine?
>
> Thanks!
>
> Jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
Sounds like it's a problem with the operating system configuration, i.e. 
you've reached the limit of maximum open ports and the ports which are 
used haven't been recycled yet.

 1. Increase dynamic port range for TCP/IP:
    https://learn.microsoft.com/en-us/troubleshoot/windows-client/networking/tcp-ip-port-exhaustion-troubleshooting#default-dynamic-port-range-for-tcpip
 2. Decrease TcpTimedWaitDelay:
    https://www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=system-recycling-tcp-connections-microsoft-windows-operating
 3. Increase the number of TCP connections:
    https://www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=itspmwos-increasing-maximum-number-tcp-connections-microsoft-windows-operating-system

If the above changes will be not sufficient to resolve your issue you 
will need to allocate at least one more load generator machine and run 
your JMeter test in distributed mode: 
https://www.blazemeter.com/blog/distributed-testing-in-jmeter

  

Re: Strange problem - Simple Jmeter test to Apache server getting "java.net.BindException: Address already in use: connect"

Posted by Dmitri T <gl...@live.com>.
ohaya wrote:
> Hi,
>
> We are trying to a JMeter testm one machine to an Apache server on another machine.
>
> The JMeter version is 5.2.1 and both the JMeter and the Apache server on are separate Windows 2016 machines in AWS.
>
> The Java version on the machine where the JMeter is installed is Windows 1.8 202(2) or 11.0.14 (we tried several different Java versions and had the same problem with all of them).
>
> When we run the test, we noted that the first time we start JMeter, all the requests up to near the end of the run are successful, but then all the requests near the end of the run get errors:
>
> java.net.BindException: Address already in use: connect
>
> at java.base/java.net.PlainSocketImpl.connect0(Native Method)
>
> at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)
>
> at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
>
> at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
>
> at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
>
> at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
>
> at java.base/java.net.Socket.connect(Socket.java:608)
>
> at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
>
> at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$JMeterDefaultHttpClientConnectionOperator.connect(HTTPHC4Impl.java:326)
>
> at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:374)
>
> at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)
>
> at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
>
> at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
>
> at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
>
> at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
>
> at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
>
> at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:850)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:561)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:67)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1282)
>
> at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1271)
>
> at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627)
>
> at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551)
>
> at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490)
>
> at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
>
> at java.base/java.lang.Thread.run(Thread.java:834)
>
> (i.e., since most of the requests succeed in that first run, seems like there isn't a connectivity problem).
>
> Then if we try to run the same test again, almost all the tests in the 2nd run fail the same way as above..
>
> The test plan is really simple with just:
>
> Thread group
>    - HTTP Cookie Manager
>    - CSV Data Set Config
>    - Keystore Configuration
>    - HTTP Request
>    - View Test Results
>    - Summary
>
>
> When we run the same Jmeter test plan/.jmx on another AWS Windows server (same Windows 2016 version and same Java), but this "other" AWS Windows server is our main/shared terminal server, so they don't want us to run the Jmeter on it.
>
> Does anyone have any idea why Jmeter might be getting those bind errors, but only when the Jmeter is run from the 1st Windows machine?
>
> Thanks!
>
> Jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail: user-help@jmeter.apache.org
>
Sounds like it's a problem with the operating system configuration, i.e. 
you've reached the limit of maximum open ports and the ports which are 
used haven't been recycled yet.

 1. Increase dynamic port range for TCP/IP:
    https://learn.microsoft.com/en-us/troubleshoot/windows-client/networking/tcp-ip-port-exhaustion-troubleshooting#default-dynamic-port-range-for-tcpip
 2. Decrease TcpTimedWaitDelay:
    https://www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=system-recycling-tcp-connections-microsoft-windows-operating
 3. Increase the number of TCP connections:
    https://www.ibm.com/docs/en/filenet-p8-platform/5.5.x?topic=itspmwos-increasing-maximum-number-tcp-connections-microsoft-windows-operating-system

If the above changes will be not sufficient to resolve your issue you 
will need to allocate at least one more load generator machine and run 
your JMeter test in distributed mode: 
https://www.blazemeter.com/blog/distributed-testing-in-jmeter


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org