Page 1 of 1

[Problem] Too many open files

Posted: Sun Mar 11, 2012 4:35 pm
by Mage
Hello, a friend need some help about that problem, he is using a custom version of l2j interlude. If anyone can help give us a favor.

We are using interlude, when we reach 1400~ players the server start to give error "Too many open files". This problem creates several problems like:
- Impossible to log on server (you must wait like 5 minutes to log)
- Impossibile save new crest
- Impossible save new log ( for example Gm logs)
ecc. ecc.

The problem appear ONLY when he reaches 1400~ online (1.500 never touched because players can't log in)

He don't need a fix Code side, but i want to tell if there is a possibility to change some machine values.

We did a lot of changes about machine settings, we are using Linux.

Modified:

Code: Select all

etc/security/limits.conf
Used command ulimit, we tried all possible values also 60000+:

Code: Select all

ulimit -n
Modified:

Code: Select all

/proc/sys/fs/file-max
Java version: 1.6.0_29

gameserver start up script:

Code: Select all

 nice -n -3 java -server -Xmx3g -Xmn1g -Xss128k -XX:PermSize=128m -XX:+UseThreadPriorities -XX:ParallelGCThreads=2 -Xnoclassgc
Now also mysql are giving problem, with same error:

Code: Select all

INFO: An exception occurred while acquiring a poolable resource. Will retry.com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Caused by: java.net.SocketException: Too many open files    at java.net.Socket.createImpl(Socket.java:397)    at java.net.Socket.<init>(Socket.java:371)    at java.net.Socket.<init>(Socket.java:218)    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:254)    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:295)    ... 19 more
Thank you for your time,
Mage

Re: [Problem] Too many open files

Posted: Sun Mar 11, 2012 4:49 pm
by JMD
I guess hes using linux, theres a restriction on linux about opened files that creates this.

Take a look at this:
http://www.cyberciti.biz/faq/linux-incr ... pen-files/

Re: [Problem] Too many open files

Posted: Sun Mar 11, 2012 7:16 pm
by Mage
JMD wrote:I guess hes using linux, theres a restriction on linux about opened files that creates this.

Take a look at this:
http://www.cyberciti.biz/faq/linux-incr ... pen-files/
As i wrote we have linux and we applied all that fixes some days ago. Problem persist...

Re: [Problem] Too many open files

Posted: Sun Mar 11, 2012 7:21 pm
by JMD
I dont have anything more to suggest, if you want to keep your server online limit the max players online so you wont have downtime until you find a solution.

Re: [Problem] Too many open files

Posted: Mon Mar 12, 2012 3:21 pm
by Mage
We added also the mysql config about open file, but problem not solved:

Code: Select all

 [mysqld]open-files-limit=60000 

Re: [Problem] Too many open files

Posted: Mon Mar 12, 2012 3:54 pm
by blacksea
hm i got this problem long time ago..

startup script its the problem.

viewtopic.php?f=81&t=17346&p=120490&hil ... les#p90729

Re: [Problem] Too many open files

Posted: Mon Mar 12, 2012 4:22 pm
by Mage
blacksea wrote:hm i got this problem long time ago..

startup script its the problem.

viewtopic.php?f=81&t=17346&p=120490&hil ... les#p90729
This is the start up script as i wrote:
nice -n -3 java -server -Xmx3g -Xmn1g -Xss128k -XX:PermSize=128m -XX:+UseThreadPriorities -XX:ParallelGCThreads=2 -Xnoclassgc
Can you modify it for me? Thank you

Re: [Problem] Too many open files

Posted: Mon Mar 12, 2012 4:36 pm
by Mage
We are testing this now:

Code: Select all

 nice -n -3 java -server -Xmx8g -Xms4g -Xmn2g -Xss128k -XX:PermSize=128m -XX:+UseThreadPriorities -XX:ParallelGCThreads=2 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -Xnoclassgc -XX:+AggressiveOpts 

Re: [Problem] Too many open files

Posted: Tue Mar 13, 2012 1:36 pm
by Mage
Problem solved, the problem was the OS ubuntu. To fix the problem we added this:

For ubuntu users do also this modification (for other OS is not necessary but you always do it)

Other file to change is the common-session file. Use the following command:

sudo gedit /etc/pam.d/common-session

Add the following line:

Code: Select all

 session required pam_limits.so

Re: [Problem] Too many open files

Posted: Fri Mar 16, 2012 12:58 am
by JMD
Mage wrote:Problem solved, the problem was the OS ubuntu. To fix the problem we added this:

For ubuntu users do also this modification (for other OS is not necessary but you always do it)

Other file to change is the common-session file. Use the following command:

sudo gedit /etc/pam.d/common-session

Add the following line:

Code: Select all

 session required pam_limits.so
Bookmarked and thanks. Beaceu you never know when this might happen to you :wink: