Author: toad
Date: 2009-01-13 20:16:44 +0000 (Tue, 13 Jan 2009)
New Revision: 25052
Modified:
trunk/freenet/src/freenet/io/xfer/BlockReceiver.java
trunk/freenet/src/freenet/node/NodeStats.java
Log:
Comment out Saturday's load limiting for transfer optimisation code, and
yesterday's backoff code.
Both have been interesting but haven't really solved any problems.
Bandwidth should go back to normal now.
We will analyse the performance with the new tools we've added, and then
probably implement "Proposal for dealing with slow transfers".
Modified: trunk/freenet/src/freenet/io/xfer/BlockReceiver.java
===================================================================
--- trunk/freenet/src/freenet/io/xfer/BlockReceiver.java 2009-01-13
18:47:30 UTC (rev 25051)
+++ trunk/freenet/src/freenet/io/xfer/BlockReceiver.java 2009-01-13
20:16:44 UTC (rev 25052)
@@ -68,7 +68,7 @@
private MessageFilter discardFilter;
private long discardEndTime;
private boolean tookTooLong;
- private final boolean _doTooLong;
+// private final boolean _doTooLong;
boolean logMINOR=Logger.shouldLog(Logger.MINOR, this);
@@ -79,7 +79,7 @@
_usm = usm;
_ctr = ctr;
_ticker = ticker;
- _doTooLong = doTooLong;
+// _doTooLong = doTooLong;
}
public void sendAborted(int reason, String desc) throws
NotConnectedException {
@@ -89,25 +89,25 @@
public byte[] receive() throws RetrievalException {
long startTime = System.currentTimeMillis();
- if(_doTooLong) {
- _ticker.queueTimedJob(new Runnable() {
-
- public void run() {
- if(!_sender.isConnected()) return;
- try {
- if(_prb.allReceived()) return;
- } catch (AbortedException e) {
- return;
- }
- Logger.error(this, "Transfer took too long:
"+_uid+" from "+_sender);
- synchronized(BlockReceiver.this) {
- tookTooLong = true;
- }
- _sender.transferFailed("Took too long (still
running)");
- }
-
- }, TOO_LONG_TIMEOUT);
- }
+// if(_doTooLong) {
+// _ticker.queueTimedJob(new Runnable() {
+//
+// public void run() {
+// if(!_sender.isConnected()) return;
+// try {
+// if(_prb.allReceived()) return;
+// } catch (AbortedException e) {
+// return;
+// }
+// Logger.error(this, "Transfer took too long:
"+_uid+" from "+_sender);
+// synchronized(BlockReceiver.this) {
+// tookTooLong = true;
+// }
+// _sender.transferFailed("Took too long (still
running)");
+// }
+//
+// }, TOO_LONG_TIMEOUT);
+// }
int consecutiveMissingPacketReports = 0;
try {
MessageFilter mfPacketTransmit =
MessageFilter.create().setTimeout(RECEIPT_TIMEOUT).setType(DMT.packetTransmit).setField(DMT.UID,
_uid).setSource(_sender);
Modified: trunk/freenet/src/freenet/node/NodeStats.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStats.java 2009-01-13 18:47:30 UTC
(rev 25051)
+++ trunk/freenet/src/freenet/node/NodeStats.java 2009-01-13 20:16:44 UTC
(rev 25052)
@@ -631,138 +631,138 @@
return "Input bandwidth liability
("+bandwidthLiabilityInput+" > "+bandwidthAvailableInput+")";
}
- // We want fast transfers!
- // We want it to be *possible* for all transfers currently
running to complete in a short period.
- // This does NOT assume they are all successful, it uses the
averages.
- // As of 09/01/09, the typical successful CHK fetch takes
around 18 seconds ...
+// // We want fast transfers!
+// // We want it to be *possible* for all transfers currently
running to complete in a short period.
+// // This does NOT assume they are all successful, it uses the
averages.
+// // As of 09/01/09, the typical successful CHK fetch takes
around 18 seconds ...
+//
+// // Accept a transfer if our *current* load can be completed in
the target time.
+// // We do not care what the new request we are considering is.
+// // This is more or less equivalent to what we do above but lets
more requests through.
+//
+// numRemoteCHKRequests--;
+// numRemoteSSKRequests--;
+// numRemoteCHKInserts--;
+// numRemoteSSKInserts--;
+// numLocalCHKRequests--;
+// numLocalSSKRequests--;
+// numLocalCHKInserts--;
+// numLocalSSKInserts--;
+//
+// final double TRANSFER_EVERYTHING_TIME = 5.0; // 5 seconds target
+//
+// double completionBandwidthOutput;
+// if(ignoreLocalVsRemoteBandwidthLiability) {
+// completionBandwidthOutput =
+// remoteChkFetchBytesSentAverage.currentValue() *
(numRemoteCHKRequests + numLocalCHKRequests) +
+// remoteSskFetchBytesSentAverage.currentValue() *
(numRemoteSSKRequests + numLocalSSKRequests) +
+// remoteChkInsertBytesSentAverage.currentValue()
* (numRemoteCHKInserts + numLocalCHKInserts) +
+// remoteSskInsertBytesSentAverage.currentValue()
* (numRemoteSSKInserts + numLocalSSKInserts);
+// } else {
+// completionBandwidthOutput =
+// remoteChkFetchBytesSentAverage.currentValue() *
numRemoteCHKRequests +
+// localChkFetchBytesSentAverage.currentValue() *
numLocalCHKRequests +
+// remoteSskFetchBytesSentAverage.currentValue() *
numRemoteSSKRequests +
+// localSskFetchBytesSentAverage.currentValue() *
numLocalSSKRequests +
+// remoteChkInsertBytesSentAverage.currentValue() *
numRemoteCHKInserts +
+// localChkInsertBytesSentAverage.currentValue() *
numLocalCHKInserts +
+// remoteSskInsertBytesSentAverage.currentValue() *
numRemoteSSKInserts +
+// localSskInsertBytesSentAverage.currentValue() *
numLocalSSKInserts +
+// successfulChkOfferReplyBytesSentAverage.currentValue()
* numCHKOfferReplies +
+// successfulSskOfferReplyBytesSentAverage.currentValue()
* numSSKOfferReplies;
+// }
+//
+// int outputLimit = node.getOutputBandwidthLimit();
+//
+// double outputBandwidthAvailableInTargetTime = outputLimit *
TRANSFER_EVERYTHING_TIME;
+//
+// // Increase the target for slow nodes.
+//
+// double minimum =
+// remoteChkFetchBytesSentAverage.currentValue() +
+// localChkFetchBytesSentAverage.currentValue() +
+// remoteSskFetchBytesSentAverage.currentValue() +
+// localSskFetchBytesSentAverage.currentValue() +
+// remoteChkInsertBytesSentAverage.currentValue() +
+// localChkInsertBytesSentAverage.currentValue() +
+// remoteSskInsertBytesSentAverage.currentValue() +
+// localSskInsertBytesSentAverage.currentValue() +
+// successfulChkOfferReplyBytesSentAverage.currentValue() +
+// successfulSskOfferReplyBytesSentAverage.currentValue();
+// minimum /= 2; // roughly one of each type, averaged over remote
and local; FIXME get a real non-specific average
+//
+// if(outputBandwidthAvailableInTargetTime < minimum) {
+// outputBandwidthAvailableInTargetTime = minimum;
+// if(logMINOR) Logger.minor(this, "Increased minimum time
to transfer everything to "+(minimum / outputLimit)+"s = "+minimum+"B to
compensate for slow node");
+// }
+//
+// if(logMINOR) Logger.minor(this, TRANSFER_EVERYTHING_TIME+"
second limit: "+outputBandwidthAvailableInTargetTime+" expected transfers:
"+completionBandwidthOutput);
+//
+// if(completionBandwidthOutput >
outputBandwidthAvailableInTargetTime) {
+// pInstantRejectIncoming.report(1.0);
+// rejected("Transfer speed (output)", isLocal);
+// return "Transfer speed (output)
("+bandwidthLiabilityOutput+" > "+bandwidthAvailableOutput+")";
+// }
+//
+//
+//
+// double completionBandwidthInput;
+// if(ignoreLocalVsRemoteBandwidthLiability) {
+// completionBandwidthInput =
+//
remoteChkFetchBytesReceivedAverage.currentValue() * (numRemoteCHKRequests +
numLocalCHKRequests) +
+//
remoteSskFetchBytesReceivedAverage.currentValue() * (numRemoteSSKRequests +
numLocalSSKRequests) +
+//
remoteChkInsertBytesReceivedAverage.currentValue() * (numRemoteCHKInserts +
numLocalCHKInserts) +
+//
remoteSskInsertBytesReceivedAverage.currentValue() * (numRemoteSSKInserts +
numLocalSSKInserts);
+// } else {
+// completionBandwidthInput =
+// // For receiving data, local requests are the same as
remote ones
+// remoteChkFetchBytesReceivedAverage.currentValue() *
numRemoteCHKRequests +
+// localChkFetchBytesReceivedAverage.currentValue() *
numLocalCHKRequests +
+// remoteSskFetchBytesReceivedAverage.currentValue() *
numRemoteSSKRequests +
+// localSskFetchBytesReceivedAverage.currentValue() *
numLocalSSKRequests +
+// // Local inserts don't receive the data to relay, so
use the local variant
+// remoteChkInsertBytesReceivedAverage.currentValue() *
numRemoteCHKInserts +
+// localChkInsertBytesReceivedAverage.currentValue() *
numLocalCHKInserts +
+// remoteSskInsertBytesReceivedAverage.currentValue() *
numRemoteSSKInserts +
+// localSskInsertBytesReceivedAverage.currentValue() *
numLocalSSKInserts +
+//
successfulChkOfferReplyBytesReceivedAverage.currentValue() * numCHKOfferReplies
+
+//
successfulSskOfferReplyBytesReceivedAverage.currentValue() * numSSKOfferReplies;
+// }
+// int inputLimit = node.getInputBandwidthLimit();
+// double inputBandwidthAvailableInTargetTime =
+// inputLimit * TRANSFER_EVERYTHING_TIME;
+//
+// // Increase the target for slow nodes.
+//
+// minimum =
+// remoteChkFetchBytesReceivedAverage.currentValue() +
+// localChkFetchBytesReceivedAverage.currentValue() +
+// remoteSskFetchBytesReceivedAverage.currentValue() +
+// localSskFetchBytesReceivedAverage.currentValue() +
+// remoteChkInsertBytesReceivedAverage.currentValue() +
+// localChkInsertBytesReceivedAverage.currentValue() +
+// remoteSskInsertBytesReceivedAverage.currentValue() +
+// localSskInsertBytesReceivedAverage.currentValue() +
+//
successfulChkOfferReplyBytesReceivedAverage.currentValue() +
+//
successfulSskOfferReplyBytesReceivedAverage.currentValue();
+// minimum /= 2; // roughly one of each type, averaged over remote
and local; FIXME get a real non-specific average
+//
+// if(inputBandwidthAvailableInTargetTime < minimum) {
+// inputBandwidthAvailableInTargetTime = minimum;
+// if(logMINOR) Logger.minor(this, "Increased minimum time
to transfer everything (input) to "+(minimum / inputLimit)+"s = "+minimum+"B to
compensate for slow node");
+// }
+//
+//
+//
+// if(bandwidthAvailableInput < 0){
+// Logger.error(this, "Negative available bandwidth:
"+inputBandwidthAvailableInTargetTime+"
node.ibwlimit="+node.getInputBandwidthLimit()+"
node.obwlimit="+node.getOutputBandwidthLimit()+"
node.inputLimitDefault="+node.inputLimitDefault);
+// }
+// if(completionBandwidthInput >
inputBandwidthAvailableInTargetTime) {
+// pInstantRejectIncoming.report(1.0);
+// rejected("Transfer speed (input)", isLocal);
+// return "Transfer speed (input)
("+bandwidthLiabilityInput+" > "+bandwidthAvailableInput+")";
+// }
- // Accept a transfer if our *current* load can be completed in
the target time.
- // We do not care what the new request we are considering is.
- // This is more or less equivalent to what we do above but lets
more requests through.
-
- numRemoteCHKRequests--;
- numRemoteSSKRequests--;
- numRemoteCHKInserts--;
- numRemoteSSKInserts--;
- numLocalCHKRequests--;
- numLocalSSKRequests--;
- numLocalCHKInserts--;
- numLocalSSKInserts--;
-
- final double TRANSFER_EVERYTHING_TIME = 5.0; // 5 seconds target
-
- double completionBandwidthOutput;
- if(ignoreLocalVsRemoteBandwidthLiability) {
- completionBandwidthOutput =
- remoteChkFetchBytesSentAverage.currentValue() *
(numRemoteCHKRequests + numLocalCHKRequests) +
- remoteSskFetchBytesSentAverage.currentValue() *
(numRemoteSSKRequests + numLocalSSKRequests) +
- remoteChkInsertBytesSentAverage.currentValue()
* (numRemoteCHKInserts + numLocalCHKInserts) +
- remoteSskInsertBytesSentAverage.currentValue()
* (numRemoteSSKInserts + numLocalSSKInserts);
- } else {
- completionBandwidthOutput =
- remoteChkFetchBytesSentAverage.currentValue() *
numRemoteCHKRequests +
- localChkFetchBytesSentAverage.currentValue() *
numLocalCHKRequests +
- remoteSskFetchBytesSentAverage.currentValue() *
numRemoteSSKRequests +
- localSskFetchBytesSentAverage.currentValue() *
numLocalSSKRequests +
- remoteChkInsertBytesSentAverage.currentValue() *
numRemoteCHKInserts +
- localChkInsertBytesSentAverage.currentValue() *
numLocalCHKInserts +
- remoteSskInsertBytesSentAverage.currentValue() *
numRemoteSSKInserts +
- localSskInsertBytesSentAverage.currentValue() *
numLocalSSKInserts +
- successfulChkOfferReplyBytesSentAverage.currentValue()
* numCHKOfferReplies +
- successfulSskOfferReplyBytesSentAverage.currentValue()
* numSSKOfferReplies;
- }
-
- int outputLimit = node.getOutputBandwidthLimit();
-
- double outputBandwidthAvailableInTargetTime = outputLimit *
TRANSFER_EVERYTHING_TIME;
-
- // Increase the target for slow nodes.
-
- double minimum =
- remoteChkFetchBytesSentAverage.currentValue() +
- localChkFetchBytesSentAverage.currentValue() +
- remoteSskFetchBytesSentAverage.currentValue() +
- localSskFetchBytesSentAverage.currentValue() +
- remoteChkInsertBytesSentAverage.currentValue() +
- localChkInsertBytesSentAverage.currentValue() +
- remoteSskInsertBytesSentAverage.currentValue() +
- localSskInsertBytesSentAverage.currentValue() +
- successfulChkOfferReplyBytesSentAverage.currentValue() +
- successfulSskOfferReplyBytesSentAverage.currentValue();
- minimum /= 2; // roughly one of each type, averaged over remote
and local; FIXME get a real non-specific average
-
- if(outputBandwidthAvailableInTargetTime < minimum) {
- outputBandwidthAvailableInTargetTime = minimum;
- if(logMINOR) Logger.minor(this, "Increased minimum time
to transfer everything to "+(minimum / outputLimit)+"s = "+minimum+"B to
compensate for slow node");
- }
-
- if(logMINOR) Logger.minor(this, TRANSFER_EVERYTHING_TIME+"
second limit: "+outputBandwidthAvailableInTargetTime+" expected transfers:
"+completionBandwidthOutput);
-
- if(completionBandwidthOutput >
outputBandwidthAvailableInTargetTime) {
- pInstantRejectIncoming.report(1.0);
- rejected("Transfer speed (output)", isLocal);
- return "Transfer speed (output)
("+bandwidthLiabilityOutput+" > "+bandwidthAvailableOutput+")";
- }
-
-
-
- double completionBandwidthInput;
- if(ignoreLocalVsRemoteBandwidthLiability) {
- completionBandwidthInput =
-
remoteChkFetchBytesReceivedAverage.currentValue() * (numRemoteCHKRequests +
numLocalCHKRequests) +
-
remoteSskFetchBytesReceivedAverage.currentValue() * (numRemoteSSKRequests +
numLocalSSKRequests) +
-
remoteChkInsertBytesReceivedAverage.currentValue() * (numRemoteCHKInserts +
numLocalCHKInserts) +
-
remoteSskInsertBytesReceivedAverage.currentValue() * (numRemoteSSKInserts +
numLocalSSKInserts);
- } else {
- completionBandwidthInput =
- // For receiving data, local requests are the same as
remote ones
- remoteChkFetchBytesReceivedAverage.currentValue() *
numRemoteCHKRequests +
- localChkFetchBytesReceivedAverage.currentValue() *
numLocalCHKRequests +
- remoteSskFetchBytesReceivedAverage.currentValue() *
numRemoteSSKRequests +
- localSskFetchBytesReceivedAverage.currentValue() *
numLocalSSKRequests +
- // Local inserts don't receive the data to relay, so
use the local variant
- remoteChkInsertBytesReceivedAverage.currentValue() *
numRemoteCHKInserts +
- localChkInsertBytesReceivedAverage.currentValue() *
numLocalCHKInserts +
- remoteSskInsertBytesReceivedAverage.currentValue() *
numRemoteSSKInserts +
- localSskInsertBytesReceivedAverage.currentValue() *
numLocalSSKInserts +
-
successfulChkOfferReplyBytesReceivedAverage.currentValue() * numCHKOfferReplies
+
-
successfulSskOfferReplyBytesReceivedAverage.currentValue() * numSSKOfferReplies;
- }
- int inputLimit = node.getInputBandwidthLimit();
- double inputBandwidthAvailableInTargetTime =
- inputLimit * TRANSFER_EVERYTHING_TIME;
-
- // Increase the target for slow nodes.
-
- minimum =
- remoteChkFetchBytesReceivedAverage.currentValue() +
- localChkFetchBytesReceivedAverage.currentValue() +
- remoteSskFetchBytesReceivedAverage.currentValue() +
- localSskFetchBytesReceivedAverage.currentValue() +
- remoteChkInsertBytesReceivedAverage.currentValue() +
- localChkInsertBytesReceivedAverage.currentValue() +
- remoteSskInsertBytesReceivedAverage.currentValue() +
- localSskInsertBytesReceivedAverage.currentValue() +
-
successfulChkOfferReplyBytesReceivedAverage.currentValue() +
-
successfulSskOfferReplyBytesReceivedAverage.currentValue();
- minimum /= 2; // roughly one of each type, averaged over remote
and local; FIXME get a real non-specific average
-
- if(inputBandwidthAvailableInTargetTime < minimum) {
- inputBandwidthAvailableInTargetTime = minimum;
- if(logMINOR) Logger.minor(this, "Increased minimum time
to transfer everything (input) to "+(minimum / inputLimit)+"s = "+minimum+"B to
compensate for slow node");
- }
-
-
-
- if(bandwidthAvailableInput < 0){
- Logger.error(this, "Negative available bandwidth:
"+inputBandwidthAvailableInTargetTime+"
node.ibwlimit="+node.getInputBandwidthLimit()+"
node.obwlimit="+node.getOutputBandwidthLimit()+"
node.inputLimitDefault="+node.inputLimitDefault);
- }
- if(completionBandwidthInput >
inputBandwidthAvailableInTargetTime) {
- pInstantRejectIncoming.report(1.0);
- rejected("Transfer speed (input)", isLocal);
- return "Transfer speed (input)
("+bandwidthLiabilityInput+" > "+bandwidthAvailableInput+")";
- }
-
// Do we have the bandwidth?
double expected = this.getThrottle(isLocal, isInsert, isSSK,
true).currentValue();
int expectedSent = (int)Math.max(expected / overheadFraction,
0);
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs