0

I have Scala / Akka / Slick 3.x runnable that retrieve 25000 records in a Mysql 5.6 community DB. For each of them, it spawns an actor that will do 7 counts and return a case class containing those 7 values to the runner, which will, once finished save that as a csv file.

It works perfectly fine locally, it gets all the data, store them in memory, output them, close itself, everything is good. On my production DB, it's ok for about 40 seconds, I can see in the logs that it gets all the data until this happens :

[INFO] [03/24/2016 08:41:46.710] [indicator-runner-akka.actor.default-dispatcher-17] [akka://indicator-runner/user/user-usage-provider/$gO] Valid data set sent for xxxxxx [INFO] [03/24/2016 08:41:46.711] [indicator-runner-akka.actor.default-dispatcher-17] [akka://indicator-runner/user/user-usage-provider/$fO] Valid data set sent for xxxxxx [INFO] [03/24/2016 08:41:46.722] [indicator-runner-akka.actor.default-dispatcher-9] [akka://indicator-runner/user/user-usage-provider/$uN] Valid data set sent for xxxxxx [INFO] [03/24/2016 08:41:46.731] [indicator-runner-akka.actor.default-dispatcher-12] [akka://indicator-runner/user/user-usage-provider/$hO] Valid data set sent for xxxxxx [ERROR] [03/24/2016 08:41:46.823] [indicator-runner-akka.actor.default-dispatcher-6] [akka://indicator-runner/user/user-usage-provider/$kO] Should'nt receive this message : Failure(com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)$

At this point, i shutdown the actorsystem and return appropriate exit code, but this operation hasn't gone through.

I faced the maxQueue exception in slick which I fixed with :

executor = AsyncExecutor("HeavyLoad", numThreads = 24, queueSize = 10000)

I also tried :

echo 4096 > /proc/sys/net/core/somaxconn

And set max_connections to 500... No luck

Any ideas of what could go wrong ?

Thank you !

David Puleri
  • 144
  • 8
  • See http://stackoverflow.com/questions/6865538/solving-a-communications-link-failure-with-jdbc-and-mysql?rq=1 and http://stackoverflow.com/questions/2983248/com-mysql-jdbc-exceptions-jdbc4-communicationsexception-communications-link-fai?rq=1 – Mark Rotteveel Mar 24 '16 at 09:18
  • My guess is that something is leaking connections. – cmbaxter Mar 24 '16 at 13:22
  • I have 2 long running actors acting as repository. I am litterally flooding MySQL which can't seem to cope. I think this is why the connexions eventually failed. – David Puleri Mar 24 '16 at 17:08

0 Answers0