delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/03/05/10:35:02

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=N7OGZAe0Bj+gzlywonojfcQq5WZ/sf85Ji5qkm06TH+
4buNsS9VH/rmhxyu/8AfxnkxO7GrmPsjBnj5BjOqUeCNktk2oRF09AgIiF0MVJsD
OBF3ejgxeUysq4tLAS5PsEPCUoBz4ez7OIsHfY5m1YKtzUbNManLlxmJP1TmZdak
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=d4++q/hn22vR8Yq1zzR824L/BRA=; b=X4McihbsU+NUC0HAA
/uByxZn8hOltPI6QeRJw5Wtcf/TcOiXlCx/l4q4xdvoxvi+NroCpUiPQ6KFG1hJx
d7kmDN+28mUhImvEkUVJXoaQPTsEpajH/DieKyo97C2BRwwWz1mpFNnq41Z68KTZ
xq/Rdt2gay+CYH72shUa5Nr/gA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: etr-usa.com
Message-ID: <5317440D.4060000@etr-usa.com>
Date: Wed, 05 Mar 2014 08:34:37 -0700
From: Warren Young <warren AT etr-usa DOT com>
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Testers needed: New passwd/group handling in Cygwin
References: <87y50vc910 DOT fsf AT Rainer DOT invalid> <20140228201047 DOT GC2381 AT calimero DOT vinschen DOT de> <CAKf2h5TjyeMxuw=XkqoGMC8A_f+LpSzcx5nof5ViUBQ-0sYXFg AT mail DOT gmail DOT com> <20140228210804 DOT GE2381 AT calimero DOT vinschen DOT de> <CAKf2h5QbafQq25jndf8RdDGWsp_MMfziBep2Pe1H7rA+OmOCdA AT mail DOT gmail DOT com> <20140303092114 DOT GA26619 AT calimero DOT vinschen DOT de> <1686957830 DOT 20140303195207 AT yandex DOT ru> <53152031 DOT 3000208 AT etr-usa DOT com> <397967999 DOT 20140304053603 AT yandex DOT ru> <53155F96 DOT 3060400 AT etr-usa DOT com> <20140304080727 DOT GC7236 AT calimero DOT vinschen DOT de>
In-Reply-To: <20140304080727.GC7236@calimero.vinschen.de>
X-IsSubscribed: yes

On 3/4/2014 01:07, Corinna Vinschen wrote:
> On Mar  3 22:07, Warren Young wrote:
>>
>> You have to measure it to find out.
>
> I was inclined to go with Andrey's suggestion for simplicity.  What's
> yours?

Science!

Survey actual lookup times, and make a statistical determination from 
that.  e.g. +3 sigma[1] above the normal to capture > 99% of the Cygwin 
user base, or +6 sigma to reduce outliers to the order of 2 ppm.

To collect the data, instrument the DLL and report anonymous statistics 
back to cygwin.com if the user opts in via setup.exe.

Rather than report back continually, just keep a model of the lookup 
time[2], and report the current lookup time average on each setup.exe 
run, such as in the HTTP request for the mirror list:

     GET /mirrors.lst?adluavg=123

That is, setup.exe is reporting that the typical AD lookup time at this 
site is currently 123 ms.

Note that you don't have to write a CGI program to accomplish this. 
Apache will continue to serve static mirror.lst files for you with the 
GET parameter.[3]  It will dutifully log each query to access_log, and 
you can dig the reported lookup time values out of the file when you 
want to compile your statistics.

When calculating statistics, use only the latest value for each 
reporting IP, so that sites that update Cygwin more often don't skew the 
results.

The default timeout should be baked into the DLL, but overridable in 
nsswitch.conf, with ms resolution.

The default shouldn't be in the shipping nsswitch.conf file, because you 
want DLL updates to be able to provide a new default timeout if your 
initial guess turns out to be inappropriate.

You want ms resolution, since my test above shows at least one case 
where the normal lookup time is on the order of 1 ms.  If cygwin1.dll 
defaults to 1 s, I'd want to change my local timeout to 10 or 100 ms.



[1] https://en.wikipedia.org/wiki/Standard_deviation

[2] A decaying average technique should work.  Save the last 10 or so 
lookup times to the registry on DLL shutdown.  If there isn't that much 
lookup data on hand, start with repeats of the last known lookup time, 
or the default value.

[3] Try it: http://cygwin.com/mirrors.lst?foo=bar

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019