0

I am currently running some java code which makes extensive calls to a mysql database. These calls are flooding the database and after a few hours of the code running I am getting a nested exception:

java.io.EOFException
    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1934)
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:798)
    at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3700)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1203)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:2572)


Last packet sent to the server was 8789 ms ago.
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2592)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:798)
    at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3700)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1203)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:2572)

Unfortunately I do not have much experience with this kind of problem, can anyone recommend ways to ensure all my queries can be processed?

I can appreciate this is a very broad question, but the queries themselves are not difficult, it is more the scale of the number of queries I am requesting.

Thanks

user1220022
  • 11,167
  • 19
  • 41
  • 57
  • This sounds like a problem that may be helped by logging so you can see what your program is doing at various times, and in particular the program's state when it gets into trouble. Are you currently using logging for this app? – Hovercraft Full Of Eels Aug 26 '12 at 03:03
  • I am using basic output logging yes, the problem is in the scope of the size of the users in the database, meaning it will fail at some arbitrary user due to hang in the sql database. `show processlist` will show the query which has caused the system to hang, but it is at an arbitrary point in the user set.. – user1220022 Aug 26 '12 at 03:06
  • 1
    Check the number of open connections that are there for your database. If you're opening an increasingly huge amount of connection, then I would suggest `connection pooling`. In the same context, what is the majority type of the queries to your DB? Are they `select` queries or you trying to perform database updates? – Sujay Aug 26 '12 at 03:13
  • They are all select queries for different user ids. – user1220022 Aug 26 '12 at 03:17

1 Answers1

1

I would troubleshoot this at the OS/MySql/Web server level. In other words, this isn't a "Java" problem per se. It's probably much more a "system performance/system configuration" issue.

SUGGESTION:

1) You haven't specified your OS, Web server/application server. These are key.

2) Run basic performance checks (ps -eaf and iostat for Linux, Task Mgr/CPU/Memory/Networking stats for Windows). Pay particular attention to "netstat" (Linux and Windows).

3) Look at all the relevant logs (/var/log/messages etc for Linux; EventVwr, etc for Windows)

4) Check your OS, DB and Web server configuration settings.

5) Pay particular attention to possible "stale connections" and DB-related "connection pooling" parameters.

Check these links:

Community
  • 1
  • 1
paulsm4
  • 114,292
  • 17
  • 138
  • 190