You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by "Clark D. Richey, Jr." <cr...@speakeasy.net> on 2003/09/18 22:39:06 UTC

DB keeps running out of connections

I am running james 1.2.2 under Windows XP Pro with MySQL 4. After james
runs for a while (hour or so) it stops responding. In the default.log
file I see MANY entries along the lines of:

16/09/03 21:51:28 INFO  database-connections.maildb:  ***** connection
240 is way too old: 62239 > 60000

16/09/03 21:51:28 INFO  database-connections.maildb: java.lang.Throwable

            at
org.apache.james.util.mordred.PoolConnEntry.lock(PoolConnEntry.java:84)

            at
org.apache.james.util.mordred.JdbcDataSource.getConnection(JdbcDataSourc
e.java:127)

            at
org.apache.james.mailrepository.JDBCSpoolRepository.loadPendingMessages(
JDBCSpoolRepository.java:228)

            at
org.apache.james.mailrepository.JDBCSpoolRepository.getNextPendingMessag
e(JDBCSpoolRepository.java:203)

            at
org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolRepo
sitory.java:137)

            at
org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.jav
a:577)

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

 

In the default.log I see MANY entries along the lines of:

18/09/03 16:32:49 WARN  connections: Maximum number of open connections
exceeded - refusing connection.  Current number of connections is 30

 

It appears as though James is not closing connections..anythoughts?


RE: DB keeps running out of connections

Posted by "Noel J. Bergman" <no...@devtech.com>.
> No. What I did do was port the James DB from one machine (that died) to
> another. I did a clear install of James and MySQL and then moved the old
> MySQL DB over to the new machine.

Did you run the repair utility on the database tables, and allow it to fix
any errors?

Also, did you install the same version of MySQL?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Clark D. Richey, Jr." <cr...@speakeasy.net>.
No. What I did do was port the James DB from one machine (that died) to
another. I did a clear install of James and MySQL and then moved the old
MySQL DB over to the new machine.

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: Thursday, September 18, 2003 7:23 PM
To: James Users List
Subject: RE: DB keeps running out of connections

> I also see these messages in mailstore.log even though James is still
> responding...
> 18/09/03 18:56:01 ERROR mailstore: Error retrieving pending messages
> java.sql.SQLException: Communication link failure:
> java.net.SocketException
> 	at org.gjt.mm.mysql.MysqlIO.sendCommand(Unknown Source)

Something is screwy with your system.  Have you done some upgrading
recently?  What you just posted is a problem between MySQL's JDBC driver
and
the MySQL server.  Are you, by any chance, rebooting the database server
without restarting James?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Noel J. Bergman" <no...@devtech.com>.
> I also see these messages in mailstore.log even though James is still
> responding...
> 18/09/03 18:56:01 ERROR mailstore: Error retrieving pending messages
> java.sql.SQLException: Communication link failure:
> java.net.SocketException
> 	at org.gjt.mm.mysql.MysqlIO.sendCommand(Unknown Source)

Something is screwy with your system.  Have you done some upgrading
recently?  What you just posted is a problem between MySQL's JDBC driver and
the MySQL server.  Are you, by any chance, rebooting the database server
without restarting James?

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Clark D. Richey, Jr." <cr...@speakeasy.net>.
I also see these messages in mailstore.log even though James is still
responding...
18/09/03 18:56:01 ERROR mailstore: Error retrieving pending messages
java.sql.SQLException: Communication link failure:
java.net.SocketException
	at org.gjt.mm.mysql.MysqlIO.sendCommand(Unknown Source)
	at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(Unknown Source)
	at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
	at org.gjt.mm.mysql.PreparedStatement.executeQuery(Unknown
Source)
	at
org.apache.james.mailrepository.JDBCSpoolRepository.loadPendingMessages(
JDBCSpoolRepository.java:232)
	at
org.apache.james.mailrepository.JDBCSpoolRepository.getNextPendingMessag
e(JDBCSpoolRepository.java:203)
	at
org.apache.james.mailrepository.JDBCSpoolRepository.accept(JDBCSpoolRepo
sitory.java:137)
	at
org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.jav
a:577)
	at java.lang.Thread.run(Unknown Source)


-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: Thursday, September 18, 2003 6:52 PM
To: James Users List
Subject: RE: DB keeps running out of connections

Again, two mysql connections:

  TCP    Beaker:1602            localhost:3306         ESTABLISHED
  TCP    Beaker:1683            localhost:3306         ESTABLISHED

and nothing else related to James.

	--- Noel

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Clark D. Richey, Jr." <cr...@speakeasy.net>.
OK....any ideas then? It goes down even if I don't get any mail or send
any mail via james.

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: Thursday, September 18, 2003 6:52 PM
To: James Users List
Subject: RE: DB keeps running out of connections

Again, two mysql connections:

  TCP    Beaker:1602            localhost:3306         ESTABLISHED
  TCP    Beaker:1683            localhost:3306         ESTABLISHED

and nothing else related to James.

	--- Noel

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Noel J. Bergman" <no...@devtech.com>.
Again, two mysql connections:

  TCP    Beaker:1602            localhost:3306         ESTABLISHED
  TCP    Beaker:1683            localhost:3306         ESTABLISHED

