Testers needed: New passwd/group handling in Cygwin

Warren Young warren@etr-usa.com
Wed Mar 5 16:47:00 GMT 2014


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



More information about the Cygwin mailing list