我在 8 核 64 位的 linux(red hat vm)上安装了 netty。
limit :
cputime unlimited
filesize unlimited
datasize unlimited
stacksize 10240 kbytes
coredumpsize 0 kbytes
memoryuse unlimited
vmemoryuse unlimited
descriptors 65535
memorylocked 64 kbytes
maxproc 8192
在 windows xp 中,我运行调用 5000 个 http post 请求的 Jmeter。我每次只能处理 3000~ 个请求,永远不会超过它。如果我检查失败的 jmeter 请求,我会收到此异常:
java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:518)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:284)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1075)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1064)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:426)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
at java.lang.Thread.run(Thread.java:619)
Thread Name: Thread Group 1-4591
Sample Start: 2013-01-01 16:25:05 IST
Load time: 200
Latency: 0
Size in bytes: 1689
Headers size in bytes: 0
Body size in bytes: 1689
Sample Count: 1
Error Count: 1
Response code: Non HTTP response code: java.net.BindException
Response message: Non HTTP response message: Address already in use: connect
Response headers:
HTTPSampleResult fields:
ContentType:
DataEncoding: null
在网络方面,我没有看到任何错误或异常,它只是站着听。如果我做 :
netstat -a | grep ESTABLISHED | grep 8881 | wc -l
我看到 50 个打开的连接(我认为)。当我关闭 netty 并再次运行 netstate 时,我打开了 0 个连接。但我不知道这是否相关。我的问题是如何检测我不能做更多请求的方式?
解决方案 !
将客户端移至 Linux !