Openfire 3.5.1 Database connection error

Every time we start our openfire server, the error logs are filled with the following errors:

DbConnectionProvider: Error while getting connection:

java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: ConnectionCount is 15. Maximum connection count of 15 cannot be exceeded.

at org.logicalcobwebs.proxool.ConnectionPool.getConnection(ConnectionPool.java:224 )

at org.logicalcobwebs.proxool.ProxoolDriver.connect(ProxoolDriver.java:89)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at org.jivesoftware.database.DefaultConnectionProvider.getConnection(DefaultConnec tionProvider.java:76)

at org.jivesoftware.database.DbConnectionManager.getConnection(DbConnectionManager .java:101)

at org.jivesoftware.openfire.lockout.DefaultLockOutProvider.getDisabledStatus(Defa ultLockOutProvider.java:52)

at org.jivesoftware.openfire.lockout.LockOutManager.getDisabledStatus(LockOutManag er.java:134)

at org.jivesoftware.openfire.lockout.LockOutManager.isAccountDisabled(LockOutManag er.java:159)

at org.jivesoftware.openfire.auth.AuthFactory.authenticate(AuthFactory.java:152)

at org.jivesoftware.openfire.handler.IQAuthHandler.login(IQAuthHandler.java:207)

at org.jivesoftware.openfire.handler.IQAuthHandler.handleIQ(IQAuthHandler.java:148 )

at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:49)

at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:349)

at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:101)

at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:68)

at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:299)

at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler .java:79)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:264)

at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:163)

at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandl er.java:133)

at org.apache.mina.common.support.AbstractIoFilterChain$TailFilter.messageReceived (AbstractIoFilterChain.java:570)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.common.IoFilterAdapter.messageReceived(IoFilterAdapter.java:80)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput.flush(SimplePr otocolDecoderOutput.java:58)

at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecF ilter.java:180)

at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(Ab stractIoFilterChain.java:299)

at org.apache.mina.common.support.AbstractIoFilterChain.access$1100(AbstractIoFilt erChain.java:53)

at org.apache.mina.common.support.AbstractIoFilterChain$EntryImpl$1.messageReceive d(AbstractIoFilterChain.java:648)

at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java :239)

at org.apache.mina.filter.executor.ExecutorFilter$ProcessEventsRunnable.run(Execut orFilter.java:283)

at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51)

at java.lang.Thread.run(Unknown Source)

Any ideas how to get rid of this?

Hey Lee,

How many clients are trying to simultaneously connect to the server? If the number is very high then you might want to increase the max number of connections in the db pool.

Regards,

– Gato

At the most, I’ve had 250 users attached at once to the openfire server. I was under the impression that anything under 1,000 is a light load and should work fine. How would I update the number of connections in the db pool?

Hey Lee,

1K is very light load. Still this problem is unrelated to heavy or light load but about number of people trying to access the DB at the same time. If you have 250 users reconnecting at the same time then you will have 250 potential concurrent DB queries and you only have 15 connections in the pool. Since the server by default uses 18 worker threads your max connection size of the pool should be higher than 18. I would recommend moving it to 20 or 25 db connections.

Regards,

– Gato

Do I change that in Openfire or somewhere in my MS SQL database?

Edit the conf/openfire.xml file and then restart the server.

Regards,

– Gato

Thank you so much. We’ve gotten rid of our error.

I have the same problem. I use version 3.3.2

Openfire has been set the maximum database connection become 200

I see that the db connection never been released and makes the cpu usage increase significantly and reach 100 %.

How to release the IDLE db connection so the cpu usage can be maintained to about 50% only.

Thanks