From owner-freebsd-ports@FreeBSD.ORG Tue Nov 11 15:35:57 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01FDD106567B for ; Tue, 11 Nov 2008 15:35:57 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from mailrelay.rz.uni-wuerzburg.de (mailrelay.rz.uni-wuerzburg.de [132.187.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id 805838FC1A for ; Tue, 11 Nov 2008 15:35:56 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id 1D654A06F4; Tue, 11 Nov 2008 16:35:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id 118CCA06F0; Tue, 11 Nov 2008 16:35:55 +0100 (CET) Received: from mail.physik.uni-wuerzburg.de (wthp192.physik.uni-wuerzburg.de [132.187.40.192]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id EBB0FA06F1; Tue, 11 Nov 2008 16:35:54 +0100 (CET) Received: from wep4035 ([132.187.37.35]) by mail.physik.uni-wuerzburg.de (Lotus Domino Release 8.0.2) with ESMTP id 2008111116355461-43499 ; Tue, 11 Nov 2008 16:35:54 +0100 Received: by wep4035 (sSMTP sendmail emulation); Tue, 11 Nov 2008 16:35:54 +0100 From: "Alexey Shuvaev" Date: Tue, 11 Nov 2008 16:35:54 +0100 To: Eygene Ryabinkin Message-ID: <20081111153554.GA4294@wep4035.physik.uni-wuerzburg.de> References: <20081110155616.DA66A1AF424@void.codelabs.ru> <20081111032350.0b22a853@gumby.homeunix.com> MIME-Version: 1.0 In-Reply-To: <20081111032350.0b22a853@gumby.homeunix.com> Organization: Universitaet Wuerzburg User-Agent: Mutt/1.5.18 (2008-05-17) X-MIMETrack: Itemize by SMTP Server on domino1/uni-wuerzburg(Release 8.0.2|August 07, 2008) at 11/11/2008 04:35:54 PM, Serialize by Router on domino1/uni-wuerzburg(Release 8.0.2|August 07, 2008) at 11/11/2008 04:35:54 PM, Serialize complete at 11/11/2008 04:35:54 PM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de Cc: freebsd-ports@freebsd.org Subject: Re: ports/128754: [port infrastructure] implement master sites randomization X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2008 15:35:57 -0000 On Tue, Nov 11, 2008 at 03:23:50AM +0000, RW wrote: > On Mon, 10 Nov 2008 18:56:16 +0300 (MSK) > Eygene Ryabinkin wrote: > > > > Today I was hit by the very bad connectivity with twaren.net and > > nchc.dl.sourceforge.net (the first site in the SF mirrors list in the > > FreeBSD ports .mk files) is hosted by Taiwan REN. So, I decided to > > implement simple randomization that will enable to evenly distribute > > the downloads between SF mirrors. > > > > ... > > +# Need to drop a couple of initial rand() values: they tend > > +# to be around 0.8 - 0.9, so for fairly small array lenght > > +# they will produce identical values at the beginning. > > + srand(); rand(); rand(); rand(); rand(); > > I think it would be sensible to seed srand from a hash of something > reproducible to make better use of caches - maybe DISTNAME+DISTVERSION. > Maybe I don't understand something, but is RANDOMIZE_MASTER_SITES (see bsd.port.mk for details) not enough? It affects though all sites, not only SF. Just my 0.02$, Alexey.