[Ubuntu] Can not login openfire server for over 1000 accounts

Hi,

I am new in Linux OS, and I setup a server with Ubuntu 10.04 and openfire 3.6.4. I can login this openfire server with pidgin, but server will be no responding after over 900 accounts are logged in. Please give me some idea to solve this problem.

Symptoms:

  1. Server will be no responding after over 900 accounts are logged in.

lsof -p XXXX | wc -l command returns 1078~1085 in many testing cycles (XXXX is ID of Java)

  1. I found following information in log files of openfire (warn.log)

java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
at org.mortbay.jetty.nio.SelectChannelConnector$1.acceptChannel(SelectChannelConne ctor.java:75)
at org.mortbay.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:475)
at org.mortbay.io.nio.SelectorManager.doSelect(SelectorManager.java:166)
at org.mortbay.jetty.nio.SelectChannelConnector.accept(SelectChannelConnector.java :124)
at org.mortbay.jetty.AbstractConnector$Acceptor.run(AbstractConnector.java:707)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

What I did for this issue are as follow:

1.Modify “/etc/default/openfire”

 DAEMON_OPTS="-Xms512m -Xmx2048m -Xss1024k -Xoss1024k -XX:ThreadStackSize=128 -XX:+PrintGCDetails -Xloggc:/tmp/Openfire-gc.log -XX:MaxPermSize=128m -Djava.net.preferIPV4Stack=true -XX:+HeapDumpOnOutOfMemoryError"

2.Modify Ulimit by “ulimit -SHn 4096”

 ulimit -SHa
 core file size          (blocks, -c) 0
 data seg size           (kbytes, -d) unlimited
 scheduling priority             (-e) 20
 file size               (blocks, -f) unlimited
 pending signals                 (-i) 16382
 max locked memory       (kbytes, -l) 64
 max memory size         (kbytes, -m) unlimited
 open files                      (-n) 4096
 pipe size            (512 bytes, -p) 8
 POSIX message queues     (bytes, -q) 819200
 real-time priority              (-r) 0
 stack size              (kbytes, -s) 8192
 cpu time               (seconds, -t) unlimited
 max user processes              (-u) unlimited
 virtual memory          (kbytes, -v) unlimited
 file locks                      (-x) unlimited

3.Modify file-max in /etc/sysctl.conf to 400000 and do "sysctl -p"

4.Add settings in /etc/security/limits.conf (openfire is user name)

 *         -    nofile   4096
 openfire  soft nofile 4096
 openfire  hard nofile 4096

5.To unmark a line in /etc/pam.d/su

 session    required   pam_limits.so
  1. I did all above modifications, but is still failed
  1. After I open over 500 files by Office and gedit and do the login test again, issue remains and lsof -p XXXX | wc -l command also returns 1078.

System configuration:

OS: Ubuntu 10.04(lucid) kernel 2.6.32-25-server Gnome 2.30.2

Java: 1.6.0_18, OpenJDK 64-Bit Server VM (build 16.0-b13, mixed mode)

RAM: 7.8GB

CPU: Intel Xeon E5320 1.86GHz

Attached please find the zip file which includes following data:

1.Warning log of openfire

2.Some settings like limits.conf, /etc/default/openfire …etc

Please give me some idea to solve this problem.

Thanks a lot.