Date: Tue, 11 Nov 2008 03:23:50 +0000 From: RW <fbsd06@mlists.homeunix.com> To: freebsd-ports@freebsd.org Cc: Eygene Ryabinkin <rea-fbsd@codelabs.ru> Subject: Re: ports/128754: [port infrastructure] implement master sites randomization Message-ID: <20081111032350.0b22a853@gumby.homeunix.com> In-Reply-To: <20081110155616.DA66A1AF424@void.codelabs.ru> References: <20081110155616.DA66A1AF424@void.codelabs.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 10 Nov 2008 18:56:16 +0300 (MSK) Eygene Ryabinkin <rea-fbsd@codelabs.ru> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081111032350.0b22a853>