Skip to content

Commit ad422a7

Browse files
TrivueleArneBab
authored andcommitted
Replace RequestStarter throttling with simplier logic
The RequestStarter logic was subtly broken in multiple ways: - Bad interaction between rtt and window estimates would cause your node to oscillate between starting way more requests than the network can handle and almost stalling entirely for minutes. The speed difference may be a factor 100x from one minute to another. - Nodes patched with the infamous RequestStarter patches would cause your node to throttle down on number of requests started to their advantage. This could potentially be exploited by an attacker as well. - The window estimation would attempt to throttle the speed to target a certain ratio of requests succeeding without getting dropped due to rejected-overload. This would avoid meltdown of the network, but the target was not hard-coded but dependant on average network speed among other things, in practice ending up allowing 30% of requests to fail. - The window estimation was changed according to an AIMD schedule. This would have encouraged nodes on the network to agree on a speed collectively, but the logic deviated from AIMD in undocumented ways, for example by making the incremental step multiplicative. It is unclear if this would actually cause any agreement on the network. - All code was completely undocumented, had many seemingly arbitrarily chosen constants, and multiple lines of code with no effect at all. - There are other ways to design the estimation of an ideal request starting speed that avoids most of the above problems, but it would still require selecting some arbitrary constants, so not obviously better than replacing all logic altogether with a single constant. The whole thing can be viewed as a single network constant; the number of requests per second and peer we can start to cause an ideal load on the network, assuming distribution of types of requests and idling and busy nodes looks like it does today. The biggest advantage of this method is that it causes a very even starting of requests everywhere in the network, with no oscillating speeding that chokes parts of the space in turns. This may enable faster speeds with fewer rejected-overloads and peer backoffs. There are other advantages with this simple method as well. If a future release does something that improves or worsen rejected-overload ratio or average request completion time, it will show clearly in the stats. The network will not try to conceal the change. The constant was tuned to an empirical value matching todays average request starting speed. This may need finetuning in future releases if rejected-overload situation improves and higher speeds are possible. Made all stats average over whole session, but no persistent. This makes them more useful to judge state of network.
1 parent 95b91d6 commit ad422a7

20 files changed

+127
-339
lines changed

src/freenet/clients/http/StatisticsToadlet.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -544,17 +544,11 @@ private void drawLoadBalancingBox(HTMLNode loadStatsInfobox, boolean realTime) {
544544
loadStatsInfobox.addChild("div", "class", "infobox-header", "Load limiting "+(realTime ? "RealTime" : "Bulk"));
545545
HTMLNode loadStatsContent = loadStatsInfobox.addChild("div", "class", "infobox-content");
546546
RequestStarterGroup starters = core.requestStarters;
547-
double window = starters.getWindow(realTime);
548-
double realWindow = starters.getRealWindow(realTime);
549547
HTMLNode loadStatsList = loadStatsContent.addChild("ul");
550-
loadStatsList.addChild("li", l10n("globalWindow")+": "+window);
551-
loadStatsList.addChild("li", l10n("realGlobalWindow")+": "+realWindow);
552548
loadStatsList.addChild("li", starters.statsPageLine(false, false, realTime));
553549
loadStatsList.addChild("li", starters.statsPageLine(true, false, realTime));
554550
loadStatsList.addChild("li", starters.statsPageLine(false, true, realTime));
555551
loadStatsList.addChild("li", starters.statsPageLine(true, true, realTime));
556-
loadStatsList.addChild("li", starters.diagnosticThrottlesLine(false));
557-
loadStatsList.addChild("li", starters.diagnosticThrottlesLine(true));
558552
}
559553

