W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 2000

Re: Monitoring HTTP performance using Jigsaw

From: Yves Lafon <ylafon@w3.org>
Date: Thu, 21 Sep 2000 17:14:26 +0200 (MET DST)
To: "Eamon.Dalton" <eamon.dalton@cs.tcd.ie>
cc: www-jigsaw@w3.org
Message-ID: <Pine.GSO.4.21.0009211618480.8144-100000@tarantula.inria.fr>
On Fri, 15 Sep 2000, Eamon.Dalton wrote:

> Hi,
> 
> I'm currently running Jigsaw in proxy configuration with a filter that I
> have developed. The filter is a client side filter that implements
> PropRequestFilter.
> 
> org.w3c.www.protocol.http.filters=org.w3c.www.protocol.http.myClientSideFilter
> 
> I need to measure the amount of data and the rate that the data is
> transferred between a user making HTTP request and a target server via
> Jigsaw in proxy configuration.

The mean transfer rate or you want to get variations also?

> In ingoingFilter the following happens.
> 
>  if(request.hasOutputStream()){
>    try {
>      PipedOutputStream pout = new PipedOutputStream();
>      PipedInputStream  pin  = new PipedInputStream(pout);
>      new RequestDataMover(request.getOutputStream(),pout);
>      request.setOutputStream(pin);
>     } catch (Exception ex) {
>     }
>  }

Do you want to see how many bytes are sent to the client or how many bytes
are received? (or both), according to your code you want to count only
the incoming bytes.
The main problem here is that you won't be able to count the bytes in the
headers, so you won't be able to compute accurately the real number of 
byte transferred.

Having said that, you should take a look at ActiveStream, used in the
cache to fill two stream, one for dumping on the disk, one given back to
the client. And it gets notification of the number of bytes received when
the end is reached or if an error occured (see TeeMonitor).
You should just add a timestamp in the reply as a state, and when you are
notified by either the end of the stream or an error you can then
calculate accurately the time spent receiving the bytes and the number of
bytes. (both classes are in org.w3c.www.protocol.http.cache)

> 2. Will monitoring like this have a significant impact on throughput
> performance?

It should take a little more cpu but no big deal, I ran some test through
the cache, and the bdwth used was the same as a no-cache setup (and of
course as it dumps on the disk it takes far more time than just counting
bytes). Of course the 10baseT limit was reached, so I did not reached the
cpu used :)

> 3. If  it will impact performance, how could this be overcome?

Then you can always have a router giving you this kind of information, but
you may not be able to identify the traffic according to the user for
example. (Note that you can customize the logger to dump also the time
taken to process the request).
Hope this helps,

      /\          - Yves Lafon - World Wide Web Consortium - 
  /\ /  \        Architecture Domain - Jigsaw Activity Leader
 /  \    \/\    
/    \   /  \   http://www.w3.org/People/Lafon - ylafon@w3.org    
Received on Thursday, 21 September 2000 11:14:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:34 GMT