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
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:
Communications link failure due to: java.io.EOFException
<= Set Tomcat “autoReconnect=true” … if you’re even running Tomcat!
http://wordpress.transentia.com.au/wordpress/2009/09/30/tweaking-the-grails-datasource-to-cope-with-mysqls-foibles/
http://sacharya.com/grails-dbcp-stale-connections/
<= Tweak connection pooling parameters
http://communications-link-failure.blogspot.com/
<= Reduce mysql wait_timeout