File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Very slow when using remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Very slow when using remote server" Watch "Very slow when using remote server" New topic
Author

Very slow when using remote server

Brian John
Greenhorn

Joined: Jan 16, 2012
Posts: 1
I am connecting to mysql on my remote webserver, doing some bulk inserts with prepared statements.
In this test case there are 849 rows which is about 70kb of data.
I have timed how long it takes for the executeBatch() function to run and on the remote server it's about 32sec.
On my local dev server it ran in about 381ms... thats an 86x difference

For 70kb worth of data, there is definitely a problem.
When I insert the data to the remote server, I can see the rows being slowly added in phpmyadmin.
Connecting to the remote server takes about 600ms which is fine.

The dev server and the remote server are running the same OS and the same version of mysql.
I can't figure out why it is so slow when inserting to the remote server.
It's as if the batch query is not being sent all at one, but in very small chunks which is causing a lot of latency.
Is there any way to force the statement to be sent all at once?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Very slow when using remote server
 
Similar Threads
OutOfMemory Exception and JTable
EJB3 Remote Performance problem
ejbCreate, ejbPostCreate and ejbStore called but no rows are inserted
Help a journalist with an article?
Writing Data Client