简体   繁体   中英

jmeter give an error No buffer space available (maximum connections reached?): connect

Number of threads = 20 
Ramp-up period = 10 
Loop count = 200

gives an error after some time:

java.net.SocketException: No buffer space available (maximum connections reached?): connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:395)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:234)
    at sun.net.www.http.HttpClient.New(HttpClient.java:307)
    at sun.net.www.http.HttpClient.New(HttpClient.java:324)
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:483)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1018)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1004)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:411)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:297)
    at java.lang.Thread.run(Thread.java:662)

Seems you likely have problems not with your jmeter instance but with os / env.

  1. Look into advises per these links:
    Hunt down java.net.SocketException: No buffer space available
    http://www.codeweblog.com/no-buffer-space-available/

  2. If you are running your jmeter supposably on OS like WinXP please look into these instructions .

Might be that you are not closing connections. Try changing the Keep Alive option on the sampler but remember to check what is actually being sent with real requests from a real browser (you don't want to mask a potential issue). It could also be that your server is not configured to close connections, which again may be a real problem with you application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM