DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23948>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23948

HTTP upload slow when Solaris and Internet Explorer

           Summary: HTTP upload slow when Solaris and Internet Explorer
           Product: Tomcat 5
           Version: 5.0.12
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Connector:HTTP/1.1
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I found that HTTP uploads are very slow when using Tomcat on Solaris and 
Internet Explorer on Windows. I tested with Tomcat 5.0.12, J2SE 1.4.2_01, 
Solaris 8 with a recent patch cluster installed, Internet Explorer 6 on 
Windows XP and Windows 2000 with Windows updates applied. The test was 
performed using a 100 Mbs Ethernet network. Internet Explorer consistently 
only uploads at about 80 KBs. The problem seems to be specific to Internet 
Explorer. Mozilla 1.5 can upload at about 3 MBs. The problem also seems to be 
specific to Solaris. I tested with the same version of Tomcat and J2SE on 
Linux and the problem didn't occur. Internet Explorer was able to upload at 
over 4 MBs to my Linux computer. I also tested with a local copy of Tomcat on 
my Windows computer and the problem didn't occur there either. I also tested 
with Tomcat 4.1.24 and the problem occurred there as well.

Also, I have a Perl application on another Solaris computer which is able to 
perform HTTP uploads without a problem. So, the problem seems to be a 
combination of Solaris, Tomcat, and Internet Explorer.

The following is the application that I used to test the problem. The 
application doesn't actually decode the HTTP upload, only reads from the 
stream, so, the problem seems to be with the network code. Could it be a 
buffer size issue?

I've noticed other odd things as well. For example I found that Mozilla 
actually gets better data transfer rates using HTTPS rather than HTTP.

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();
                }
        }
}

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;
}

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

Reply via email to