[364] in java-interest

home help back first fref pref prev next nref lref last post

No subject found in mail header

daemon@ATHENA.MIT.EDU (Adam Smith)
Fri Jun 16 12:02:05 1995

From: Adam Smith <aws@ebt.com>
Date: Fri, 16 Jun 1995 15:40:44 GMT
Apparently-To: java-interest@java.sun.com

Hi all
 
I am writing a java application to stress-test a WWW server by making
numerous requests at a given frequency on a list of URL's.  For the
actual connections and all I am using net.www.html.URL .  There seem to
be some big bottlenecks in the program, and I am wondering how much is
in the URL code.  My code looks something like:
        set start_time
        input_stream = url.openStream();
        in_char = input_stream.read();
        set response_time
        while((in_char = input_stream.read()) != -1)
                // count bytes, or write to file
        set endtime
Then I calculate how long it took to get the first response from the
server, and how long after that it took to download the document.
First, is this the right idea for testing server speed?  I get fairly
long download times, which do not compare to directly fetching the
document with a web browser.  Can I increase the buffer size of the
input stream or something similar?  I have tried not downloading the
entire document and this seems to increase response times: is this due
to decreased overhead running the java processes, or more reflective of
the state of the server.
Also, I am running many of these connections at once.  Should java have
a problem in starting all these connections up at once, or keeping al
the sockets open or something?  I seem to get a much better response time
by only launching one of these tests at once: and there is a better
speed improvement than mere process overhead should provide.
 

In the end I am looking for an insight about the URL class: is it what I
should be using for this type of connection?  Can I tune it to make it
faster?  By increasing a buffer size or somesuch?  Should I be using
getContent() instead of openStream(), or maybe openStreamInteractively() ?
 
 
 
Thanks in advance for any advise or pointers,
 
Adam
 
 
 
 
Adam Smith
aws@ebt.com
aws@cs.brown.edu
 
 .

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post