upload speed test problem

Ganbold ganbold at micom.mng.net
Thu May 12 09:28:03 GMT 2005


Hi hackers,

I thought somebody in this list could help me. I looked through Java forums 
at java.sun.com, and didn't find any solution.

I'm writing speed test program in Java, and my upload speed test shows 
wrong result for Dial-up connection.
It uses POST method and sends large data (128k) to Apache 1.3.x web server 
(FreeBSD).
The web page is php script and it receives large data correct, but test 
time is "very" fast.

Result is unbelievable, it is something like 500kbps for 56kbps Dial-Up 
connection, which is completely wrong.

Can somebody tell me why is this happening? How can I correct this problem?
How can I calculate my upload speed? What data size should I use for testing?
I hope somebody in this list point me to the right direction.
Maybe I'm doing something wrong, or missing something.

thanks in advance,

Ganbold

Part of the Java code:
...........
              buffer_len = 128*1024;
              starttime1 = System.currentTimeMillis();
              URL url = new URL(web_site);
              URLConnection connection = url.openConnection();
              connection.setDoOutput(true);

	   PrintWriter out = new PrintWriter(connection.getOutputStream());
              out.print("test=");
              for(i=0; i<buffer_len;i++){
	            out.print('a');
	   }
		out.println("");
                       out.close();

  	            BufferedReader in = new BufferedReader(
	                    new InputStreamReader(
           	          connection.getInputStream()));
                       String inputLine;

		while ((inputLine = in.readLine()) != null){
//			System.out.println(inputLine);
		}
	        	in.close();
		endtime1 = System.currentTimeMillis();
		test_time = endtime1 - starttime1;

		uploaded_size = buffer_len;
		return showSpeed(starttime1,endtime1,"Upload",buffer_len);
.....................



More information about the freebsd-hackers mailing list