[nio-devel] stressing nio-httpd

Risto Laakso risto.laakso at gmail.com
Tue Oct 3 05:33:54 UTC 2006


2006/10/3, Nonny Mouse <enonymoos at gmail.com>:
> Hi,
>
> I've been trying to stress the system a bit and i've come up against some
> issues, if anyone can shed light on them that'd be great...
>
> I patched my local to add errno via sb-alien:get-errno, but couldn't find a
> decent portable solution.
> ----------------------------------------------------
> case 3
>
> Tried tracking epoll_ctl returns in add-fd and getting EEXISTS for what
> looks like every connection.
>
> ----------------------------------------------------


 Hello,


 The epoll_ctl(2) man page says, that "EEXIST: op was EPOLL_CTL_ADD,
and the supplied  file  descriptor  fd  is already in epfd."
 so it seems that the code is trying to add the fd twice ?

 There also a issue that the code will just add every incoming
connection to the queue, which isn't necessarily a good idea, if the
system is loaded. Maybe there should be a mechanism to see that if n
connections are already being served, and if so, just drop additional
connections until existing connections are closed..

 Another slightly related issue is that, because the current design is
single-threaded, if the thread is busy serving some connnection, it
won't accept new connections until the serving has finished. Thus it
might be better to have one thread accepting connections, and another
one (or ones, if you have SMP) serving connections..



 -r



More information about the Nio-devel mailing list