0

I have an architecture where I use an Apache 2.2 to load balance 4 Tomcat 6.0.26 servers. All 4 servers are exactly same liferay instances and were running properly until a last couple of days. All my tomcat servers suddenly seem to stop and continuously throw the following exception -

Jun 22, 2015 4:54:42 AM org.apache.jk.common.ChannelSocket processConnection
WARNING: processCallbacks status 2
Jun 22, 2015 4:54:42 AM org.apache.jk.common.ChannelSocket processConnection
WARNING: processCallbacks status 2
Jun 22, 2015 4:54:42 AM org.apache.jk.common.ChannelSocket processConnection
WARNING: processCallbacks status 2
Jun 22, 2015 4:54:42 AM org.apache.jk.common.ChannelSocket processConnection
WARNING: processCallbacks status 2
Jun 22, 2015 10:46:26 AM org.apache.jk.common.ChannelSocket acceptConnections
WARNING: Exception executing accept
java.net.SocketException: Too many open files
    at java.net.PlainSocketImpl.socketAccept(Native Method)
    at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:375)
    at java.net.ServerSocket.implAccept(ServerSocket.java:470)
    at java.net.ServerSocket.accept(ServerSocket.java:438)
    at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:312)
    at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:666)
    at org.apache.jk.common.ChannelSocket$SocketAcceptor.runIt(ChannelSocket.java:877)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
    at java.lang.Thread.run(Thread.java:679)

The "java.net.SocketException: Too many open files" exception is continuously thrown infinite times until the server memory is full and threshold reaches 100%. The only solution I found was to restart the servers and after every 12-14 hours same thing happens.

aayushdriger
  • 382
  • 3
  • 19
  • 1
    What OS are you running on? And please check https://stackoverflow.com/questions/5656458/java-net-socketexception-too-many-open-files (not just the accepted answer) There's plenty of information on the internet for "java.net.SocketException: Too many open files" - what have you already tried? – Olaf Kock Jun 23 '15 at 08:11
  • I am CentOS 5.8. I also tried raising No. of open files reach the global limit. But still the issue persists. – aayushdriger Jun 23 '15 at 09:11
  • I also tried raising No. of open files reach the global limit by editing /etc/sysctl.conf and setting fs.file-max = 65536. I also tried increasing the soft ulimit by using ulimit -n 2048. Earlier it was 1024. But still no luck. – aayushdriger Jun 23 '15 at 11:18
  • Lots of unnecessary work done here: Please link all your crosspostings of the same question to each other, so that we can check if the problem has long been solved in the other places. Link from here to there and from there to here! – Olaf Kock Jun 24 '15 at 10:33
  • Can it be a problem with AJP? Because i have a apache 2.2 load balancing 4 tomcat servers. – aayushdriger Jun 29 '15 at 12:05
  • sorry, I didn't find the links to crossposts - neither in your previous comment, nor in the question and not in the other crossposts where I found them. – Olaf Kock Jun 29 '15 at 14:11
  • I refered the following links - http://www.liferay.com/community/forums/-/message_boards/view_message/3770218 , http://lj4newbies.blogspot.in/2007/04/too-many-open-files.htm , http://www.coderanch.com/t/206564/sockets/java/java-net-SocketException-open-files , http://jagadesh4java.blogspot.in/2011/07/javanetsocketexception-to-many-open.html , https://doc.nuxeo.com/display/KB/java.net.SocketException+Too+many+open+files , https://www.liferay.com/community/forums/-/message_boards/message/55512309 . – aayushdriger Jul 01 '15 at 06:01
  • Your own crossposts would have been sufficient. Pavel has given an answer on https://www.liferay.com/community/forums/-/message_boards/message/55512309 - as you haven't stated that it didn't work, I'll give the same advice. Also, you didn't crossreference from https://www.liferay.com/community/forums/-/message_boards/message/55512309 to here. This causes duplicate work as nobody knows of parallel discussions that go on. – Olaf Kock Jul 01 '15 at 09:54

0 Answers0