and nothing else related to James.

	--- Noel

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Clark D. Richey, Jr." <cr...@speakeasy.net>.
Just restarting James gets it running. I don't need to do anything else.
Here is the netstat with James still running. The previous one was after
it stopped connecting.

Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    Beaker:1267            localhost:15012        ESTABLISHED
  TCP    Beaker:1602            localhost:3306         ESTABLISHED
  TCP    Beaker:1683            localhost:3306         ESTABLISHED
  TCP    Beaker:3306            localhost:1602         ESTABLISHED
  TCP    Beaker:3306            localhost:1683         ESTABLISHED
  TCP    Beaker:4977            localhost:8755         TIME_WAIT
  TCP    Beaker:4979            localhost:8765         TIME_WAIT
  TCP    Beaker:15012           localhost:1267         ESTABLISHED
  TCP    Beaker:3389            Animal:1710            ESTABLISHED
  TCP    Beaker:4027            unknown.Level3.net:http  CLOSE_WAIT
  TCP    Beaker:4033
dsl092-159-070.wdc2.dsl.speakeasy.net:https  CLO
SE_WAIT
  TCP    Beaker:4046
dsl081-178-039.sea1.dsl.speakeasy.net:http  CLOS
E_WAIT
  TCP    Beaker:4872            64.14.117.26:http      CLOSE_WAIT
  TCP    Beaker:4975            kermit:5678            TIME_WAIT
  TCP    Beaker:4976            kermit:5678            TIME_WAIT
  TCP    Beaker:4978            kermit:5678            TIME_WAIT
  TCP    Beaker:4980            kermit:5678            TIME_WAIT

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: Thursday, September 18, 2003 6:22 PM
To: James Users List
Subject: RE: DB keeps running out of connections

> Netstat reveals:

I don't see any mail related connections, and only 2 mysql connections.

	--- Noel

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Netstat reveals:

I don't see any mail related connections, and only 2 mysql connections.

	--- Noel

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Clark D. Richey, Jr." <cr...@speakeasy.net>.
James 2.1.1...sorry.

Netstat reveals:
Active Connections

  Proto  Local Address          Foreign Address        State
  TCP    Beaker:1267            localhost:15012        ESTABLISHED
  TCP    Beaker:1602            localhost:3306         ESTABLISHED
  TCP    Beaker:1683            localhost:3306         ESTABLISHED
  TCP    Beaker:3306            localhost:1602         ESTABLISHED
  TCP    Beaker:3306            localhost:1683         ESTABLISHED
  TCP    Beaker:4977            localhost:8755         TIME_WAIT
  TCP    Beaker:4979            localhost:8765         TIME_WAIT
  TCP    Beaker:15012           localhost:1267         ESTABLISHED
  TCP    Beaker:3389            Animal:1710            ESTABLISHED
  TCP    Beaker:4027            unknown.Level3.net:http  CLOSE_WAIT
  TCP    Beaker:4033
dsl092-159-070.wdc2.dsl.speakeasy.net:https  CLO
SE_WAIT
  TCP    Beaker:4046
dsl081-178-039.sea1.dsl.speakeasy.net:http  CLOS
E_WAIT
  TCP    Beaker:4872            64.14.117.26:http      CLOSE_WAIT
  TCP    Beaker:4975            kermit:5678            TIME_WAIT
  TCP    Beaker:4976            kermit:5678            TIME_WAIT
  TCP    Beaker:4978            kermit:5678            TIME_WAIT
  TCP    Beaker:4980            kermit:5678            TIME_WAIT

The computer running James is called Beaker.

-----Original Message-----
From: Noel J. Bergman [mailto:noel@devtech.com] 
Sent: Thursday, September 18, 2003 5:11 PM
To: James Users List
Subject: RE: DB keeps running out of connections

> I am running james 1.2.2 under Windows XP Pro with MySQL 4.

I assume that the above is incorrect.  What version ARE you running?

> After james runs for a while (hour or so) it stops responding.
> In the default.log file I see MANY entries along the lines of:

> database-connections.maildb:  ***** connection 240 is way too old:
62239 >
60000
> [...]
> JDBCSpoolRepository.loadPendingMessages(JDBCSpoolRepository.java:228)
>
JDBCSpoolRepository.getNextPendingMessage(JDBCSpoolRepository.java:203)
> JDBCSpoolRepository.accept(JDBCSpoolRepository.java:137)
> RemoteDelivery.run(RemoteDelivery.java:577)

Interesting.  Trying to send messages, although that may be just this
sample.

> connections: Maximum number of open connections exceeded - refusing
connection.
> Current number of connections is 30

Run netstat and see what is connected.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: DB keeps running out of connections

Posted by "Noel J. Bergman" <no...@devtech.com>.
> I am running james 1.2.2 under Windows XP Pro with MySQL 4.

I assume that the above is incorrect.  What version ARE you running?

> After james runs for a while (hour or so) it stops responding.
> In the default.log file I see MANY entries along the lines of:

> database-connections.maildb:  ***** connection 240 is way too old: 62239 >
60000
> [...]
> JDBCSpoolRepository.loadPendingMessages(JDBCSpoolRepository.java:228)
> JDBCSpoolRepository.getNextPendingMessage(JDBCSpoolRepository.java:203)
> JDBCSpoolRepository.accept(JDBCSpoolRepository.java:137)
> RemoteDelivery.run(RemoteDelivery.java:577)

Interesting.  Trying to send messages, although that may be just this
sample.

> connections: Maximum number of open connections exceeded - refusing
connection.
> Current number of connections is 30

Run netstat and see what is connected.

	--- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org