Play Framework:带有5k请求的SocketException

时间:2014-06-08 23:37:08

标签: playframework-2.0 threadpool stress-testing gatling

您好我正在使用Play Framework测试压力测试工具。每当我使用不同的斜坡运行测试时,在达到大约5k的总共10k的请求后,我得到以下错误。每个时间段可以处理的请求数量是否有限制?下面的错误是什么?

java.net.SocketException: Too many open files in system
at sun.nio.ch.Net.socket0(Native Method) ~[na:1.7.0_25]
at sun.nio.ch.Net.socket(Net.java:423) ~[na:1.7.0_25]
at sun.nio.ch.Net.socket(Net.java:416) ~[na:1.7.0_25]
at sun.nio.ch.SocketChannelImpl.<init>(SocketChannelImpl.java:104) ~[na:1.7.0_25]
at sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:60) ~[na:1.7.0_25]
at java.nio.channels.SocketChannel.open(SocketChannel.java:142) ~[na:1.7.0_25]
at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.newSocket(NioClientSocketChannel.java:41) ~[netty-3.8.0.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.<init>(NioClientSocketChannel.java:82) ~[netty-3.8.0.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.newChannel(NioClientSocketChannelFactory.java:212) ~[netty-3.8.0.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.newChannel(NioClientSocketChannelFactory.java:82) ~[netty-3.8.0.Final.jar:na]
at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:212) ~[netty-3.8.0.Final.jar:na]
at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:182) ~[netty-3.8.0.Final.jar:na]
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.doConnect(NettyAsyncHttpProvider.java:1085) [async-http-client-1.8.3.jar:na]
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.execute(NettyAsyncHttpProvider.java:920) [async-http-client-1.8.3.jar:na]
at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:524) ~[async-http-client-1.8.3.jar:na]
at com.excilys.ebi.gatling.http.action.HttpRequestAction.execute(HttpRequestAction.scala:89) ~[gatling-http-1.5.5.jar:na]
at com.excilys.ebi.gatling.core.action.Action$$anonfun$receive$1.apply(Action.scala:31) ~[gatling-core-1.5.5.jar:na]
at com.excilys.ebi.gatling.core.action.Action$$anonfun$receive$1.apply(Action.scala:30) ~[gatling-core-1.5.5.jar:na]
at scala.PartialFunction$$anon$1.apply(PartialFunction.scala:76) ~[scala-library-2.9.3.jar:na]
at akka.actor.Actor$class.apply(Actor.scala:318) ~[akka-actor-2.0.4.jar:2.0.4]
at com.excilys.ebi.gatling.http.action.HttpRequestAction.apply(HttpRequestAction.scala:55) ~[gatling-http-1.5.5.jar:na]
at akka.actor.ActorCell.invoke(ActorCell.scala:626) ~[akka-actor-2.0.4.jar:2.0.4]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) ~[akka-actor-2.0.4.jar:2.0.4]
at akka.dispatch.Mailbox.run(Mailbox.scala:179) ~[akka-actor-2.0.4.jar:2.0.4]
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516) ~[akka-actor-2.0.4.jar:2.0.4]
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) ~[akka-actor-2.0.4.jar:2.0.4]
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) ~[akka-actor-2.0.4.jar:2.0.4]
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479) ~[akka-actor-2.0.4.jar:2.0.4]

1 个答案:

答案 0 :(得分:2)

您混淆请求和打开连接。你遇到的限制是后者,它与系统有关。看看这个加特林维基页面:https://github.com/excilys/gatling/wiki/Getting-Started#os-config