Hi
I have made a service that is handling an immense amount of concurrent events.
I get "Too many open files" from the accpet logic in QuickServer:
java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:226)
at org.quickserver.net.server.QuickServer.runNonBlocking(QuickServer.java:2722)
at org.quickserver.net.server.QuickServer.run(QuickServer.java:795)
at java.lang.Thread.run(Thread.java:722)
I cannot actually believe that is because connections are not closed, it seems so unlogical since I have not made a lot of magic with QS.
On the other hand it could be the OS limit for open files/connections/pipes. But this is not a low limit today, so I need some help here.
- How can I verify in the logs that connections are closed properly?
- When could the above stacktrace occur?
My QS configuration is among other settings:
<server-mode>
<blocking>false</blocking>
</server-mode>
<default-data-mode>
<data-type-in>Byte</data-type-in>
<data-type-out>Byte</data-type-out>
</default-data-mode>
I am not really doing anything about the connections, just letting QS do its work.
What I see in the logs are:
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.QuickServer.runNonBlocking] - Key is Readable, removing OP_READ from interestOps for <ClientHandler-Pool#1-ID:513>
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.NonBlockingClientHandler.run] - Running <ClientHandler-Pool#1-ID:513> using <ClientThread-Pool#1-ID:21> for (ClientEvent-Read)
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.NonBlockingClientHandler.processRead] - SocketChannel read was -1!
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.NonBlockingClientHandler.processRead] - We don't have connection, lets return all resources.
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.NonBlockingClientHandler.run] - <ClientThread-Pool#1-ID:21> calling closeConnection()
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.NonBlockingClientHandler.closeConnection] - Closing SocketChannel
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.NonBlockingClientHandler.returnClientHandler] - <ClientHandler-Pool#1-ID:513>
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.BasicClientHandler.returnClientHandler] - <ClientThread-Pool#1-ID:21> returning <ClientHandler-Pool#1-ID:513>
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.NonBlockingClientHandler.clean] - Starting clean - <ClientHandler-Pool#1-ID:513>
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.net.server.impl.NonBlockingClientHandler.clean] - Finished clean - <ClientHandler-Pool#1-ID:513>
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.util.pool.thread.ClientThread.run] - Client returned the thread: <ClientThread-Pool#1-ID:21>
2013-01-14 09:50:24.018 - [FINEST] - [org.quickserver.util.pool.thread.ClientThread.run] - Returning client thread to pool: <ClientThread-Pool#1-ID:21>
This happens a lot in the logs.
Any comments are appreciated.
Thanks in advance :)