560554
private void drawNewLoadManagementBox(HTMLNode infobox) {

src/freenet/l10n/freenet.l10n.de.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,6 @@ StatisticsToadlet.distanceStats=Entfernungsstatistiken
17571757
StatisticsToadlet.falsePos=Falsch positive
17581758
StatisticsToadlet.fullTitle=Statistiken
17591759
StatisticsToadlet.getLogs=Letzte Log-Datei des Knotens abrufen
1760-
StatisticsToadlet.globalWindow=Globales Fenster
17611760
StatisticsToadlet.inputRate=Eingehend: ${rate}/sec (von ${max}/sec)
17621761
StatisticsToadlet.jobType=Job Typ
17631762
StatisticsToadlet.jvmInfoTitle=Java-Info

src/freenet/l10n/freenet.l10n.en.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,6 @@ StatisticsToadlet.foafBytes=FOAF related: ${total}
19851985
StatisticsToadlet.fullTitle=Statistics
19861986
StatisticsToadlet.furthestSuccess=Furthest Success
19871987
StatisticsToadlet.getLogs=Get latest node's logfile
1988-
StatisticsToadlet.globalWindow=Global window
19891988
StatisticsToadlet.inputRate=Input Rate: ${rate}/s (of ${max}/s)
19901989
StatisticsToadlet.insertOutput=Insert output (excluding payload): CHK ${chk} SSK ${ssk}.
19911990
StatisticsToadlet.jobType=Job Type
@@ -2017,7 +2016,6 @@ StatisticsToadlet.priority=Priority
20172016
StatisticsToadlet.PUB_KEY=Pubkey
20182017
StatisticsToadlet.queuedCount=Queued Count
20192018
StatisticsToadlet.readRequests=Read-Requests
2020-
StatisticsToadlet.realGlobalWindow=Real global window
20212019
StatisticsToadlet.requestOutput=Request output (excluding payload): CHK ${chk} SSK ${ssk}.
20222020
StatisticsToadlet.resendBytes=Resent bytes: ${total} (${percent}%)
20232021
StatisticsToadlet.routingBackoffReason=Routing Backoff Reason

src/freenet/l10n/freenet.l10n.es.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,6 @@ StatisticsToadlet.foafBytes=De amigo de un amigo (FOAF): ${total}
18961896
StatisticsToadlet.fullTitle=Estadísticas
18971897
StatisticsToadlet.furthestSuccess=Éxito más lejano
18981898
StatisticsToadlet.getLogs=Ver último fichero de registro (log)
1899-
StatisticsToadlet.globalWindow=Ventana global
19001899
StatisticsToadlet.inputRate=Tasa de entrada: ${rate}/s (de ${max}/s)
19011900
StatisticsToadlet.insertOutput=Salida de inserciones (excluyendo carga útil): CHK ${chk} SSK ${ssk}.
19021901
StatisticsToadlet.jobType=Tipo de trabajo
@@ -1928,7 +1927,6 @@ StatisticsToadlet.priority=Prioridad
19281927
StatisticsToadlet.PUB_KEY=Clave pública
19291928
StatisticsToadlet.queuedCount=En cola
19301929
StatisticsToadlet.readRequests=Peticiones de lectura
1931-
StatisticsToadlet.realGlobalWindow=Ventana global real
19321930
StatisticsToadlet.requestOutput=Salida de peticiones (excluyendo carga útil): CHK ${chk} SSK ${ssk}.
19331931
StatisticsToadlet.resendBytes=Bytes reenviados: ${total} (${percent}%)
19341932
StatisticsToadlet.routingBackoffReason=Motivo de desasistencia de enrutamiento

src/freenet/l10n/freenet.l10n.fa.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,6 @@ StatisticsToadlet.clientRequesters.priorityClass=کلاس اولویت
803803
StatisticsToadlet.clientRequesters.uri=آدرس اینترنتی
804804
StatisticsToadlet.datasize=اندازه داده
805805
StatisticsToadlet.fullTitle=آمار
806-
StatisticsToadlet.globalWindow=پنجره سراسری
807806
StatisticsToadlet.jvmInfoTitle=نوع جاوا
808807
StatisticsToadlet.keys=کلید ها
809808
StatisticsToadlet.maxTotalPeers=همتایان بیشینه

src/freenet/l10n/freenet.l10n.fr.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,7 +1896,6 @@ StatisticsToadlet.foafBytes=Connexe aux amis d’un ami : ${total}
18961896
StatisticsToadlet.fullTitle=Statistiques
18971897
StatisticsToadlet.furthestSuccess=Succès le plus éloigné
18981898
StatisticsToadlet.getLogs=Obtenir le dernier journal du nœud
1899-
StatisticsToadlet.globalWindow=Fenêtre globale
19001899
StatisticsToadlet.inputRate=Taux d’entrée : ${rate}/s (sur ${max}/s)
19011900
StatisticsToadlet.insertOutput=Sortie d’insertion (excluant la charge utile) : CHK ${chk} SSK ${ssk}.
19021901
StatisticsToadlet.jobType=Type de travail
@@ -1928,7 +1927,6 @@ StatisticsToadlet.priority=Priorité
19281927
StatisticsToadlet.PUB_KEY=Clé publique
19291928
StatisticsToadlet.queuedCount=Compteur de la file d’attente
19301929
StatisticsToadlet.readRequests=Requêtes de lecture
1931-
StatisticsToadlet.realGlobalWindow=Fenêtre globale réelle
19321930
StatisticsToadlet.requestOutput=Sortie des requêtes (excluant la charge utile) : CHK ${chk} SSK ${ssk}.
19331931
StatisticsToadlet.resendBytes=Octets renvoyés : ${total} (${percent} %)
19341932
StatisticsToadlet.routingBackoffReason=Raison de la temporisation (backoff) du routage

src/freenet/l10n/freenet.l10n.it.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,6 @@ StatisticsToadlet.falsePos=Falsi positivi
17411741
StatisticsToadlet.fullTitle=Statistiche
17421742
StatisticsToadlet.furthestSuccess=Successo più lontano
17431743
StatisticsToadlet.getLogs=Prendi l'ultimo file di registro del nodo
1744-
StatisticsToadlet.globalWindow=Finestra globale
17451744
StatisticsToadlet.inputRate=Tasso di input: ${rate}/s (di ${max}/s)
17461745
StatisticsToadlet.insertOutput=Output degli inserimenti (escludendo il carico utile): CHK ${chk} SSK ${ssk}
17471746
StatisticsToadlet.jobType=Tipo di lavoro
@@ -1770,7 +1769,6 @@ StatisticsToadlet.priority=Priorità
17701769
StatisticsToadlet.PUB_KEY=Pubkey (chiave pubblica)
17711770
StatisticsToadlet.queuedCount=Conteggio accodato
17721771
StatisticsToadlet.readRequests=Richieste di lettura
1773-
StatisticsToadlet.realGlobalWindow=Finestra reale globale
17741772
StatisticsToadlet.requestOutput=Output delle richieste (carico utile escluso): CHK ${chk} SSK ${ssk}.
17751773
StatisticsToadlet.resendBytes=Bytes rispediti: ${total} (${percent}%)
17761774
StatisticsToadlet.routingBackoffReason=Motivo del recesso dell'instradamento

src/freenet/l10n/freenet.l10n.ja.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,6 @@ StatisticsToadlet.foafBytes=友達の友達関係: ${total}
12001200
StatisticsToadlet.fullTitle=統計
12011201
StatisticsToadlet.furthestSuccess=もっとも遠い成功
12021202
StatisticsToadlet.getLogs=ノードの最新のログファイルを入手
1203-
StatisticsToadlet.globalWindow=グローバルウィンドウ
12041203
StatisticsToadlet.inputRate=入力レート: ${rate}/s (of ${max}/s)
12051204
StatisticsToadlet.insertOutput=インサート出力 (ペイロードを含まず): CHK ${chk} SSK ${ssk}.
12061205
StatisticsToadlet.jobType=ジョブタイプ

src/freenet/l10n/freenet.l10n.nb-no.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,6 @@ StatisticsToadlet.datastore=Datalager
14651465
StatisticsToadlet.databaseJobsByPriority=Database-jobber
14661466
StatisticsToadlet.distanceStats=Distansestatistikk
14671467
StatisticsToadlet.fullTitle=Statistikk
1468-
StatisticsToadlet.globalWindow=Hovedvindu
14691468
StatisticsToadlet.jobType=Jobb-type
14701469
StatisticsToadlet.jvmInfoTitle=JVM-info
14711470
StatisticsToadlet.jvmName=Java VM-navn: ${name}

src/freenet/l10n/freenet.l10n.nl.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,7 +1838,6 @@ StatisticsToadlet.foafBytes=FOAF gerelateerd: ${total}
18381838
StatisticsToadlet.fullTitle=Statistieken
18391839
StatisticsToadlet.furthestSuccess=Verste succes
18401840
StatisticsToadlet.getLogs=Haal het meest recente logbestand op
1841-
StatisticsToadlet.globalWindow=Globale venster
18421841
StatisticsToadlet.inputRate=Huidig inkomend verbruik: ${rate}/s (max ${max}/s)
18431842
StatisticsToadlet.insertOutput=Uitgaand invoegingenverkeer (exclusief payload): CHK ${chk} SSK ${ssk}.
18441843
StatisticsToadlet.jobType=Taak type
@@ -1868,7 +1867,6 @@ StatisticsToadlet.peerStatsTitle=Peer-statistieken
18681867
StatisticsToadlet.priority=Prioriteit
18691868
StatisticsToadlet.queuedCount=Aantal queued
18701869
StatisticsToadlet.readRequests=Leesverzoeken
1871-
StatisticsToadlet.realGlobalWindow=Ware globale venster
18721870
StatisticsToadlet.requestOutput=Uitgaande verzoeken (exclusief payload): CHK ${chk} SSK ${ssk}.
18731871
StatisticsToadlet.resendBytes=Opnieuw verstuurde bytes: ${total}
18741872
StatisticsToadlet.routingBackoffReason=Routering terugtreedreden

0 commit comments

Comments
 (0)