lundi 29 juin 2015

tomcat 8 file download speed issue

Thanks in advance, I am using Tomcat 8 and I have functionality to download large files from tomcat server places in context docbase folder. Below was the piece of code I am using the file to download PrintWriter out = response.getWriter();
response.setContentType("APPLICATION/OCTET-STREAM");
response.setHeader("Content-Disposition", "attachment; filename=filename);
FileInputStream fileInputStream = new FileInputStream("filepath");
int i;
while ((i=fileInputStream.read()) != -1) {
out.write(i);
}
fileInputStream.close();
out.close(); When i download a file it was downloading with a speed of 65KB/sec from the save server if I place the same file in Apache server and tries to download the download speed is 135KB/sec

Could some one help me how to speed up the file download from tomcat

Aucun commentaire:

Enregistrer un commentaire