I'm having a strange problem with regard to HTTP upload speed when using
Internet Explorer on Windows with Tomcat on Solaris. If I upload a 10 MB
file over a 100 Mbs Ethernet connection, it takes 2 minutes 25 seconds if I
use IE (~80 Kbs). If I use Mozilla, it takes 3 seconds (~3 Mbs). If I try
the same thing, but, run Tomcat on Linux instead, it takes 2 seconds when
using IE. It takes 1 second if I run Tomcat on my local Windows computer.
I'm using Solaris 8 with a patch cluster that I downloaded and installed
within the last few weeks, Tomcat 5.0.12, J2SE 1.4.1, and the version of
Internet Explorer that comes with Windows XP with all the Windows updates
applied. The problem seems to occur with Tomcat 4.1.24 as well. I also tried
it on a different Windows 2000 computer to make sure nothing was wrong with
my XP box and the other computer had the same problem.

Has anyone else had this problem? Is there anyone out there that has a
Solaris box that wouldn't mind running the test application that I created
to see if you have the same problem?

I'm wondering if the problem might be with our network, but, I don't think
that's the case because I have another application on a Solaris box that
does HTTP uploads using a Perl application that doesn't have the performance
problem.

Jon
import java.text.*;
import java.util.*;

public class TimeSpan {
	public TimeSpan(Date startDate, Date endDate) {
		long l = (endDate.getTime() - startDate.getTime()) / 1000;
		hours = l / 60 / 60;
		minutes = l / 60 - (hours * 60);
		seconds = l - (hours * 60 * 60) - (minutes * 60);
	}
	
	public String toString() {
		Object[] o = {new Long(hours), new Long(minutes), new Long(seconds)};
		return new MessageFormat("{0,number,00}:{1,number,00}:{2,number,00}").format(o);
	}
	
	public long hours;
	public long minutes;
	public long seconds;
}
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class FileUpload3 extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		try {
			resp.setContentType("text/html");
			PrintWriter pw = resp.getWriter();
			pw.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\";><?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
			pw.println("<html><head><title>File Upload</title></head><body>");
			pw.println("<form action=\"/servlet/FileUpload3\" enctype=\"multipart/form-data\" method=\"post\">");
			pw.println("<p><b>File:</b> <input name=\"file\" type=\"file\" /></p>");
			pw.println("<p><input name=\"submit\" type=\"submit\" value=\"Submit\" /></p>");
			pw.println("</form>");
			pw.println("</body></html>");
			pw.close();
		}
		catch(Exception e) {
			e.printStackTrace();
		}
	}

	public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		try {
			Date d = new Date();
			ServletInputStream sis = req.getInputStream();
			while(sis.read() != -1);
			sis.close();
			Date d2 = new Date();
			TimeSpan ts = new TimeSpan(d, d2);
			resp.setContentType("text/html");
			PrintWriter pw = resp.getWriter();
			pw.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\";><?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>");
			pw.println("<html><head><title>File Upload</title></head><body>");
			pw.println("<p>");
			pw.println("<p>" + ts + "</p>");
			pw.println("</p>");
			pw.println("</body></html>");
			pw.close();
		}
		catch(Exception e) {
			e.printStackTrace();
		}
	}
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to