Server becomes unresponsive for unknown reason

tsuna tsunanet at gmail.com
Mon Aug 9 23:19:54 EDT 2010


On Mon, Aug 9, 2010 at 1:17 PM, professor.bokdrol
<professor.bokdrol at gmail.com> wrote:
> My application just fails to respond to SYN packets from remote hosts.
> Locally connections are established quite fine.

Your application doesn't directly control responses to SYN packets,
the Linux kernel does.  If you don't see an ACK to the initial SYN
packet, it could indicate that your application isn't accept()ing
connections fast enough.  Modern Linux kernels tend to have SYN
cookies enabled, which allows them to ACK the initial SYN even though
your application isn't ready to accept() the socket.  When they do,
you'll typically see a message in syslog (or kern.log, depending on
your distro).  If you don't have SYN cookies enabled, the kernel will
just discard the SYN packet and the kernel of the client will retry
after its timeout has expired.

I'm not familiar enough with the low level details of Netty to know
how Netty is accept()ing new sockets but if you somehow prevent the
code that runs accept() from running, or don't run it fast enough
while a tons of connections are being established to your application,
this can happen.  Also, you can configure how many sockets the kernel
will "buffer" for you until you accept() them, this is normally done
via the listen() system call, but I have no idea how this is done in
Java (if it's even possible) and whether Netty exposes this somehow/

It's not an accept() problem, then the problem is not related to your
application and comes from somewhere else in the networking stack.

-- 
Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com


More information about the netty-users mailing list