From owner-freebsd-stable Tue Jun 19 0:31:18 2001 Delivered-To: freebsd-stable@freebsd.org Received: from gscamnlm03.wr.usgs.gov (gscamnlm03.wr.usgs.gov [130.118.4.113]) by hub.freebsd.org (Postfix) with ESMTP id 6FEEB37B403; Tue, 19 Jun 2001 00:31:12 -0700 (PDT) (envelope-from rsowders@usgs.gov) To: Calvin NG Cc: Fred Condo , owner-freebsd-stable@FreeBSD.ORG, stable@FreeBSD.ORG Subject: Re: Benchmarking CVSup MIME-Version: 1.0 X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: "Robert L Sowders" Date: Tue, 19 Jun 2001 00:31:09 -0700 X-MIMETrack: Serialize by Router on gscamnlm03/SERVER/USGS/DOI(Release 5.0.7 |March 21, 2001) at 06/19/2001 12:31:11 AM, Serialize complete at 06/19/2001 12:31:11 AM Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Building on the work of others. This should answer the intent of your question. Try these to get the fastest mirror regardless of hops. Sometimes you can get faster transfers with more hops. It'll take about 15 seconds to give results. #!/bin/sh for i in `jot 16` do echo -n "cvsup${i} " traceroute -n cvsup${i}.freebsd.org 2>&1 | tail -1 done | sort +7 -n Or if you don't care about all the extraneous info here's another way. I limited traceroute to 20 hops (if it's further than that just give it up.) #!/bin/sh for i in `jot 16` do MS=`traceroute -n -m 20 cvsup${i}.freebsd.org 2>&1 |\ tail -1 | cut -f5,6 -d" "` echo " " echo "cvsup${i} $MS " done | sort +1 -n These are inefficient/slow, being sequential, a faster method would open multi processes and do them at the same time. The fastest will be at the top but if it runs into a site that answer with a * ttl on the last hop it will be at the top. If you want to build something in to catch this go ahead. But hey, it's not for brain surgery or anything. Calvin NG Sent by: owner-freebsd-stable@FreeBSD.ORG 06/17/2001 08:24 PM To: Fred Condo cc: stable@FreeBSD.ORG Subject: Re: Benchmarking CVSup Greetings, hey, that only count the hops, I would tot avg ping response would be more interesting, so how about inside the loop, do echo -n "cvsup${i} " ping -c 10 cvsup${i}.freebsd.org | tail -1 Regards, /calvin lines with :> are quotes from Fred Condo's email :> On Sat, Jun 16, 2001 at 06:57:51AM -0400, Chris BeHanna wrote: :> > On Sat, 16 Jun 2001, Mike Meyer wrote: :> > :> > > Chris BeHanna types: :> > > > There's probably a better way to do this (e.g., sort the output in :> > > > increasing order of hopcount): :> > > :> > > Yes, but why resort to :> > > :> > > > #!/usr/bin/perl :> > > :> > > when you can just do: :> > > :> > > for i in `jot 16` :> > > do :> > > echo -n "cvsup${i} " :> > > traceroute -n cvsup${i}.freebsd.org 2>&1 | wc -l :> > > done | sort +1 -n :> > :> > I quote: "There's probably a better way to do this...." :-) :> > :> > > Getting the correct hop count is left as an exercise for the reader. :> > :> > -traceroute -n cvsup${i}.freebsd.org 2>&1 | wc -l :> > +expr `traceroute -n cvsup${i}.freebsd.org 2>&1 | wc -l` - 1 :> :> or this: :> traceroute -n cvsup${i}.freebsd.org 2>/dev/null | wc -l :> :> > :> > Works great. Thanks! :> > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message