vendredi 8 mai 2015

All Threads Block on socket IO when using JDBC?

I am experiencing a very frustrating problem.

Basically I have a huge amount of sql update statements to perform on a mysql db using JDBC. To do this in the time required I am using Java's Executor Service with a fixed thread pool like so:

ExecutorService executor =  Executors.newFixedThreadPool(10);

So each thread calls the run method of another class I have and in that class an sql update operation is performed.

But it is running extremely slow and JProfiler has revealed that all the threads block on socket IO. I thought that mysql would be able to handle multiple update statements concurrently.

Any ideas on how to get around this problem?

Note I have 10 available processors on my machine.

Below is a screenshot of the Thread History screen from JProfiler. The Light Blue colour here indicates that the thread is in Net I/O( The thread is waiting to write data to a socket). Any help would be great thanks.enter image description here

Aucun commentaire:

Enregistrer un commentaire