<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi!<br>
<br>
recently (on another unrelated thread) an issue came up with failure
to open sockets due to the limit of file descriptors available per
user per process (this was on Ubuntu linux IIRC), could this be your
case? Check this article by Trustin for further reading:<br>
<br>
<a class="moz-txt-link-freetext" href="http://gleamynode.net/articles/1557/">http://gleamynode.net/articles/1557/</a><br>
<br>
Cheers,<br>
Vassilis<br>
<br>
On 23/06/2011 1:14 , Jordan Sissel wrote:
<blockquote
cite="mid:BANLkTikrodMeKTpgiKj96zyrp_5ZCX3dCw@mail.gmail.com"
type="cite">Howdy :)
<div><br>
</div>
<div>I have a service that currently listens on thousands of tcp
and udp ports (for different channels of data); due to various
problems, I am rewriting it in Java and decided to use Netty.</div>
<div>
<br>
</div>
<div>I've tried a few different ways of doing things -</div>
<div><br>
</div>
<div>First, one NioServerSocketChannelFactory (or
NioDatagramChannelFactory) per listening port. Problem is, after
a few thousand server channels (via ConnectionlessBootstrap and
ServerBootstrap), I get OOM while creating threads.</div>
<div><br>
</div>
<div>Second, one NioServerSocketChannelFactory shared across all
TCP server ports and one NioDatagramChannelFactory for all UDP
server ports. Problem here is that after about a few hundred
open sockets with error
"org.jboss.netty.channel.ChannelException: Failed to bind to: /<a
moz-do-not-send="true" href="http://0.0.0.0:15725">0.0.0.0:15725</a>"
- watching strace shows bind(2) successfully bind on this port,
for example, so the cause is not a bind specific failure.
Trolling the logs, I see about 911 successful TCP server sockets
before tcp fails with this message</div>
<div><br>
</div>
<div>I am using NioServerSocketChannelFactory with
Executors.newCachedThreadPool().</div>
<div><br>
</div>
<div>I can try to make some standalone code that reproduces this
behavior for further study, but if there's anything obvious I'm
missing, please let me know.</div>
<div><br>
</div>
<div>-Jordna</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
netty-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/netty-users">https://lists.jboss.org/mailman/listinfo/netty-users</a></pre>
</blockquote>
</body>
</html>