Akka警告“ HashedWheelTimer实例过多”; [英] Akka warning about "Too many HashedWheelTimer instances"

查看:72
本文介绍了Akka警告“ HashedWheelTimer实例过多”;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当基于Akka 1.2的应用程序尝试使用500个以上的网格节点时,我得到以下警告:

I'm getting the following warning when my Akka 1.2-based application tries to work with more than 500 or so grid nodes:

Jan 05, 2012 1:36:43 PM org.jboss.netty.util.internal.SharedResourceMisuseDetector
WARNING: You are creating too many HashedWheelTimer instances.  
HashedWheelTimer is a shared resource that must be reused across the application, so that only a few instances are created.

我将更深入地研究Akka代码,以找出HashedWheelTimer的使用位置我应该怎么做才能避免创建太多这样的对象。在执行此操作时,我想我会在此处发布警告,以防万一其中一个专家可以为我提供一个或两个可以缩小并加快搜索速度的指针?​​

I'm going to dig more deeply into the Akka code to find out where the HashedWheelTimer is being used and what I should do to avoid too many of those being created. While I'm doing that, I thought I'd post the warning here in case one of the experts may be able to give me a pointer or two that may narrow and speed up my search, please?

使用Akka 1.3-RC6,出现以下异常:

Using Akka 1.3-RC6, I'm getting the following exception:

Jan 12, 2012 1:24:38 PM org.jboss.netty.util.HashedWheelTimer
WARNING: An exception was thrown by TimerTask.
org.jboss.netty.channel.ChannelException: Failed to open a socket.
    at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.newSocket(NioClientSocketChannel.java:49)
    at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.<init>(NioClientSocketChannel.java:83)
    at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.newChannel(NioClientSocketChannelFactory.java:139)
    at org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory.newChannel(NioClientSocketChannelFactory.java:86)
    at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:218)
    at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:188)
    at akka.remote.netty.ActiveRemoteClient.connect(NettyRemoteSupport.scala:470)
    at akka.remote.netty.ActiveRemoteClientHandler$$anonfun$channelClosed$1$$anon$4.run(NettyRemoteSupport.scala:599)
    at org.jboss.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:519)
    at org.jboss.netty.util.HashedWheelTimer$Worker.notifyExpiredTimeouts(HashedWheelTimer.java:440)
    at org.jboss.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:379)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.net.SocketException: Too many open files
    at sun.nio.ch.Net.socket0(Native Method)
    at sun.nio.ch.Net.socket(Net.java:323)
    at sun.nio.ch.Net.socket(Net.java:316)
    at sun.nio.ch.SocketChannelImpl.<init>(SocketChannelImpl.java:101)
    at sun.nio.ch.SelectorProviderImpl.openSocketChannel(SelectorProviderImpl.java:60)
    at java.nio.channels.SocketChannel.open(SocketChannel.java:142)
    at org.jboss.netty.channel.socket.nio.NioClientSocketChannel.newSocket(NioClientSocketChannel.java:47)
    ... 11 more


推荐答案

在Akka 2.0-M1中已修复,现在我将修复程序反向移植到1.3,它将在下一个RC。

Has been fixed in Akka 2.0-M1, I've now backported the fix to 1.3 and it will be in the next RC.

这篇关于Akka警告“ HashedWheelTimer实例过多”;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