I tried changing my estimate removing SearchFailed and saw a lot more RNFs.

Toad
>They don't work (maybe they could though)
What's wrong with them? I know tSearchFailed averages the results from several errors but what could you do with them identified individually.


>and exponential back off provides an effective mechanism.
I would say no. It's an improvement. I was trying out a fixed 20s before upgrading but without a objective way of testing it, just like most of the current changes.


The only other thing I can think of is fixing a range of probabilities to a single value.
e.g. pSearchFailed
0.999-1.0 estimate uses 0.999
0.9-0.999 estimate uses 0.95
0.8-0.9 estimate uses 0.85
Don't know if it would help achieve what I'm after. To make the destination for requests more consistent.
        static final double MIN_SUCCESS_P = 1.0E-12;
        
        
        public Estimate longEstimate(Key k, int htl, long size, double requestFailTime,
                                                                 double pLegitDNF) {
                double pConnectFailed = needConnection ? 
rpConnectFailed.currentValue() : 0;
                double pConnectSuccess = needConnection ? 
1-rpConnectFailed.currentValue() : 1;
                double tConnectFailed = needConnection ? 
rtConnectFailed.currentValue() : 0;

                double pSearchFailed = rpSearchFailed.currentValue();
                double tSearchFailed = rtSearchFailed.currentValue();
                double vSearchFailed = pConnectSuccess * pSearchFailed;
                double vSearchSuccess = pConnectSuccess * (1 - pSearchFailed);

                // can this happen?
                if (pLegitDNF < 0.0 || pLegitDNF > 1.0) {
                        Core.logger.log(this, "bad pLegitNDF " + pLegitDNF, 
Logger.ERROR);
                        pLegitDNF = pLegitDNF < 0.0 ? 0.0 : 1.0;
                }
                double pDNF = 0.0;
                if (pLegitDNF < 1.0)
                        pDNF = 
Math.max(epDNFGivenNotSearchFailed.guessProbability(k)-pLegitDNF, 0.0) / (1-pLegitDNF);
                double tDNF = etDNF.guessTime(k) * htl;
                double vDNF = vSearchSuccess * pDNF;
                double vDF = vSearchSuccess * (1 - pDNF);

                double pTransferFailed = rpTransferFailed.currentValue();
                double tTransferFailed = rtTransferFailed.currentValue();
                double vTransferFailed = vDF * pTransferFailed;
                double vTransferSuccess = vDF * (1 - pTransferFailed);

                double transferRate = etTransferRate.guessTransferRate(k);
                if(transferRate == 0.0)
                        Core.logger.log(this, "Insane transfer rate: "+transferRate+" 
on "+
                                        this, Logger.NORMAL);
                double tSuccessSearch = etSuccessSearch.guessTime(k);
                double tFullSuccess = tSuccessSearch + (((double)size) / transferRate);

                double failure = pConnectFailed * tConnectFailed +
                                                vSearchFailed * tSearchFailed +
                                                vDNF * tDNF +
                                                vTransferFailed * tTransferFailed;

                if (vTransferSuccess < MIN_SUCCESS_P) {
                        Core.logger.log(this, "vSuccess is very low (" + 
vTransferSuccess + "). Using " + MIN_SUCCESS_P + " for estimate", Logger.DEBUG);
                }
                double estimate = tFullSuccess + 
failure/Math.max(vTransferSuccess,MIN_SUCCESS_P);

                if ((double)Long.MAX_VALUE < estimate) {
                        Core.logger.log(this, "estimate exceeds maximum, reducing", 
Logger.DEBUG);
                        estimate = Long.MAX_VALUE;
                }

                long e = (long)estimate;
                lastEstimate = e;
                Estimate es = new Estimate(this, e, (long)tSuccessSearch, 
transferRate);
                return es;
        }
_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to