Jump to content
  • 0

[Help] Mysql Error When Players Online Be 30-40


Question

Posted

Hello! i have a very big problem with gameserver to connect with mysql

When players online are 30-40, server crashed by mysql

i have linux and i increased to my.cnf max connected 3000.

Max online players in gameserver are 500 people.

 

this is the error

 

An exception occurred while acquiring a poolable resource. Will retry.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, mess$
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.Util.getInstance(Util.java:382)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1119)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2338)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2371)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2163)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:794)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.GeneratedConstructorAccessor60.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:378)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:305)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledC$
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:620)

 

 

11 answers to this question

Recommended Posts

  • 0
Posted

3000 max connections? I doubt you understand how that config works. Reduce it to 100.

 

My suggestion: rework your pack's L2DatabaseFactory and use try () - catch () to handle all your db connections. You'll also have to update your java version to 7. Java 7 handles all connections and closes them automatically.

  • 0
Posted

3000 max connections? I doubt you understand how that config works. Reduce it to 100.

 

My suggestion: rework your pack's L2DatabaseFactory and use try () - catch () to handle all your db connections. You'll also have to update your java version to 7. Java 7 handles all connections and closes them automatically.

I'm using l2jfrozen! and i have already java version 7

  • 0
Posted

The main problem is we don't have the complete message error, and the reason.

 

 

 

Data source rejected establishment of connection, mess$

 

That "mess$" should be server message with the reason.

 

Java 7 handles connection close using the try (Connection...) writing style, yup.

  • 0
Posted

The main problem is we don't have the complete message error, and the reason.

 

 

That "mess$" should be server message with the reason.

 

Java 7 handles connection close using the try (Connection...) writing style, yup.

And what i have to do?

  • 0
Posted (edited)

The main problem is we don't have the complete message error, and the reason.

 

 

That "mess$" should be server message with the reason.

 

Java 7 handles connection close using the try (Connection...) writing style, yup.

so what?

Edited by xrulezz
  • 0
Posted

And what i have to do?

Look my post, i've written a suggestion there ;)

 

A good reference is L2JServer's latest DatabaseFactory. You can also take a look on how they handle their connections and do the same.

 

That of course is time consuming, easier solution would be to write a small piece of code to detect unclosed SQL connections.

  • 0
Posted (edited)

Look my post, i've written a suggestion there ;)

 

A good reference is L2JServer's latest DatabaseFactory. You can also take a look on how they handle their connections and do the same.

 

That of course is time consuming, easier solution would be to write a small piece of code to detect unclosed SQL connections.

and i have only to edit DatabaseFactory or i have to edit more files?

Edited by xFranky
  • 0
Posted

First option requires a massive rework on every file that handles a database connection.

Second option requires a small piece of code in L2DatabaseFactory.

 

First is better performance wise, since you'll always be sure issues like that won't ever happen again.

Second will simply point you where the error comes from, enabling you to fix it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...