You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Carl A. Dunham" <ht...@strategyforward.com> on 2003/03/27 22:22:33 UTC
Intensive multi-threading example
This might be useful as a demonstration of the issues surrounding connecting
to hundreds of sites. In fact, this will generate some nasty outcomes with
only a single URL, http://msn.com (it could be said that any connection to
this URL is a nasty outcome, but... ^_^).
Run this and give it a list of URLs. It runs a fixed number of threads all
looping pulling random URLs from the list and downloading them. Running
netstat alongside it gives a pretty good picture of the issues...
That and 'ps'. Seem to have a lot of '<defunct>' threads for some reason...
I also attached a file of particularly difficult URLs, many not resolvable,
refuse to connect, generally behave badly. There are some bad servers out
there! Enjoy!
Command to run:
% java -Xmx512m -Xms512m -cp .:commons-logging.jar:commons-httpclient.jar SimpleDownloader
Carl