Packetsize ,buffersize ,bandwidth,!_NEWLINE_!packeloss etc
1 posts in topic
Flat View  Flat View

Posted By:   Panos_Koup
Posted On:   Tuesday, March 27, 2001 02:53 AM

I am developing an application that sends Http requests in a web server in a LAN and receives the responses.My goal is to evaluate the performance of the network and of the web server.
---How can i define packetsize or the buffersize through java.net(urlconnection or from somewhere else)?
--How can i measure the bandwidth or the packet loss?
--Is anything else i must measure or i must define?

Re: Packetsize ,buffersize ,bandwidth,!_NEWLINE_!packeloss etc

Posted By:   Tim_Rohaly  
Posted On:   Saturday, April 21, 2001 10:42 AM

Accurately measuring performance of a web server under stress (or indeed,
doing any sort of benchmarking) is a very complicated undertaking, you
might think of using an existing public-domain product to do this
for you. See the FAQ at http://www.jguru.com/faq/view.jsp?EID=15748
for some suggestions. Since it doesn't sound like you completely
understand how difficult this will be to do properly, I suggest you
look at these first.

java.net.Socket has methods which provide some control over
socket options like OS socket buffer size. You may also buffer requests/responses
in your code using buffered streams. Packet size is determined by a number
of things, including the MTU of the network, the protocol (e.g. HTTP) that you are
using, and whether or not TCP_NODELAY is set. You will probably not want
to use URLConnection because you don't have access to its underlying
socket to set these options.

Bandwidth will probably not be a limiting factor because of the
small size of the HTTP requests and because of the overhead
involved on both the client and server dealing with the requests
and responses. TCP slow start will have a significant impact in
your measurement here. Just as a rule of thumb, expect an
HTTP response to take about 1 second. When you realize that
you are sending typically less than 100 bytes and receiving
usually only a few KBytes of information in response, and that
this is happening over a 10Mbit/s or 100Mbit/s LAN, you
will see that the network bandwidth adds negligible overhead to the

What do you mean by packet loss? Packets can only be dropped
by routers/bridges etc. So to measure packet loss you will have to
query these devices directly using something like SNMP. Or you could
use a promiscuous socket and monitor the TCP traffic directly, looking
for retransmit requests.

Your monitoring should be done on a computer that is neither
the client nor the server, otherwise you will affect the results by
sharing CPU time. It is also likely that unless you are careful
your results will be completely dominated by the quality of your
testing code and have little to do with the actual web server

About | Sitemap | Contact