[Problem] Too many open files

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Mage
Posts: 277
Joined: Fri Apr 17, 2009 2:29 pm

[Problem] Too many open files

Post 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
Forum rules: Please do not use or alter the official L2J Avatars/Signatures/Names for your personal use.
JMD
Advanced User
Advanced User
Posts: 1440
Joined: Wed Apr 15, 2009 10:07 am

Re: [Problem] Too many open files

Post 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/
Mage
Posts: 277
Joined: Fri Apr 17, 2009 2:29 pm

Re: [Problem] Too many open files

Post 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...
Forum rules: Please do not use or alter the official L2J Avatars/Signatures/Names for your personal use.
JMD
Advanced User
Advanced User
Posts: 1440
Joined: Wed Apr 15, 2009 10:07 am

Re: [Problem] Too many open files

Post 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.
Mage
Posts: 277
Joined: Fri Apr 17, 2009 2:29 pm

Re: [Problem] Too many open files

Post by Mage »

We added also the mysql config about open file, but problem not solved:

Code: Select all

 [mysqld]open-files-limit=60000 
Forum rules: Please do not use or alter the official L2J Avatars/Signatures/Names for your personal use.
blacksea
Posts: 458
Joined: Fri Oct 05, 2007 1:29 am

Re: [Problem] Too many open files

Post 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
Mage
Posts: 277
Joined: Fri Apr 17, 2009 2:29 pm

Re: [Problem] Too many open files

Post 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
Forum rules: Please do not use or alter the official L2J Avatars/Signatures/Names for your personal use.
Mage
Posts: 277
Joined: Fri Apr 17, 2009 2:29 pm

Re: [Problem] Too many open files

Post 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 
Forum rules: Please do not use or alter the official L2J Avatars/Signatures/Names for your personal use.
Mage
Posts: 277
Joined: Fri Apr 17, 2009 2:29 pm

Re: [Problem] Too many open files

Post 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
Forum rules: Please do not use or alter the official L2J Avatars/Signatures/Names for your personal use.
JMD
Advanced User
Advanced User
Posts: 1440
Joined: Wed Apr 15, 2009 10:07 am

Re: [Problem] Too many open files

Post 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:
Post Reply