Java netty can only take X number of request per second? With the selector approach is it true that it can be a bottleneck in terms of serving request per second? We find that when the traffic is high, clients are unable to connect through, resulting in a time out.
A:
This is probably not due to selector being a bottleneck, but either due to TCP having too few ephemeral ports on the clients or due to server hitting the file descriptor limit.
Nikolai N Fetissov
2010-10-21 19:01:41
It's not the client, each client only makes one connection. It's not the file descriptor because I am able to connect to that server on another port without time out.
erotsppa
2010-10-21 19:40:05
A:
There's an increasing view that you shouldn't use Selectors, just hundreds of thousands of threads. Selectors move the scheduling process into the application where arguably it doesn't belong. Also they were designed when the alternative was a process per client. A thread per client is orders of magnitude cheaper.
EJP
2010-10-22 00:25:22