Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IOUtils.copy and IOUtils.copyLarge are very slow

I've implemented a REST service for downloading a moderately large (250 Mb) zip file using IOUtils.copy(), similar to Most effective way to write file to servletoutputstream. The REST service is called from another app using HttpURLConnection. I use IOUtils.copy() on the receiving side to save the file to disk.

It takes over 30 minutes to download a file. This is way too slow.

Ideas? Better implementations?

like image 229
Brett Slocum Avatar asked Jul 13 '12 20:07

Brett Slocum


1 Answers

I found the issue.

I was running both the client and the server on the same machine for testing. As soon as I moved one to a different machine, the transfer took a little over a minute.

like image 170
Brett Slocum Avatar answered Nov 15 '22 23:11

Brett Slocum